Gianpaolo Macario public website on GitHub.com.
Automatically published to https://gmacario.github.io/
The blog is based on the Next.js framework as explained in Building a Blog with Next.js.
Install Node.js 16.x from https://nodejs.org/
To install the dependencies simply run
npm install
- Blog posts have to be created under the
_posts
folder. - Other content (like images or files) can be added under the
public
directory
Consider the following directory structure:
┌ ...
├ /pages
| ├ /pages/posts
| ├ /pages/_app.js
| └ /pages/index.js
|
├ /public
| ├ ...
| ├ /public/files/example_file.pdf
| └ ...
└ ...
You would reference the file as:
<a href="../files/example_file.pdf">example file</a>
Blog posts get compiled to a static website using the commands detailed below.
To build and test the pages locally, run the npm script
# Workaround for webpack on node 17+ - See https://github.com/webpack/webpack/issues/14532
export NODE_OPTIONS=--openssl-legacy-provider
npm run dev
and follow the instructions.
To build a production version of the static website and run automated tests, run the npm script
npm run test
and follow the instructions.
To create an optimized production build run the following commands:
npm run build
npm run start
To generate static files under _static
:
npm run export
docker build -t gmacario/gmacario-github-io .
docker run -d -p 3000:3000 gmacario/gmacario-github-io
Verify that the container is up and running
docker ps | grep gmacario
Expected result:
gmacario@gmpowerhorse:~ $ docker ps | grep gmacario
677454b66068 gmacario/gmacario-github-io "docker-entrypoint.s…" 10 seconds ago Up 8 seconds 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp amazing_euclid
gmacario@gmpowerhorse:~ $
then open http://<hostname-or-ip>:3000/
from your browser to preview the site.
Disclaimer: IANAL
Copyright 2006-2023 Gianpaolo Macario.
The contents of this repository and the executable distribution are licensed under the terms of the MIT license as detailed in the LICENSE file,
with the exception of the _posts
and _drafts
folders which are licensed under a Creative Commons Attribution-Share Alike 4.0 License.
Please refer https://creativecommons.org/licenses/by-sa/4.0/ for details and the full text of the license.
Please note and acknowledge that any contribution to this repository or derivative work will be subject to the same terms and conditions.