diff options
author | Dmitry Verkhoturov <paskal.07@gmail.com> | 2018-03-25 18:08:39 +0300 |
---|---|---|
committer | Vicky Lai <vicky@vickylai.io> | 2018-03-25 18:08:39 +0300 |
commit | f4568a45894f302b368e52fe82958ee0964dca9a (patch) | |
tree | 7d107dccbefcb5e7e10f1583a70ff2cfc458febe | |
parent | a459b3808f674e97ac142d74584d750d151e6b11 (diff) |
set default if no configuration is set for variables which require that (#36)
-rw-r--r-- | layouts/_default/list.html | 4 | ||||
-rw-r--r-- | layouts/_default/taxonomy.html | 4 | ||||
-rw-r--r-- | layouts/blog/list.html | 8 | ||||
-rw-r--r-- | layouts/blog/single.html | 6 | ||||
-rw-r--r-- | layouts/index.html | 4 | ||||
-rw-r--r-- | layouts/partials/blogsection.html | 4 | ||||
-rw-r--r-- | layouts/partials/header.html | 4 | ||||
-rw-r--r-- | layouts/partials/li.html | 4 | ||||
-rw-r--r-- | layouts/partials/projects.html | 4 |
9 files changed, 21 insertions, 21 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 856a388..98f56b9 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -29,7 +29,7 @@ <!-- Ranges through content/post/*.md --> {{ range .Data.Pages.ByPublishDate }} {{ if not (eq .Section "blog") }} <li> - <a href="{{.Permalink}}">{{.Date.Format .Site.Params.dateForm }} | {{.Title}}</a> + <a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a> </li> {{ end }} {{ end }} </ul> @@ -62,4 +62,4 @@ }) </script> -</body>
\ No newline at end of file +</body> diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index 4130450..383bc3f 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -29,7 +29,7 @@ <!-- Ranges through content/post/*.md --> {{ range .Data.Pages.ByPublishDate }} <li> - <a href="{{.Permalink}}">{{.Date.Format .Site.Params.dateForm }} | {{.Title}}</a> + <a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a> </li> {{ end }} </ul> @@ -62,4 +62,4 @@ }) </script> -</body>
\ No newline at end of file +</body> diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 6597d86..8da589e 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -4,7 +4,7 @@ <div class="section" id="top"><!-- Parent section --> <div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}"><!-- Begin Title --> - <h1 class="bold-title is-1">{{ .Site.Params.blogHead }}</h1> + <h1 class="bold-title is-1">{{ .Site.Params.blogHead | default "Blog" }}</h1> </div><!-- End Title --> <!-- Everything below fades in two! --> @@ -13,13 +13,13 @@ <div class="container"><!-- Begin Nav bar --> {{ partial "nav-list.html" . }} </div><!-- End Nav bar --> - + <div class="container"><!-- Begin Blog container --> {{ if .Site.Params.showLatest }} <h2 class="title is-2 top-pad">Latest Post</h2> - {{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }} - <div class="summary">{{ .Date.Format .Site.Params.dateForm }} + {{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }} + <div class="summary">{{ .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} <h3 class="title is-3 strong-post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3> <div class="markdown"> {{ .Summary }} diff --git a/layouts/blog/single.html b/layouts/blog/single.html index 09600c2..fe9565b 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -4,7 +4,7 @@ <div class="section" id="top"><!-- Parent section --> <div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}"><!-- Begin Title --> - <h1 class="bold-title is-1">{{ .Site.Params.blogHead }}</h1> + <h1 class="bold-title is-1">{{ .Site.Params.blogHead | default "Blog" }}</h1> </div><!-- End Title --> <!-- Everything below fades in two! --> @@ -17,7 +17,7 @@ <div class="container {{ if .Site.Params.fadeIn }} fade-in two {{ end }}"><!-- Begin blog title container --> <h2 class="title is-1 top-pad strong-post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h2> <div class="post-data"> - {{ .Date.Format .Site.Params.dateForm }} | + {{ .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{ if eq 1 .ReadingTime }}{{ .ReadingTime }} minute read{{ else }}{{ .ReadingTime }} minutes read{{ end }} </div> @@ -87,4 +87,4 @@ $('a[href^="{{ .Permalink }}#"]').click(function(e) { }) </script> -</body>
\ No newline at end of file +</body> diff --git a/layouts/index.html b/layouts/index.html index ffa2a2d..5d922c1 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -3,14 +3,14 @@ <div id="top"> <!-- Where all the awesome begins --> -<div class="hero is-{{ .Site.Params.introHeight }}"> +<div class="hero is-{{ .Site.Params.introHeight | default "fullheight" }}"> <!-- Possible hero-head not used --> <!-- Super sweet Hero body title --> <div class="hero-body"> <div class="container has-text-centered"> <!-- Title and tagline --> <h1 class="bold-title {{ if .Site.Params.fadeIn }}fade-in one{{ end }}"> - Hi, I'm {{ .Site.Params.firstName }}. + Hi, I'm {{ .Site.Params.firstName | default "Introduction" }}. </h1> <h3 class="subtitle is-3 {{ if.Site.Params.fadeIn }} fade-in two{{ end }}"> {{ .Site.Params.tagLine }} diff --git a/layouts/partials/blogsection.html b/layouts/partials/blogsection.html index 4b5377e..886cdf7 100644 --- a/layouts/partials/blogsection.html +++ b/layouts/partials/blogsection.html @@ -2,8 +2,8 @@ {{ if .Site.Params.showLatest }} <h2 class="title is-2 has-text-centered">Latest Post</h2> - {{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }} - <div class="summary">{{ .Date.Format .Site.Params.dateForm }} + {{ range first 1 (where .Data.Pages.ByPublishDate.Reverse "Section" "blog") }} + <div class="summary">{{ .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} <h3 class="title is-3 latest-post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3> <div class="markdown"> {{ .Summary }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 951bfc7..c8eb9ee 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -46,14 +46,14 @@ crossorigin="anonymous"></script> {{ if .Site.Params.cacheBuster }} {{ $t := now.Unix }} - <link rel="stylesheet" href="css/{{ .Site.Params.themeStyle }}-style.css?t={{$t}}"> + <link rel="stylesheet" href="css/{{ .Site.Params.themeStyle | default "dark" }}-style.css?t={{$t}}"> {{range .Site.Params.extraCSSFiles}} <link rel="stylesheet" href="{{.}}?t={{$t}}"> {{ end }} {{ else }} - <link rel="stylesheet" href="css/{{ .Site.Params.themeStyle }}-style.css"> + <link rel="stylesheet" href="css/{{ .Site.Params.themeStyle | default "dark" }}-style.css"> {{range .Site.Params.extraCSSFiles}} <link rel="stylesheet" href="{{.}}"> {{end}} diff --git a/layouts/partials/li.html b/layouts/partials/li.html index 8761d7c..1e26736 100644 --- a/layouts/partials/li.html +++ b/layouts/partials/li.html @@ -1,3 +1,3 @@ <li class="post-item"> - <span><a href="{{ .Permalink }}">{{ .Title }}</a></span> - <span>{{ .Date.Format .Site.Params.dateForm }}</span> -</li>
\ No newline at end of file + <span><a href="{{ .Permalink }}">{{ .Title }}</a></span> - <span>{{ .Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }}</span> +</li> diff --git a/layouts/partials/projects.html b/layouts/partials/projects.html index eca447e..74539af 100644 --- a/layouts/partials/projects.html +++ b/layouts/partials/projects.html @@ -5,8 +5,8 @@ <div class="section is-small"> <div class="columns is-multiline"> {{ range sort .Pages }} {{ if eq .Section "projects" }} - {{ if eq .Site.Params.projectColumns "2" }} - <div class="column is-half"> {{ else if eq .Site.Params.projectColumns "3" }} + {{ if eq (.Site.Params.projectColumns | default "3") "2" }} + <div class="column is-half"> {{ else if eq (.Site.Params.projectColumns | default "3") "3" }} <div class="column is-one-third"> {{ end }} <!-- Hey Vicky, show half column if number is even. --> <div {{ if not .Params.external_link }} id="project{{.Title | urlize}}" {{ end }} class="card"> |