Skip to content

reuse content for multi language site using a all language #13196

Open
@lucasew

Description

@lucasew

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions