This blog is generated by Hugo.
To avoid a permission error when installing gem, I propose to use rbenv
to set up a local ruby environment.
Fetching asciidoctor-2.0.16.gem
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
brew install rbenv
eval "$(rbenv init -)" # should set rbenv in the .zshrc
rbenv install 2.7.5
rbenv global 2.5.1
rbenv rehash
gem install asciidoctor
gem install asciidoctor-diagram
cargo install svgbob_cli --version 0.5.0-alpha.8
brew install hugo
And serve, the ./serve.sh
script runs Hugo and build draft as well as future content.
./serve.sh
This script prepends the $PATH
variable with this repository’s ./bin
folder
in order to trick Hugo to use my custom asciidoctor
script which configures
asciidoctor with wanted options, like -r asciidoctor-diagram
.
exec env PATH=$PWD/bin:$PATH hugo serve --baseUrl=blog.local --bind=0.0.0.0 --buildDrafts
This site now rely on asciidoc content, in order to ease content edition and publication, it is useful to set a few attributes in the editor.
Attribute | Value | Description |
---|---|---|
|
path to the |
This attribute is used to allow images to show up in the IDE preview.
Site images are published on Note 1: it is set to Note 2: this is a custom attribute. |
|
svg |
Renders DITAA diagrams as SVG, better legibility on high dpi screens |
|
svg |
Renders PlantUML diagrams as SVG, better legibility on high dpi screens |
|
path to |
If the IDE don’t correctly detect |
|
|
Tells asciidoctor to use font-awesome for admonition blocks. |
The blog is served by Github Pages, and the job is run by Github Actions.
With the current setup, the HTML files are served from the master
branch.
name: GitHub Pages
on:
push:
branches:
- hugo-sources
jobs:
build-deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Build
run: docker run --rm --volume $PWD:/src bric3/hugo-builder hugo # (1)
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: master
publish_dir: ./public
cname: blog.arkey.fr
# force_orphan: true
-
Custom docker builder image
In order to build asciidoc content, I created a custom Docker image, that
install asciidoctor and asciidoctor-diagram, also this Docker image prepends
the $PATH
environment variable in order to customize the asciidoctor configuration.