How do I change the navbar in a subdirectory? #13158
-
DescriptionI want to have a German and an English version of my website. For this I put the German content .qmd file in the root directory and the english ones in an en/ subfolder. I would like the navbar to be displayed in the same language as the document that is currently open. After reading the Project Basics page in the documentation, I thought this could be done by adding a _metadata.yml file to the en/ subdirectory, where the navbar is overwritten. So I have the file _quarto.yml in the root directory: project:
type: website
website:
title: "Daniel Strenger"
site-url: "https://danielstrenger.github.io"
navbar:
left:
- text: "Über mich"
href: about.qmd
right:
- icon: globe
menu:
- text: Deutsch
href: /
- text: English
href: /en/ and _metadata.yml in the en/ directory: website:
navbar:
left:
- text: "About"
href: about.qmd
right:
- icon: globe
menu:
- text: Deutsch
href: /
- text: English
href: /en/ But the navbar still appears in German everywhere. How can I change this? Many thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As documented, Many others from the community made multilingual websites and books. I suggest to search in issues and in discussions to see how they've done it. |
Beta Was this translation helpful? Give feedback.
As documented,
website
is a project level configuration thus it can only be set in_quarto.yml
. (https://quarto.org/docs/websites/#config-file)For short, use "project profiles" and conditional contents. (https://quarto.org/docs/projects/profiles.html)
Many others from the community made multilingual websites and books.
I suggest to search in issues and in discussions to see how they've done it.