How can I create HTML output in different speaking language (English and German)?

I'm currently working on a RMarkdown document in English, I want to knit my document in German also, so I wrote the translated rmarkdown documents in German, now I have a similar structure to this :

content
	├── about.en.md
	├── about.de.md
	└── exp.en.md
	├── exp.de.md
	├── index.md
	└── index.en.md

this is the code in my header where I have the hyperlink

> <div id="pagetitle">
title
</div>

<div class="lang">
  <ul>
    
      <li><a class="de" href="index-de.html">
        De </a></li>
    
      <li><a class="en" href="index-en.html">En</a></li>
    
  </ul>
</div>

this is my _site.yml code:

name: "title"
output:
html_document:
output_dir: "."
include:
before_body: header.html
css: style.css

but the problem is its switching only on the index-en.html so I can't go to the other pages, I'm not sure how to localize it..
what is the way to do this??

because putting lang="de" in Yaml of every document, doesn't do the work, I'm sure there is something I'm missing because of my small expertise.

I've been trying to find a solution but since I'm working with RMarkdown for the first time, no documentation was actually helpful, I hope you can show me how to do this, I'm sure this can sound like a stupid question to some, but for beginners this is a bit confusing, thank you so much, I would be very grateful for any help.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.