layouts: restore compatibility with Hugo < 0.18

This commit is contained in:
remeh
2016-11-09 21:06:20 +01:00
parent ff26d90c2b
commit f89eae3668
8 changed files with 49 additions and 49 deletions

View File

@@ -81,7 +81,7 @@ See this [Imgur album](http://imgur.com/a/skabh) or the [`images/`](https://gith
> v0.2.0 > v0.2.0
* Added Disqus support. To enable Disqus, add `disqusShortname = "XYZ"` to `config.toml`. More details: <http://gohugo.io/extras/comments/>. * Added Disqus support. To enable Disqus, add `disqusshortname = "XYZ"` to `config.toml`. More details: <http://gohugo.io/extras/comments/>.
* In the posts list, replaced date with bullets at smaller screen widths. * In the posts list, replaced date with bullets at smaller screen widths.
> v0.1.0 > v0.1.0

View File

@@ -8,7 +8,7 @@ publishdir = "public"
author = "Arthur Dent" author = "Arthur Dent"
title = "Arthur Dent" title = "Arthur Dent"
pygmentsuseclasses = true pygmentsuseclasses = true
disqusShortname = "cocoaexamplesite" # Comment out to disable Disqus. disqusshortname = "cocoaexamplesite" # Comment out to disable Disqus.
pluralizelisttitles = false pluralizelisttitles = false
[permalinks] [permalinks]
@@ -16,21 +16,21 @@ fixed = ":title/"
blog = "blog/:slug/" blog = "blog/:slug/"
[params] [params]
Author = "Arthur Dent" author = "Arthur Dent"
# Gravatar = "" # do not use in the same time as Avatar # gravatar = "" # do not use in the same time as Avatar
# Avatar = "" # path to image in static dir e.g img/avatar.png (do not use in the same time as Gravatar) # avatar = "" # path to image in static dir e.g img/avatar.png (do not use in the same time as Gravatar)
CacheBuster = true cachebuster = true
DateForm = "Jan 2, 2006" dateform = "Jan 2, 2006"
DateFormFull = "Mon Jan 2 2006 15:04:05 MST" dateformfull = "Mon Jan 2 2006 15:04:05 MST"
Description = "Don't panic" description = "Don't panic"
Email = "you@example.space" email = "you@example.space"
FaviconFile = "img/leaf.ico" faviconfile = "img/leaf.ico"
GATracker = "XYZ" gatracker = "XYZ"
GitHub = "//github.com/you" github = "//github.com/you"
HighlightJS = true highlightjs = true
Initials = "ad" # Displayed on single post page; DEPRECATED in v0.3.0. initials = "ad" # Displayed on single post page; DEPRECATED in v0.3.0.
Lang = "en" lang = "en"
LinkedIn = "//linkedin.com/in/you" linkedin = "//linkedin.com/in/you"
Twitter = "//twitter.com/you" twitter = "//twitter.com/you"
ExtraCssFiles = [ "/css/override.css" ] # In your `static/css`, add/remove files as necessary. extracssfiles = [ "/css/override.css" ] # In your `static/css`, add/remove files as necessary.

View File

@@ -9,7 +9,7 @@
<div class="initials"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.Initials }}</a></div> <div class="initials"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.Initials }}</a></div>
</div> </div>
<div class="meta"> <div class="meta">
<div class="date" title="{{ .Date.Format (.Site.Param "DateFormFull") }}">{{ .Date.Format (.Site.Param "DateForm") }}</div> <div class="date" title="{{ .Date.Format .Site.Params.dateformfull }}">{{ .Date.Format .Site.Params.dateform }}</div>
<div class="reading-time"><div class="middot"></div>{{ if eq 1 .ReadingTime }}{{ .ReadingTime }} minute read{{ else }}{{ .ReadingTime }} minutes read{{ end }}</div> <div class="reading-time"><div class="middot"></div>{{ if eq 1 .ReadingTime }}{{ .ReadingTime }} minute read{{ else }}{{ .ReadingTime }} minutes read{{ end }}</div>
</div> </div>
</div> </div>

View File

@@ -1,18 +1,18 @@
<!-- Google Analytics --> <!-- Google Analytics -->
{{ if .Site.Param "GATracker" }} {{ if .Site.Params.gatracker }}
<script type="text/javascript"> <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
try { try {
var pageTracker = _gat._getTracker("{{ .Site.Param "GATracker" }}"); var pageTracker = _gat._getTracker("{{ .Site.Params.gatracker }}");
pageTracker._trackPageview(); pageTracker._trackPageview();
} catch(err) {} } catch(err) {}
</script> </script>
{{ end }} {{ end }}
{{ if .Site.Param "HighlightJS" }} {{ if .Site.Params.highlightjs }}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -10,18 +10,18 @@
<!-- CSS --> <!-- CSS -->
{{ if (.Site.Param "HighlightJS") }} {{ if .Site.Params.highlightjs }}
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css">
{{ end }} {{ end }}
{{ if eq true (.Site.Param "CacheBuster") }} {{ if eq true .Site.Params.cachebuster }}
<link rel="stylesheet" href="/css/reset.css"> <link rel="stylesheet" href="/css/reset.css">
<link rel="stylesheet" href="/css/pygments.css"> <link rel="stylesheet" href="/css/pygments.css">
<link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/css/main.css">
{{range (.Site.Param "ExtraCssFiles")}} {{range .Site.Params.extracssfiles}}
<link rel="stylesheet" href="{{.}}"> <link rel="stylesheet" href="{{.}}">
{{end}} {{end}}
@@ -31,7 +31,7 @@
<link rel="stylesheet" href="/css/pygments.css?{{ .Now.Unix }}"> <link rel="stylesheet" href="/css/pygments.css?{{ .Now.Unix }}">
<link rel="stylesheet" href="/css/main.css?{{ .Now.Unix }}"> <link rel="stylesheet" href="/css/main.css?{{ .Now.Unix }}">
{{range (.Site.Param "ExtraCssFiles")}} {{range .Site.Params.extracssfiles}}
<link rel="stylesheet" href="{{.}}?{{ .Now.Unix }}"> <link rel="stylesheet" href="{{.}}?{{ .Now.Unix }}">
{{end}} {{end}}
@@ -39,8 +39,8 @@
<!-- Icon --> <!-- Icon -->
<link rel="shortcut icon" <link rel="shortcut icon"
{{ if (.Site.Param "FaviconFile") }} {{ if .Site.Params.faviconfile }}
href="/{{ .Site.Param "FaviconFile" }}" href="/{{ .Site.Params.faviconfile }}"
{{ else }} {{ else }}
href="/img/favicon.ico" href="/img/favicon.ico"
{{ end }} {{ end }}

View File

@@ -3,17 +3,17 @@
{{ partial "head.html" . }} {{ partial "head.html" . }}
<body lang="{{ .Site.Param "Lang" }}"> <body lang="{{ .Site.Params.lang }}">
<section class="header"> <section class="header">
<div class="container"> <div class="container">
<div class="content"> <div class="content">
{{ if .Site.Param "Gravatar" }} {{ if .Site.Params.gravatar }}
<a href="/"><img class="avatar" src="https://gravatar.com/avatar/{{ .Site.Param "Gravatar" }}?s=50" /></a> <a href="/"><img class="avatar" src="https://gravatar.com/avatar/{{ .Site.Params.gravatar }}?s=50" /></a>
{{ else if .Site.Param "Avatar" }} {{ else if .Site.Params.avatar }}
<a href="/"><img class="avatar" src="/{{ .Site.Param "Avatar" }}" /></a> <a href="/"><img class="avatar" src="/{{ .Site.Params.avatar }}" /></a>
{{ end }} {{ end }}
<a href="/"><div class="name">{{ .Site.Param "Author" }}</div></a> <a href="/"><div class="name">{{ .Site.Params.author }}</div></a>
<nav> <nav>
<ul> <ul>
<a href="/blog/"><li>Blog</li></a> <a href="/blog/"><li>Blog</li></a>
@@ -29,38 +29,38 @@
<div class="container"> <div class="container">
<div class="content"> <div class="content">
{{ if .Site.Param "GitHub" }} {{ if .Site.Params.github }}
<a href="{{ .Site.Param "GitHub" }}" target="_blank"> <a href="{{ .Site.Params.github }}" target="_blank">
<i class="icon ion-social-github"></i> <i class="icon ion-social-github"></i>
</a> </a>
{{ end }} {{ end }}
{{ if .Site.Param "Twitter" }} {{ if .Site.Params.twitter }}
<a href="{{ .Site.Param "Twitter" }}" target="_blank"> <a href="{{ .Site.Params.twitter }}" target="_blank">
<i class="icon ion-social-twitter"></i> <i class="icon ion-social-twitter"></i>
</a> </a>
{{ end }} {{ end }}
{{ if .Site.Param "LinkedIn" }} {{ if .Site.Params.linkedin }}
<a href="{{ .Site.Param "LinkedIn" }}" target="_blank"> <a href="{{ .Site.Params.linkedin }}" target="_blank">
<i class="icon ion-social-linkedin"></i> <i class="icon ion-social-linkedin"></i>
</a> </a>
{{ end }} {{ end }}
{{ if .Site.Param "Facebook" }} {{ if .Site.Params.facebook }}
<a href="{{ .Site.Param "Facebook" }}" target="_blank"> <a href="{{ .Site.Params.facebook }}" target="_blank">
<i class="icon ion-social-facebook larger"></i> <i class="icon ion-social-facebook larger"></i>
</a> </a>
{{ end }} {{ end }}
{{ if .Site.Param "SoundCloud" }} {{ if .Site.Params.soundcloud }}
<a href="{{ .Site.Param "SoundCloud" }}" target="_blank"> <a href="{{ .Site.Params.soundcloud }}" target="_blank">
<i class="icon ion-ios-musical-notes larger"></i> <i class="icon ion-ios-musical-notes larger"></i>
</a> </a>
{{ end }} {{ end }}
{{ if .Site.Param "Email" }} {{ if .Site.Params.email }}
<a href="mailto:{{ .Site.Param "Email" }}"> <a href="mailto:{{ .Site.Params.email }}">
<i class="icon ion-ios-email larger"></i> <i class="icon ion-ios-email larger"></i>
</a> </a>
{{ end }} {{ end }}

View File

@@ -1,4 +1,4 @@
<li class="post-item"> <li class="post-item">
<span class="meta">{{ .Date.Format (.Site.Param "DateForm") }}</span> <span class="meta">{{ .Date.Format .Site.Params.dateform }}</span>
<a href="{{ .Permalink }}"><span>{{ .Title }}</span></a> <a href="{{ .Permalink }}"><span>{{ .Title }}</span></a>
</li> </li>

View File

@@ -3,4 +3,4 @@
<meta name="HandheldFriendly" content="True"> <meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320"> <meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
{{ if .Site.Param "Description" }}<meta name="description" content="{{ .Site.Param "Description" }}">{{ end }} {{ if .Site.Params.description }}<meta name="description" content="{{ .Site.Params.description }}">{{ end }}