Nextjs Template Quickstart

Prerequisites

Run

  1. Navigate to the nextjs-template
cd {path-to-template}/nextjs-template
  1. Install all packages
  • NOTE: if you are building nextjs-template inside dendron monorepo, then you can skip this step
yarn
  1. To run nextjs using sample data, run the following
curl -LO https://artifacts-prod-artifactb7980f61-19orqnnuurvwy.s3.us-west-2.amazonaws.com/artifacts/dendron-site.zip
unzip dendron-site.zip
  1. Run the nextj sapp
yarn dev
  1. Navigate to your browser. For example http://localhost:3000/notes/6322a2de-34fd-4c93-bcbe-d71c30e5f2b6 to go to a particular note
  2. Build your notes for static hosting
yarn export
  1. Preview your statically hosted notes
cd out
python -m SimpleHTTPServer 8000
# open localhost:8000 to see your notes

Run with your own data

  1. Navigate to your workspace root
  2. Run the following command.
dendron exportPod --podId dendron.nextjs --config "dest={path/to/nextjs-template}"

Your notes/html files will be copied over to {path-to-template}/nextjs-template/data/notes/


Backlinks