This is a blog post project built with Next.js.
see: https://xavierz.dev/blog/posts/build-blog-with-nextjs
npm intall
Then run the development server:
npm run dev
Set MARKDOWN_FOLDER
to the folder where you put the markdowns,
and run npm run watch
, you can get the live editing feature out of box.
MARKDOWN_FOLDER
: the absolute path of folder with markdown files.WATCH_MARKDOWN
: yes for live editing experience.APP_HOST
: the FQDN of your blog website, e.g.https://example.blog.com
There is an exisiting github action that helps you to build the docker image and push it to the github registry.
You can also build the image manually as follows,
- build
docker build . --platform linux/amd64 -t ghcr.io/{namespace}/xblog:latest
- push to github registry
docker push ghcr.io/{namespace}/xblog:latest
- run
docker run -p 3000:3000 -e MARKDOWN_FOLDER=/app/myposts/ -v /host/path/posts:/app/myposts ghcr.io/{namespace}/xblog