My personal website written in HUGO https://itsdrike.com
Go to file
ItsDrike b444f03185
Don't use scratchpad to pass values into partials
We previously used .Scratch which is a global scratchpad, that was later
passed over to the partial with the rest of the context. The partial
then checked if this value was set, and had a fallback if it wasn't
(default value).

This approach does work in most of the cases, however in about 5% of
runs, it fails. I assume this is due to hugo spinning up multiple
threads, and each of them is changing this global scratchpad in
arbitrary order. At some point, a thread then removed this value from
the scratchpad to reset it, but another thread already checked that this
variable does exist, and has now set the no longer available variable.

To avoid this, we can instead directly pass a custom dict, which
contains the original context (.) along with another variable, which
will hold the dateformat. This however means that we can't use the
simple syntax with a default value, and the dateformat will need to be
set each time (though technically, it could be set to nil and checked
later, but if we're already specifying it, we may as well pass in this
dateformat directly)
2022-05-14 22:26:04 +02:00
archetypes Initial commit (hugo) 2021-07-08 15:20:26 +02:00
content Improve wording in contact page 2022-05-11 16:24:12 +02:00
data Add matrix to socials and contact 2021-08-29 13:22:37 +02:00
layouts Don't use scratchpad to pass values into partials 2022-05-14 22:26:04 +02:00
scripts Update build script 2022-05-11 17:29:57 +02:00
static/src Add copy button to all codeblocks 2022-05-14 20:27:10 +02:00
themes Add hugo-notice theme for notice shortcodes 2022-05-11 17:29:10 +02:00
.gitignore Ignore hugo build lockfile 2022-02-08 20:04:59 +01:00
.gitmodules Add hugo-notice theme for notice shortcodes 2022-05-11 17:29:10 +02:00
config.yml Add hugo-notice theme for notice shortcodes 2022-05-11 17:29:10 +02:00
LICENSE Initial commit (hugo) 2021-07-08 15:20:26 +02:00
package-lock.json Add jquery 2021-08-25 19:36:37 +02:00
package.json Add jquery 2021-08-25 19:36:37 +02:00
README.md Improve readme 2022-05-14 20:35:07 +02:00

My personal website

AGPL

This is the source code for my personal website, hosted on https://itsdrike.com

Building the website

The website is built using hugo, but you will also need npm, since it provides easy way to version control the needed packages. These include things such as Bootstrap SASS, Font Awesome (Free) and JQuery.

After all NPM requirements are satisfied, you will also need to synchronize to git submodules, to obtain additional themes.

To then build the static webpage using hugo, run ./scripts/build.sh, which will create a ./public directory, with all static files and can be hosted with a file server (such as nginx, or apache).

If you want to test out the webpage locally, or if you prefer to stick purely with hugo, even for deployment, instead of building the webpage, you can use hugo's server functionality and run the scripts/server.sh script instead of the build script. By default, this will host the server on http://localhost:1313, but you can pass hugo server arguments to the script, just like you would with running bare hugo server. For example:

$ ./scripts/server.sh --bind 0.0.0.0 --port 80 --baseURL https://itsdrike.com/