quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.6k stars 294 forks source link

Hyperlink to external website from book sidebar #1973

Open dvirlar2 opened 1 year ago

dvirlar2 commented 1 year ago

Hi there, Quarto team!

When working in a Quarto book, is it possible right now to have a "chapter" hyperlink to a different website? Specifically, I'm thinking about how Bookdown uses specific code in the bookdown::gitbook: section of the _output.yml file (code linked) to create the "View book source" link on the Tidy Text Mining site.

I'm trying to convert my team's training manual from a bookdown to a quarto book, and I've been racking my brain trying to figure this out to link to our extra reference manual from the main training document. I feel like I keep just barely skirting around the solution, but I just can't seem to put things together 😅 I know I can get creative and just make the document a website rather than a book and get things to work that way, but I'm curious if there's a current way to make this work from a book, specifically.

Apologies if this already been asked, I've perused all the discussions and issues, but still could have missed it! Thanks!

jjallaire commented 1 year ago

No, I don't think this is possible right now. The best you could do would be to create a chapter that is empty save for a JavaScript redirect:

```{=html}
<script type="text/javascript">
window.location.replace("https://example.com");
</script>


You can also insert headers and footers for the right margin sidebar: https://quarto.org/docs/websites/website-tools.html#headers-footers

Note that there is also a feature for GitHub links: https://quarto.org/docs/websites/website-navigation.html#github-links