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
Today, to write content in a specific language you can do that without any suffix such as [slug].md, and that would assume the language specified in defaultContentLanguage, that's by default en. Considering this case, the all language would be a breaking change. Another way is by specifying the language such as [slug].pt.md, that would create a content for the pt language.
What I am suggesting here is a suffix that would create content for all languages specified in the config file. I'd suggest the suffix all.
For example, if you have the languages en and pt defined in the languages setting, post.md would generate for en, post.en.md would also generate for en, post.pt.md would generate for pt and post.all.md would generate for both en and pt using only one content file.
This could work by precedence, so, if no specific language content is defined then use the generic one. Plus, some frontmatter merging because stuff like cascade would be expected to work the same for all languages. I have an example where I need to customize the template for a section so I need to cascade the type down to a content subfolder and that way I need to copypaste the cascade to all markdown languages or it falls back to the default template.
The text was updated successfully, but these errors were encountered:
Today, to write content in a specific language you can do that without any suffix such as [slug].md, and that would assume the language specified in defaultContentLanguage, that's by default en.
For completeness, you can also assign languages via file mounts, so you can do:
I do agree that it would be nice to somehow assign multiple languages (both tho mounts and single content files), but I'm not sure all is the best. For mounts we could certainly allow Glob patterns (e.g. {en,fr}), but I'm not sure how well that works in filenames.
lucasew
added a commit
to lucasew/lucasew.github.io
that referenced
this issue
Dec 27, 2024
Today, to write content in a specific language you can do that without any suffix such as
[slug].md
, and that would assume the language specified indefaultContentLanguage
, that's by defaulten
. Considering this case, theall
language would be a breaking change. Another way is by specifying the language such as[slug].pt.md
, that would create a content for thept
language.What I am suggesting here is a suffix that would create content for all languages specified in the config file. I'd suggest the suffix
all
.For example, if you have the languages
en
andpt
defined in thelanguages
setting,post.md
would generate foren
,post.en.md
would also generate foren
,post.pt.md
would generate forpt
andpost.all.md
would generate for bothen
andpt
using only one content file.This could work by precedence, so, if no specific language content is defined then use the generic one. Plus, some frontmatter merging because stuff like
cascade
would be expected to work the same for all languages. I have an example where I need to customize the template for a section so I need to cascade the type down to a content subfolder and that way I need to copypaste the cascade to all markdown languages or it falls back to the default template.The text was updated successfully, but these errors were encountered: