Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Node does not exist: en_demo #41

Open
Dexus opened this issue Apr 16, 2022 · 0 comments
Open

Error: Node does not exist: en_demo #41

Dexus opened this issue Apr 16, 2022 · 0 comments

Comments

@Dexus
Copy link

Dexus commented Apr 16, 2022

#/index.njk
---
layout: false
permalink: /index.html
title: "Layout"
locale: en
dir: ltr
eleventyNavigation:
  key: en
  title: Start Page
---
#/test2.njk
---
layout: false
permalink: /test2.html
title: "Layout"
locale: en
dir: ltr
eleventyNavigation:
  key: demo
  title: Demo
---
/*eleventryComputed.js*/
module.exports = {
  locale: (data) => {
    return data.locale || 'en'
  },
  eleventyNavigation: {
    key: (data) => {
      if (data.eleventyNavigation.key || data.translationKey) {
        return (
          data.locale +
          '_' +
          (data.eleventyNavigation.key || data.translationKey)
        )
      }

      let tk = data.page.inputPath.split('/').slice(3).join('/')
      return tk
    },
    title: (data) => data.eleventyNavigation.title || data.title,
    parent: (data) => {
      if (data.eleventyNavigation.parent || data.parent) {
        return (
          data.locale + '_' + (data.eleventyNavigation.parent || data.parent)
        )
      }
      return data.locale
    },
  },
  sitemap: (data) => {
    data.priority = data.priority || 0.5
    data.changefreq = data.changefreq || 'monthly'
    return ''
  },
  translationKey: (data) => {
    // remove "./src/{{locale}}" from path

    if (data.translationKey) {
      return data.translationKey
    }
    let tk = data.page.inputPath.split('/').slice(3).join('/')
    return tk
  },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant