Skip to content

Commit f16e835

Browse files
authored
Merge pull request #13576 from quarto-dev/add-test-7318
2 parents 109d513 + d6e1634 commit f16e835

File tree

10 files changed

+85
-0
lines changed

10 files changed

+85
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
**/*.quarto_ipynb
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
project:
2+
title: "Project"
3+
type: website
4+
format:
5+
html:
6+
template-partials:
7+
- metadata.html
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Document 1"
3+
_quarto:
4+
tests:
5+
html:
6+
ensureFileRegexMatches:
7+
- ['<title>This text will be overwritten.</title>']
8+
---
9+
10+
This is sample document 1.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: "Document 2"
3+
format:
4+
html:
5+
template-partials:
6+
- metadata.html
7+
_quarto:
8+
tests:
9+
html:
10+
ensureFileRegexMatches:
11+
- ['<title>This text will be overwritten.</title>']
12+
---
13+
14+
This is sample document 2.
15+
16+
The `format` metadata is redundant with that in `_quarto.yml`,
17+
but it's here to show that if you remove those options from `_quarto.yml`
18+
but leave them here, the bug will remain the same.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
_quarto:
3+
tests:
4+
html:
5+
ensureFileRegexMatches:
6+
- ['<title>This text will be overwritten.</title>']
7+
---
8+
9+
This is sample document 3, and this one actually works correctly!
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<title>This text will be overwritten.</title>
2+
<!-- I'm not actually trying to have two titles; this just shows the issue more clearly. -->
3+
<!-- Also, these comments show that the rest of this file's contents will be copied over faithfully. -->
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
**/*.quarto_ipynb
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
project:
2+
type: website
3+
4+
website:
5+
title: "shortcode in title"
6+
navbar:
7+
left:
8+
- href: index.qmd
9+
text: Home
10+
- about.qmd
11+
12+
format: html
13+
14+
custom-title-about: "YOLO"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "{{< meta custom-title-about >}} Page"
3+
_quarto:
4+
tests:
5+
html:
6+
ensureFileRegexMatches:
7+
- ['<title>YOLO Page – shortcode in title</title>']
8+
---
9+
10+
This page should have shortcode in title resolved from the `_quarto.yml` metadata.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "shortcode in title"
3+
_quarto:
4+
tests:
5+
html:
6+
ensureFileRegexMatches:
7+
- ['<title>shortcode in title</title>']
8+
---
9+
10+
Title is same as website title, and should not be repeated.

0 commit comments

Comments
 (0)