You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 created mon-super-article-de-blog.md.
I'd like the pages to have the following in their front matter:
my-awesome-blog-post.md
---
title: My awesome blog post
frSlug: mon-super-article-de-blog (created by Decap)
---
mon-super-article-de-blog.md
---
title: Mon super article de blog
enSlug: my-awesome-blog-post (created by Decap)
---
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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