added helpers, clean up html
parent
9f3a97baa0
commit
43842b9822
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 >}}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
7
hugo
7
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 $@
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
|
||||
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
|
||||
|
|
@ -19,7 +20,6 @@
|
|||
<div class="container">
|
||||
<header id="header">
|
||||
<h1><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
|
||||
<p>{{ .Site.Params.Description }}</p>
|
||||
</header>
|
||||
|
||||
<div id="sidebar">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div id="partial-footer">
|
||||
<p class="copyright">
|
||||
© 2019 Adam Veldhousen.
|
||||
© {{ now.Format "2006"}} Adam Veldhousen.
|
||||
<a
|
||||
href="https://creativecommons.org/licenses/by/3.0/"
|
||||
title="Creative Commons Attribution"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
{{ if ne .Title "" }}
|
||||
<span class="title">{{ .Title }}</span><br/>
|
||||
{{ end }}
|
||||
|
||||
<a {{ if or (strings.HasSuffix .Name "github") (strings.HasSuffix .Name "keybase") }} rel="me" {{ end }}href="{{ .URL }}">
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue