/blog

Personal blog powered by Hugo

Primary LanguageHTML

Blog

Netlify Status

Installation

brew install hugo
npm i

Development

npm start

Prod like server

brew install mkcert
# Generate the certs
mkcert localhost 127.0.0.1 ::1
# Install the certs into the system
mkcert -install

Server:

npm run build
npm run serve:prod

Production

npm run build

Steps (from package.json):

  • build the sidebar html fragment with the sitemap-tree-generator.js script
  • interpolate the application colors with the palette-generator script, also transform the JS colors to css vars using bulma-css-vars
  • create the site scripts with webpack, read webpack.common.js, write the output to dist/
  • build the static files, write the output to dist/

Manual steps in Netlify (setup done only once)

  • Configure the DNS redirects
  • Configure the site root directory to dist/

Tech

  • Hugo (static pages)
  • Webpack (tooling)
  • d3, React (browser)

Useful variables:

from within a page, path to itself:
/{{ .File.Dir }}{{ .File.ContentBaseName }}/

Upgrade notes

From mmark to goldmark:

  • replace extension from mmark to md
find . -depth -name "*.mmark" -exec sh -c 'mv "$1" "${1%.mmark}.md"' _ {} \;
  • Perform some text replacements
# inline math
find: \$\$([^\s].*?)\$\$
replace: \$$1\$

# block math
find: \$\$([\s\S]*?)\$\$
replace: <div>\n\$\$$1\$\$\n</div>

# block math to live template:
find: <div>\s+\$\$
replace: <div>\$\$

find: \$\$\s+</div>
replace: \$\$</div>