Skip to content

Commit 35b56ae

Browse files
committed
fix issue in books when page-footer is a link
Change has been made in 90e04f4 following discussion in #3441 to allow `href` being a .qmd file to be rendered. Though when `href` is a link, it made Windows fails because our globExpanson on Linux knows to ignore https:// one, and on Windows it doesn't. Deno behavior for `expandGlobSync` - see discussion in issue #8737)
1 parent d047195 commit 35b56ae

File tree

9 files changed

+85
-1
lines changed

9 files changed

+85
-1
lines changed

src/project/types/book/book-config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ import {
124124
} from "../../../resources/types/schema-types.ts";
125125
import { projectType } from "../project-types.ts";
126126
import { BookRenderItem, BookRenderItemType } from "./book-types.ts";
127+
import { isAbsoluteRef } from "../../../core/http.ts";
127128

128129
export async function bookProjectConfig(
129130
project: ProjectContext,
@@ -255,7 +256,7 @@ export async function bookProjectConfig(
255256
for (const item of region) {
256257
if (typeof item !== "string") {
257258
const navItem = item as NavigationItemObject;
258-
if (navItem.href) {
259+
if (navItem.href && !isAbsoluteRef(navItem.href)) {
259260
footerFiles.push(navItem.href);
260261
}
261262
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
/_book/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
project:
2+
type: book
3+
4+
book:
5+
title: "Testing Page Footer"
6+
author: "Norah Jones"
7+
date: "22/02/2024"
8+
chapters:
9+
- index.qmd
10+
- intro.qmd
11+
- summary.qmd
12+
- references.qmd
13+
page-footer:
14+
left:
15+
- text: Quarto
16+
href: https://quarto.org
17+
right: "Some text"
18+
center:
19+
- text: "Licence"
20+
href: license.qmd
21+
22+
bibliography: references.bib
23+
24+
format:
25+
html:
26+
theme: cosmo
27+
pdf:
28+
documentclass: scrreprt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
_quarto:
3+
tests:
4+
html:
5+
ensureHtmlElements:
6+
-
7+
- 'footer.footer div.nav-footer-left a.nav-link[href="https://quarto.org"]'
8+
- 'footer.footer div.nav-footer-center a.nav-link[href$="license.html"]'
9+
- 'footer.footer div.nav-footer-right p'
10+
- []
11+
---
12+
13+
# Preface {.unnumbered}
14+
15+
This is a Quarto book.
16+
17+
To learn more about Quarto books visit <https://quarto.org/docs/books>.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Introduction
2+
3+
This is a book created from markdown and executable code.
4+
5+
See @knuth84 for additional discussion of literate programming.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Licence for this project
3+
---
4+
5+
License content file
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@article{knuth84,
2+
author = {Knuth, Donald E.},
3+
title = {Literate Programming},
4+
year = {1984},
5+
issue_date = {May 1984},
6+
publisher = {Oxford University Press, Inc.},
7+
address = {USA},
8+
volume = {27},
9+
number = {2},
10+
issn = {0010-4620},
11+
url = {https://doi.org/10.1093/comjnl/27.2.97},
12+
doi = {10.1093/comjnl/27.2.97},
13+
journal = {Comput. J.},
14+
month = may,
15+
pages = {97–111},
16+
numpages = {15}
17+
}
18+
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# References {.unnumbered}
2+
3+
::: {#refs}
4+
:::
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Summary
2+
3+
In summary, this book has no content whatsoever.

0 commit comments

Comments
 (0)