Browse Source

Added development script, fixed some layouts and set production to minify

master
Drew Short 4 years ago
parent
commit
91ff06a9cc
  1. 2
      .gitlab-ci.yml
  2. 10
      run_hugo_server.sh
  3. 34
      themes/pure/layouts/partials/head.html
  4. 27
      themes/pure/layouts/partials/header.html

2
.gitlab-ci.yml

@ -10,7 +10,7 @@ build-website:
HUGO_BASEURL: "https://sothr.com/"
script:
- export HUGO_SOURCE="$PWD"
- /run.sh
- /run.sh --minify
- tar -czvf website.tgz -C /output/ .
only:
- master

10
run_hugo_server.sh

@ -0,0 +1,10 @@
#! /usr/bin/sh
docker run -it \
-e HUGO_WATCH=true \
-e HUGO_THEME=pure \
-e HUGO_BASEURL=http://localhost:1313/ \
-e HUGO_DESTINATION=/src/public \
-v ${PWD}:/src \
-p 1313:1313 \
sothr.com/hugo:0.54.0 $@

34
themes/pure/layouts/partials/head.html

@ -1,42 +1,12 @@
<head {{ with .Site.LanguageCode }}lang="{{ . }}"{{ end }}>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
{{ with .Site.Params.description -}}
<meta name="description" content="{{ . }}">
{{- end }}
{{ .Hugo.Generator }}
<title>{{ if not .IsHome }}{{ .Title }} &mdash;{{ end }} {{ .Site.Title }}</title>
<link rel="stylesheet" href="{{ .Site.BaseURL }}assets/vendor/purecss/pure-min.css" type="text/css" />
<link rel="stylesheet" href="{{ .Site.BaseURL }}assets/css/style.css" type="text/css" />
</head>
<nav>
<div class="pure-menu pure-menu-horizontal">
<ul class="pure-menu-list float-left">
<li class="pure-menu-list">
<a href="{{ .Site.BaseURL }}" class="pure-menu-heading pure-menu-link" title="Home">{{ .Site.Title }}</a>
</li>
{{ range where (sort .Site.Pages "Weight" "desc") "Type" "navLink"}}
<li class="pure-menu-list"><a href="{{ .URL }}" class="pure-menu-link" title="{{ .Title }}">{{ .Title }}</a></li>
{{ end }}
</ul>
<ul class="pure-menu-list float-right">
{{ range sort .Site.Params.links "weight" "desc" }}
<li class="pure-menu-list">
{{ if .image }}
<a href="{{ .url }}" target="_blank" title="{{ .title }}">
<img src="{{ .image | absURL }}" />
</a>
{{ else }}
<a href="{{ .url }}" target="_blank" class="pure-menu-link" title="{{ .title }}">
{{ .title }}
</a>
{{ end }}
</a>
</li>
{{ end }}
</ul>
</div>
</nav>

27
themes/pure/layouts/partials/header.html

@ -1 +1,28 @@
<nav>
<div class="pure-menu pure-menu-horizontal">
<ul class="pure-menu-list float-left">
<li class="pure-menu-list">
<a href="{{ .Site.BaseURL }}" class="pure-menu-heading pure-menu-link" title="Home">{{ .Site.Title }}</a>
</li>
{{ range where (sort .Site.Pages "Weight" "desc") "Type" "navLink"}}
<li class="pure-menu-list"><a href="{{ .URL }}" class="pure-menu-link" title="{{ .Title }}">{{ .Title }}</a></li>
{{ end }}
</ul>
<ul class="pure-menu-list float-right">
{{ range sort .Site.Params.links "weight" "desc" }}
<li class="pure-menu-list">
{{ if .image }}
<a href="{{ .url }}" target="_blank" title="{{ .title }}">
<img src="{{ .image | absURL }}" />
</a>
{{ else }}
<a href="{{ .url }}" target="_blank" class="pure-menu-link" title="{{ .title }}">
{{ .title }}
</a>
{{ end }}
</li>
{{ end }}
</ul>
</div>
</nav>