This module enables dynamic pages from a local directory.
- Install the npm module (
npm i @ogc/nuxt3-dynamic-pages-module
). - Add the module to
nuxt.config.ts
. - Set the
dynamicPagesPath
runtime configuration value (e.g.,NUXT_DYNAMIC_PAGES_PATH
env. variable) to a local path. - Create static
.md
or.html
page files inside that directory.
All dynamic pages need to include some front-matter metadata:
title
: title for the pagepath
: application path (URL), starting with/
.toc
(optional): whether to automatically create a table of contents from headers (true
orfalse
)
---
title: About
path: /about
navigationMenu: main
toc: true
---
# Hello
World.
---
title: About
path: /about
navigationMenu: main
toc: true
---
<h1>Hello</h1>
<p>World.</p>