Compare commits

...

3 Commits

Author SHA1 Message Date
Silke e4621391e8 fixup! Improve portability 1 month ago
Silke 0e11813152 Reduce number of custom environment variables 1 month ago
Silke e89bf50e45 Improve portability 1 month ago
  1. 10
      .drone.yml
  2. 0
      assets/favicon.png
  3. 0
      assets/favicon.svg
  4. 0
      assets/favicon_src.svg
  5. 1
      assets/fonts
  6. 6
      assets/styles.scss
  7. 3
      config.yaml
  8. 17
      deploy.sh
  9. 34
      layouts/partials/head.html

10
.drone.yml

@ -19,8 +19,8 @@ depends_on:
steps:
- name: deploy
environment:
SITE_DIR: '/var/www/drone/slxh.nl'
BASE_URL: 'https://www1.slxh.eu'
HUGO_PUBLISHDIR: '/var/www/drone/slxh.nl'
HUGO_BASEURL: 'https://www1.slxh.eu'
HUGO_CANONIFYURLS: 'true'
commands:
- ./deploy.sh hugo
@ -28,6 +28,7 @@ steps:
- name: deploy ipfs
environment:
IPFS_API: '/ip6/::1/tcp/5001'
HUGO_PARAMS_PORTABLE: 'true'
HUGO_RELATIVEURLS: 'true'
commands:
- ./deploy.sh hugo ipfs
@ -47,8 +48,8 @@ node:
steps:
- name: deploy
environment:
SITE_DIR: '/var/www/drone/slxh.nl'
BASE_URL: 'https://slxh.nl'
HUGO_PUBLISHDIR: '/var/www/drone/slxh.nl'
HUGO_BASEURL: 'https://slxh.nl'
HUGO_CANONIFYURLS: 'true'
commands:
- ./deploy.sh hugo
@ -59,6 +60,7 @@ steps:
- name: ipfs
environment:
IPFS_API: '/ip6/::1/tcp/5001'
HUGO_PARAMS_PORTABLE: 'true'
HUGO_RELATIVEURLS: 'true'
commands:
- ./deploy.sh hugo ipfs

0
static/images/favicon.png → assets/favicon.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
static/images/favicon.svg → assets/favicon.svg

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 780 B

0
static/images/favicon_src.svg → assets/favicon_src.svg

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

1
assets/fonts

@ -0,0 +1 @@
../static/fonts

6
assets/styles.scss

@ -19,9 +19,9 @@ $orange: rgb(233, 128, 22);
$side: $orange;
$back: subtract_color($white, $black);
$mainfont: 'Source Sans Pro Webfont', Helvetica, Arial, Sans-serif;
$headfont: 'Raleway Webfont', $mainfont;
$codefont: 'Source Code Pro Webfont', $mainfont;
$mainfont: 'Source Sans Pro Webfont', 'Source Sans Pro', Helvetica, Arial, Sans-serif;
$headfont: 'Raleway Webfont', Raleway, $mainfont;
$codefont: 'Source Code Pro Webfont', 'Source Code Pro', $mainfont;
$content_pad: 1em;
$content_min: 8em + $content_pad;

3
config.yaml

@ -5,6 +5,9 @@ title: SLXH.nl
permalinks:
blog: /blog/:year/:title/
minify:
minifyOutput: yes
params:
github: silkeh
gitlab: silkeh

17
deploy.sh

@ -1,21 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
# Default arguments for Hugo
HUGO_ARGS=()
if [ -z ${HUGO_ARGS+x} ]
# Always clean the destination directory
if [ -z ${HUGO_CLEANDESTINATIONDIR+x} ]
then
HUGO_ARGS+=(--minify --cleanDestinationDir)
fi
if [ -n "${SITE_DIR+x}" ]
then
HUGO_ARGS+=("--destination=${SITE_DIR}")
fi
if [ -n "${BASE_URL+x}" ]
then
HUGO_ARGS+=("--baseURL=${BASE_URL}")
export HUGO_CLEANDESTINATIONDIR=true
fi
IPFS_ARGS=()

34
layouts/partials/head.html

@ -1,24 +1,32 @@
{{ $sass := resources.Get "styles.scss" }}
{{ $style := $sass | resources.ToCSS | resources.Minify }}
{{ $style := resources.Get "styles.scss" | resources.ToCSS | resources.Minify -}}
{{ $sourcesanspro := resources.Get "fonts/sourcesanspro/sourcesanspro.css" | resources.Minify -}}
{{ $sourcecodepro := resources.Get "fonts/sourcecodepro/sourcecodepro.css" | resources.Minify -}}
{{ $raleway := resources.Get "fonts/raleway/raleway.css" | resources.Minify -}}
{{ $css := slice $style $sourcesanspro $sourcecodepro $raleway | resources.Concat "style.css" -}}
{{ $favicon_svg := resources.Get "favicon.svg" -}}
{{ $favicon_png := resources.Get "favicon.png" -}}
<head>
<title>{{ .Title }} - {{ .Site.Title }}</title>
<link rel="icon" type="image/svg+xml" href="/images/favicon.svg"/>
<link rel="alternate icon" type="image/png" href="/images/favicon.png">
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<link rel="stylesheet" href="/fonts/sourcesanspro/sourcesanspro.css">
<link rel="stylesheet" href="/fonts/sourcecodepro/sourcecodepro.css">
<link rel="stylesheet" href="/fonts/raleway/raleway.css">
{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .RelPermalink }}" title="{{ $.Site.Title }}" />
{{ end -}}
{{ with .Site.Params.description -}}
<meta name="description" content="{{ . }}">
<meta name="description" content="{{ . }}">
{{ end -}}
{{ with .Site.Params.author -}}
<meta name="author" content="{{ . }}">
<meta name="author" content="{{ . }}">
{{ end -}}
{{ hugo.Generator }}
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
{{ if .Site.Params.portable -}}
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,{{ $favicon_svg.Content | base64Encode }}"/>
<link rel="alternate icon" type="image/png" href="data:image/png;base64,{{ $favicon_png.Content | base64Encode }}">
<style>{{ $css.Content | safeCSS }}</style>
{{ else -}}
<link rel="alternate icon" type="image/png" href="{{ $favicon_png }}">
<link rel="icon" type="image/svg+xml" href="{{ $favicon_svg }}"/>
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{end -}}
{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .RelPermalink }}" title="{{ $.Site.Title }}" />
{{ end -}}
</head>

Loading…
Cancel
Save