Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: language streams #154

Open
rochacbruno opened this issue Nov 20, 2024 · 3 comments
Open

feat: language streams #154

rochacbruno opened this issue Nov 20, 2024 · 3 comments
Labels

Comments

@rochacbruno
Copy link
Owner

rochacbruno commented Nov 20, 2024

On marmite.yaml

languages:
  - pt,Português
  - en,English
  - es,Spanish

This data will be used to filter and show the stream /en.html /es.html, and the first of the list is the default so points to index.html


The original post in Portuguese ola-mundo.md

---
date: xxxx-xx-xx
slug: ola-mundo
translations:
  - en-hello-world
  - es-hola-mundo
---
# Olá Mundo

English hello-world.md

---
date: xxxx-xx-xx
slug: hello-world
stream: en
---
# Hello World

Spanish hola-mundo.md

---
date: xxxx-xx-xx
slug: hela-mundo
stream: es
---
# Hola Mundo

Those 3 files will generate

/ola-mundo.html -> listed on index
/en-hello-world.md -> listed on /stream-en
/es-hola-mundo.md -> listed on /stream-es


On Content there will be a translations field, so html can show links to en and es stream versions.

On the Menu it will be possible to ass stream-en and stream-es with the flags.

@zokaibr
Copy link
Contributor

zokaibr commented Nov 28, 2024

@rochacbruno would it be possible to use file paths intead of file names at this translations yaml field?

For example, for the page ola-mundo.md, the translation keys could be:

---
date: xxxx-xx-xx
slug: ola-mundo
translations:
  - en/hello-world
  - es/hola-mundo
---

With that, we can look into en and es folders for the hello-world.md and hola-mundo.md files. And following this organization or following the patterm en-hello-world.md would be up to user.

@rochacbruno
Copy link
Owner Author

@zokaibr that is possible on the input folder, the generated page will be flat en-hello-world.md but the input folder can be better organized.

@bgruszka
Copy link

bgruszka commented Jan 2, 2025

can I help you somehow with implementing this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants