This guide walks you through publishing with Next.js.
- Install the latest version of the dendron-cli
- Make sure you have git installed
Run the following commands at the root of your Dendron workspace (the folder where
dendron.yml is in)
Run the following command to setup publishing for your vault. This will pull in the nextjs-template which will be used to generated a static website from your notes.
NOTE: if you are having trouble doing this using powershell, we recommend following these steps using WSL instead
npx dendron publish init
# you should see the following output
🌱 checking if .next directory exists.
🌱 .next directory does not exist
🌱 Initializing NextJS template.
🌱 Successfully cloned.
🌱 All dependencies installed.
Run the following to see a local preview of what your site will look like. By default, Dendron will publish all the notes in your given vault.
- This command launches a development server which previews how your published website will look like. Visit
http://localhost:3000to access your site.
CTRL-Con the terminal to exit the preview
npx dendron publish dev
Run this command inside the root of your workspace. This command builds the static HTML which you'll upload to actually publish your site, and adds the static website to the
npx dendron publish export
# generated html files are inside of `.next/out`
Congrats, you did it! At this point, you have a folder of static HTML which you can host and deploy anywhere. You can checkout our cookbook for examples of deploying to popular destinations like GitHub Pages.