Skip to content

Permalink from parsed fileSlug #2122

Answered by madsem
madsem asked this question in Q&A
Nov 28, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Actually, this was super easy once I wrapped my head around the eleventyComputed... :)

module.exports = {
  seo: {
    robots: "all",
    include_sitemap: true,
  },
  layout: "landing",
  eleventyComputed: {
    permalink(data) {

      // remove the title/slug from file name for homepage, 
      // leave only locale.html for cleaner permalinks
      return `${data.page.fileSlug.split(".")[1]}.html`;
    },
  },
};

Replies: 1 comment 3 replies

Comment options

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

pdehaan Nov 28, 2021
Collaborator

@madsem
Comment options

@madsem
Comment options

Answer selected by madsem
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