Détail du package

@islands/pages

ElMassimo9570.10.0-beta.1

readme


<samp>@islands/pages</samp>

An îles module that provides support for pages, inspired by vite-plugin-pages.

  extendFrontmatter (frontmatter, filename) {
    if (filename.includes('/posts/'))
      frontmatter.layout = 'post'
  },
  extendRoute (route) {
    if (route.path.startsWith('/posts'))
      route.path = path.replace(/[\d-]+/, '') // remove date
  },
  extendRoutes (routes) {
    routes.push({ path: '/custom', name: 'Custom', componentFilename: ... }))
  },

<kbd>extendFrontmatter</kbd> is very flexible, you could use it to:

  • Infer the title or date from the filename
  • Set a different layout for all pages in a specific dir
  • Provide additional data to use in the page, such as gitLastUpdated

Acknowledgements