Fix hello-friend-ng theme compatibility: author config, custom head partial, missing params
This commit is contained in:
@@ -75,6 +75,9 @@ sudo chown $USER:$USER /srv/www
|
||||
cd /srv/www
|
||||
git clone <your-git-repo-url> dustin.coffee
|
||||
cd dustin.coffee
|
||||
|
||||
# Initialize theme submodule (required for hello-friend-ng theme)
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
## Step 3: Build Static Site
|
||||
|
||||
@@ -5,7 +5,9 @@ theme = 'hello-friend-ng'
|
||||
|
||||
[params]
|
||||
# description = "Personal website of Dustin"
|
||||
author = "dustin"
|
||||
[params.Author]
|
||||
name = "dustin"
|
||||
email = ""
|
||||
|
||||
dateform = "Jan 2, 2006"
|
||||
dateformShort = "Jan 2"
|
||||
@@ -14,6 +16,7 @@ theme = 'hello-friend-ng'
|
||||
|
||||
# Subtitle for home
|
||||
homeSubtitle = "how did YOU get here?"
|
||||
Subtitle = "how did YOU get here?"
|
||||
|
||||
# Set disableReadOtherPosts to true in order to hide the links to other posts.
|
||||
disableReadOtherPosts = false
|
||||
@@ -28,6 +31,7 @@ theme = 'hello-friend-ng'
|
||||
description = "...it's my blog."
|
||||
keywords = "homepage, blog"
|
||||
images = [""]
|
||||
themeColor = "#2d3748"
|
||||
|
||||
[taxonomies]
|
||||
tag = "tags"
|
||||
|
||||
79
layouts/partials/head.html
Normal file
79
layouts/partials/head.html
Normal file
@@ -0,0 +1,79 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
{{ if .Params.noindex }}
|
||||
<meta name="robots" content="noindex" />
|
||||
{{ end }}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="author" content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ with .Site.Params.Author.name }}{{ . }}{{ end }}{{ end }}">
|
||||
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ if .Params.Description }}{{ .Params.Description }}{{ else }}{{ .Summary | plainify }}{{ end }}{{ end }}" />
|
||||
<meta name="keywords" content="{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}" />
|
||||
<meta name="robots" content="noodp" />
|
||||
<meta name="theme-color" content="{{ .Site.Params.themeColor }}" />
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
|
||||
{{ block "title" . }}
|
||||
<title>
|
||||
{{ if .IsHome }}
|
||||
{{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }} {{ end }}
|
||||
{{ else }}
|
||||
{{ .Title }} :: {{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}
|
||||
{{ end }}
|
||||
</title>
|
||||
{{ end }}
|
||||
|
||||
<!-- CSS -->
|
||||
{{ $opts := dict "transpiler" "libsass" "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true }}
|
||||
{{ with resources.Get "scss/main.scss" | toCSS $opts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ range $val := $.Site.Params.customCSS }}
|
||||
{{ if gt (len $val) 0 }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ $val }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Icons -->
|
||||
{{- partial "favicons.html" . }}
|
||||
|
||||
{{ template "_internal/schema.html" . }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
|
||||
{{ if isset .Site.Taxonomies "series" }}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Params.categories }}
|
||||
<meta property="article:section" content="{{ . }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Params "date" }}
|
||||
<meta property="article:published_time" content="{{ time .Date }}" />
|
||||
{{ end }}
|
||||
|
||||
<!-- RSS -->
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
<!-- JSON Feed -->
|
||||
{{ if .OutputFormats.Get "json" }}
|
||||
<link href="{{ if .OutputFormats.Get "json" }}{{ .Site.BaseURL }}feed.json{{ end }}" rel="alternate"
|
||||
type="application/json" title="{{ .Site.Title }}" />
|
||||
{{ end }}
|
||||
|
||||
<!-- Custom head tags -->
|
||||
{{- if templates.Exists "partials/extra-head.html" -}}
|
||||
{{ partial "extra-head.html" . }}
|
||||
{{- end }}
|
||||
|
||||
<!-- Google Analytics internal template -->
|
||||
{{- if .Site.Config.Services.GoogleAnalytics.ID }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{- end }}
|
||||
|
||||
<!-- Plausible.io -->
|
||||
{{- if $.Site.Params.plausibleDataDomain }}
|
||||
<script defer data-domain="{{ .Site.Params.plausibleDataDomain }}" src="{{ .Site.Params.plausibleScriptSource }}"></script>
|
||||
{{- end}}
|
||||
Reference in New Issue
Block a user