This project is based on Hugo.
- Install g: https://github.com/stefanmaric/g
- Install Go:
g install latest
- Install Hugo:
go install -v github.com/gohugoio/hugo@latest
To view the site while writing: hugo server -D
To build the site into the public
directory: hugo
The theme used is Kiera. Kiera supports inlining images with the following syntaxes:
![Image Title](link/to/image)
to wrap it with figure use:
{{< figure src="/link/to/image" >}}
The basic placement is 100% width within content and scaled accordingly in smaller screen. Recommended width for image is 600 pixels minimum.
Kiera supports different placement by adding:
For img, use
![Image Title](link/to/image#placement)
For figure, use{{< figure src="/link/to/image" class="placement" >}}
There are 4 configured placements
#full
orclass="full"
for full width.#mid
orclass="mid"
for middle.#float
orclass="float"
for float left.#float-right
orclass="float-right"
for float right.
A page, e.g. "blog post", that incudes things like images are written using Page Bundles. For example, a post on 2022-05-08 titled "Foo Bar" that has an image to include would be added to the project like so:
content
└── posts
└── 2022
└── 05
└── 08
└── foo-bar
├── an-image.jpg
└── index.md
We can define custom shortcodes in layouts/shortcodes/. See https://gohugo.io/templates/shortcode-templates/ for details about shortcodes.
Typically, we want to include some custom CSS for each shortcode. If we include
the CSS within a <style>
block in the shortcode itself, that CSS will be
duplicated for each instance of the shortcode in a page. This is clearly not
optimal. To solve this, we:
-
Put a new stylesheet in static/css/
-
Add a new conditional block to layouts/partials/header_supplement.html:
``` {{ if .HasShortcode "image-center" -}} <link rel="stylesheet" type="text/css" href="/css/image-center.css" /> {{- end }} ```