diff options
author | zwbetz <zwbetz@gmail.com> | 2019-04-02 19:38:41 +0300 |
---|---|---|
committer | zwbetz <zwbetz@gmail.com> | 2019-04-02 19:38:41 +0300 |
commit | a9be0c58cbd00849e0c82c964f9ad3f6383f984d (patch) | |
tree | c27b9d7f8f3b8be3ad7707269b0cd2466b49b13a /layouts | |
parent | c9fedc083df4bf26b5d16e46215364e803621f12 (diff) |
Make styles configurable. Add google analytics. Add disqus comments. Comment config file
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/baseof.html | 3 | ||||
-rw-r--r-- | layouts/partials/google-analytics-async.html | 10 | ||||
-rw-r--r-- | layouts/partials/head.html | 3 | ||||
-rw-r--r-- | layouts/partials/header-nav.html (renamed from layouts/partials/nav.html) | 4 | ||||
-rw-r--r-- | layouts/post/single.html | 4 |
5 files changed, 20 insertions, 4 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index cc86ca1..0d2a659 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,10 +2,11 @@ <html lang="{{ .Site.Language.Lang }}"> {{ partial "head.html" . }} <body> - {{ partial "nav.html" . }} + {{ partial "header-nav.html" . }} <section class="main-content"> {{ block "main" . }}{{ end }} {{ partial "footer.html" . }} </section> + {{ partial "google-analytics-async.html" . }} </body> </html> diff --git a/layouts/partials/google-analytics-async.html b/layouts/partials/google-analytics-async.html new file mode 100644 index 0000000..8a58c07 --- /dev/null +++ b/layouts/partials/google-analytics-async.html @@ -0,0 +1,10 @@ +{{ if not $.Site.IsServer }} + {{ with $.Site.GoogleAnalytics }} + <script> + window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; + ga('create', '{{ . }}', 'auto'); + ga('send', 'pageview'); + </script> + <script async src='https://www.google-analytics.com/analytics.js'></script> + {{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 6f2295e..1636eb3 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -5,8 +5,9 @@ {{ $.Hugo.Generator }} <link rel="stylesheet" href="{{ "css/normalize.css" | absURL }}"> <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> + {{ $caymanScss := "scss/cayman.scss" }} {{ $options := (dict "targetPath" "css/cayman.css") }} - {{ $caymanCss := resources.Get "scss/cayman.scss" | toCSS $options | fingerprint }} + {{ $caymanCss := resources.Get $caymanScss | resources.ExecuteAsTemplate $caymanScss . | toCSS $options | fingerprint }} <link rel="stylesheet" href="{{ $caymanCss.Permalink }}"> <title>{{ .Title }} | {{ $.Site.Title }}</title> </head> diff --git a/layouts/partials/nav.html b/layouts/partials/header-nav.html index 73e287a..f6a4030 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/header-nav.html @@ -1,9 +1,9 @@ <section class="page-header"> <h1 class="project-name"> - {{ $.Site.Params.project_name | default "project_name goes here" }} + {{ $.Site.Params.project_name | default "project_name goes here" | markdownify }} </h1> <h2 class="project-tagline"> - {{ $.Site.Params.project_tagline | default "project_tagline goes here" }} + {{ $.Site.Params.project_tagline | default "project_tagline goes here" | markdownify }} </h2> <!-- TODO wrap w/ nav element --> {{ $current := . }} diff --git a/layouts/post/single.html b/layouts/post/single.html index 5374b7d..4b7dc57 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -14,4 +14,8 @@ </div> {{ end }} {{ .Content }} + {{ $ctx := . }} + {{ with $.Site.DisqusShortname }} + {{ template "_internal/disqus.html" $ctx }} + {{ end }} {{ end }} |