diff --git a/Dockerfile b/Dockerfile index ddcb252..280078f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,9 +12,9 @@ RUN apt-get update \ && mv /tmp/hugo /usr/local/bin/hugo \ && rm -rf /tmp/* -RUN useradd -m -p '' -s /bin/bash hugo \ +RUN useradd -m -u 1000 -U -p '' -s /bin/bash hugo \ && mkdir -p /opt/workdir \ - && chown -R hugo:hugo /home/hugo /opt/workdir /usr/local/bin/hugo + && chown -R 1000:1000 /home/hugo /opt/workdir /usr/local/bin/hugo USER hugo diff --git a/archetypes/default.md b/archetypes/default.md index 00e77bd..f65ccdf 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -4,3 +4,32 @@ date: {{ .Date }} draft: true --- + + + +Example code +{{< highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" >}} +// GetTitleFunc returns a func that can be used to transform a string to +// title case. +// +// The supported styles are +// +// - "Go" (strings.Title) +// - "AP" (see https://www.apstylebook.com/) +// - "Chicago" (see https://www.chicagomanualofstyle.org/home.html) +// +// If an unknown or empty style is provided, AP style is what you get. +func GetTitleFunc(style string) func(s string) string { + switch strings.ToLower(style) { + case "go": + return strings.Title + case "chicago": + tc := transform.NewTitleConverter(transform.ChicagoStyle) + return tc.Title + default: + tc := transform.NewTitleConverter(transform.APStyle) + return tc.Title + } +} +{{< / highlight >}} + diff --git a/config.toml b/config.toml index 1a22a68..3cf02fd 100644 --- a/config.toml +++ b/config.toml @@ -4,6 +4,10 @@ title = "Adam's Blog" theme = "solar-theme-hugo" pygmentsStyle = "solarized-dark" # solarized-light, -dark or -dark256 +[params] + author = "Adam Veldhousen" + description = "I write software for a living and sometimes for fun. Copyright 2019 Adam Veldhousen" + [menu] [[menu.main]] title ="Email" @@ -19,8 +23,8 @@ pygmentsStyle = "solarized-dark" # solarized-light, -dark or -dark256 [[menu.main]] Title = "Code for this site" - name = "git.vdhsn.com/adam/words" - url = "https://git.vdhsn.com/adam/words" + name = "git.vdhsn.com/adam/blog" + url = "https://git.vdhsn.com/adam/blog" [[menu.other]] name = "keybase.io/aveldhousen" diff --git a/hugo b/hugo index 63b14e8..6d44b47 100755 --- a/hugo +++ b/hugo @@ -1,2 +1,7 @@ #!/bin/bash -exec docker run -it -p 1313:1313 -v $PWD:/opt/workdir --entrypoint /usr/local/bin/hugo hugo $@ +exec docker run -it --rm --name hugo \ + -p 1313:1313 \ + -v $PWD:/opt/workdir:Z \ + --privileged \ + -u ${UID}:${UID} \ + --entrypoint=/usr/local/bin/hugo hugo $@ diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 327f802..30db7a4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,6 +3,7 @@ + {{ with .OutputFormats.Get "RSS" }} @@ -19,7 +20,6 @@