Language toggle in front matter #7230
shawnthompson
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First off this project is so awesome thanks for bringing back to life.
This is a mix of Q&A or idea if it's not possible already.
When using the i18n Support, is it possible to capture the slug that is created for the post in the other language front matter to be able to use it as a toggle link on the page.
Basically, I'm using 11ty to build my English and French site so if I create a post called "My awesome blog post" in English, which creates
my-awesome-blog-post.md
and "Mon super article de blog" in French, which createdmon-super-article-de-blog.md
.I'd like the pages to have the following in their front matter:
my-awesome-blog-post.md
mon-super-article-de-blog.md
Then in my 11ty layout for the
my-awesome-blog-post/index.html
page, I could add<a lang="fr" hreflang="fr" href="{{ frSlug }}">Version française</a>
on the page.This would be a nice to have field to add in the
config.yml
file.Beta Was this translation helpful? Give feedback.
All reactions