Skip to content

Unable to select component based on site locale #2190

Answered by pdehaan
alexlibby asked this question in Q&A
Discussion options

You must be logged in to vote

@alexlibby This worked for me: https://github.com/pdehaan/11ty-2190

A few notes:

  1. Make sure your src/_data/site.js has en.header and fr.header keys. I copy/pasted the code above, but noticed the data only included en.componentsFolder reference which pointed to a header template.
  2. Not sure what "(./_includes/layouts/base.njk) [Line 12, Column 17] parseAggregate: expected colon after dict key" error means. I'm guessing you have some invalid frontmatter in that file which is throwing an error.

But feel free to check out my repo, which should have a working copy of the sample code above.

// ./src/_data/site.js
module.exports = {
  name: "Creative42",
  baseUrl: "http://localhost:8080/",
  en: {

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by alexlibby
Comment options

You must be logged in to vote
4 replies
@pdehaan
Comment options

pdehaan Jan 26, 2022
Collaborator

@alexlibby
Comment options

@pdehaan
Comment options

pdehaan Jan 29, 2022
Collaborator

@pdehaan
Comment options

pdehaan Jan 29, 2022
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants