added helpers, clean up html

pull/1/head
Adam Veldhousen 5 years ago
parent 9f3a97baa0
commit 43842b9822
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B

@ -12,9 +12,9 @@ RUN apt-get update \
&& mv /tmp/hugo /usr/local/bin/hugo \ && mv /tmp/hugo /usr/local/bin/hugo \
&& rm -rf /tmp/* && 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 \ && 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 USER hugo

@ -4,3 +4,32 @@ date: {{ .Date }}
draft: true 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" theme = "solar-theme-hugo"
pygmentsStyle = "solarized-dark" # solarized-light, -dark or -dark256 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]
[[menu.main]] [[menu.main]]
title ="Email" title ="Email"
@ -19,8 +23,8 @@ pygmentsStyle = "solarized-dark" # solarized-light, -dark or -dark256
[[menu.main]] [[menu.main]]
Title = "Code for this site" Title = "Code for this site"
name = "git.vdhsn.com/adam/words" name = "git.vdhsn.com/adam/blog"
url = "https://git.vdhsn.com/adam/words" url = "https://git.vdhsn.com/adam/blog"
[[menu.other]] [[menu.other]]
name = "keybase.io/aveldhousen" name = "keybase.io/aveldhousen"

@ -1,2 +1,7 @@
#!/bin/bash #!/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> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
{{ with .OutputFormats.Get "RSS" }} {{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" /> <link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
<link href="{{ .RelPermalink }}" rel="feed" 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"> <div class="container">
<header id="header"> <header id="header">
<h1><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1> <h1><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
<p>{{ .Site.Params.Description }}</p>
</header> </header>
<div id="sidebar"> <div id="sidebar">

@ -1,6 +1,6 @@
<div id="partial-footer"> <div id="partial-footer">
<p class="copyright"> <p class="copyright">
&copy; 2019 Adam Veldhousen. &copy; {{ now.Format "2006"}} Adam Veldhousen.
<a <a
href="https://creativecommons.org/licenses/by/3.0/" href="https://creativecommons.org/licenses/by/3.0/"
title="Creative Commons Attribution" title="Creative Commons Attribution"

@ -7,7 +7,6 @@
{{ if ne .Title "" }} {{ if ne .Title "" }}
<span class="title">{{ .Title }}</span><br/> <span class="title">{{ .Title }}</span><br/>
{{ end }} {{ end }}
<a {{ if or (strings.HasSuffix .Name "github") (strings.HasSuffix .Name "keybase") }} rel="me" {{ end }}href="{{ .URL }}"> <a {{ if or (strings.HasSuffix .Name "github") (strings.HasSuffix .Name "keybase") }} rel="me" {{ end }}href="{{ .URL }}">
<span>{{ .Name }}</span> <span>{{ .Name }}</span>
</a> </a>

@ -2,6 +2,9 @@
write: serve write: serve
new-post:
./hugo new posts/$${TITLE:new_post}.md
hugo: hugo:
go get -u --tags extended -v github.com/gohugoio/hugo go get -u --tags extended -v github.com/gohugoio/hugo
go install --tags extended -v github.com/gohugoio/hugo go install --tags extended -v github.com/gohugoio/hugo

Loading…
Cancel
Save