diff options
author | Hanzei <hanzei@mailbox.org> | 2018-07-20 15:45:36 +0300 |
---|---|---|
committer | Hanzei <hanzei@mailbox.org> | 2018-07-20 15:45:36 +0300 |
commit | ef5feab3ef4a66a03ccc89416303cfb6d5293a3a (patch) | |
tree | 3eb7013694433b62821a02149a728b2bcc6a6b3a /layouts | |
parent | 64b7e1b01043807bf328363024bdb0ba1bdff8cc (diff) |
Refactor config.toml
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/blog/list.html | 4 | ||||
-rw-r--r-- | layouts/blog/single.html | 12 | ||||
-rw-r--r-- | layouts/index.html | 17 | ||||
-rw-r--r-- | layouts/partials/footer/scripts.html | 9 | ||||
-rw-r--r-- | layouts/partials/head/favicons.html | 5 | ||||
-rw-r--r-- | layouts/partials/home/blog.html | 6 |
6 files changed, 27 insertions, 26 deletions
diff --git a/layouts/blog/list.html b/layouts/blog/list.html index eede8cc..e1d1b66 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -3,10 +3,10 @@ {{ .Content }} </div> <div class="container"> - {{ if .Site.Params.showLatest }} + {{ if .Site.Params.home.showLatest | default true }} <h2 class="title is-2 top-pad">{{ i18n "index_blog_latestPosts" . }}</h2> {{ range first 1 .Pages.ByPublishDate.Reverse }} - <div class="summary">{{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }} + <div class="summary">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} <h3 class="title is-3 strong-post-title"> <a href="{{ .RelPermalink }}"> {{ .Title }} diff --git a/layouts/blog/single.html b/layouts/blog/single.html index 64c6666..98f6062 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -8,31 +8,31 @@ <a href="{{ .Permalink }}">{{ .Title }}</a> </h2> <div class="post-data"> - {{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }} | + {{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | {{ i18n "blog_readingTime" .ReadingTime }} </div> - {{ if .Site.Params.shareButtons }} + {{ if or .Site.Params.share.twitter .Site.Params.share.facebook .Site.Params.share.pinterest .Site.Params.share.googlePlus }} <div class="blog-share"> {{ i18n "blog_shareThis" . }}: - {{ if .Site.Params.shareTwitter }} + {{ if .Site.Params.share.twitter }} <a class="twitter-share-button" href="https://twitter.com/intent/tweet?text=Read%20{{ .Title }}%20{{ .Permalink }}" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;"> <i class="fab fa-twitter"></i> <span class="hidden">Twitter</span> </a> {{ end }} - {{ if .Site.Params.shareFacebook }} + {{ if .Site.Params.share.facebook }} <a class="icon-facebook" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;"> <i class="fab fa-facebook-f"></i> <span class="hidden">Facebook</span> </a> {{ end }} - {{ if .Site.Params.sharePinterest }} + {{ if .Site.Params.share.pinterest }} <a class="icon-pinterest" href="http://pinterest.com/pin/create/button/?url={{ .Permalink }}{{ if .Params.pinterestMedia }}&media={{ .Site.BaseURL }}{{ .Params.pinterestMedia }}{{ end }}&description={{ .Title | safeHTML}}" onclick="window.open(this.href, 'pinterest-share','width=580,height=296');return false;"> <i class="fab fa-pinterest-p"></i> <span class="hidden">Pinterest</span> </a> {{ end }} - {{ if .Site.Params.shareGooglePlus }} + {{ if .Site.Params.share.googlePlus }} <a class="icon-google-plus" href="https://plus.google.com/share?url={{ .Permalink }}" onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;"> <i class="fab fa-google-plus-g"></i> <span class="hidden">Google+</span> diff --git a/layouts/index.html b/layouts/index.html index 4d9de96..281b366 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -10,7 +10,7 @@ <body> <div id="top"> {{ with .Site.GetPage "page" "home" }} - <div class="hero is-{{ .Site.Params.introHeight | default "fullheight" }}"> + <div class="hero is-{{ .Site.Params.home.introHeight | default "large" }}"> <!-- Super sweet Hero body title --> <div class="hero-body"> <div class="container has-text-centered"> @@ -83,12 +83,12 @@ <div class="markdown"> {{ .Content }} </div> - {{ if .Site.Params.localTime }} + {{ if .Site.Params.home.localTime }} <p>{{ i18n "index_currentTime" . }} <span id='time'></span>.</p> {{ end }} - {{ if .Site.Params.email }} + {{ with .Site.Params.home.email }} <h3 class="subtitle is-3 has-text-centered top-pad"> - <a href="mailto:{{ .Site.Params.email }}">{{ .Site.Params.email }}</a> + <a href="mailto:{{ . }}">{{ . }}</a> </h3> {{ end }} {{ partial "home/social.html" . }} @@ -107,5 +107,14 @@ <!-- End of fade in three section --> {{ partial "footer/scripts.html" . }} {{ partial "js/owlCarousel.html" . }} + + {{ if .Site.Params.home.localTime }} + {{ $momentjs := resources.Get "vendor/momentjs/moment.min.js" }} + {{ $momentTimezone := resources.Get "vendor/momentjs/moment-timezone.min.js" }} + {{ $momentTimezoneWithData := resources.Get "vendor/momentjs/moment-timezone-with-data-2012-2022.min.js" }} + {{ $initMomentjs := resources.Get "js/initMoment.js" | resources.ExecuteAsTemplate "js/initMoment.tmp.js" . }} + {{ $bundleMoment := slice $momentjs $momentTimezone $momentTimezoneWithData $initMomentjs | resources.Concat "/js/bundleMoment.js" | fingerprint }} + <script src="{{ $bundleMoment.Permalink }}" integrity="{{ $bundleMoment.Data.Integrity }}"></script> + {{ end }} </body> </html> diff --git a/layouts/partials/footer/scripts.html b/layouts/partials/footer/scripts.html index 4f517e7..e3533d4 100644 --- a/layouts/partials/footer/scripts.html +++ b/layouts/partials/footer/scripts.html @@ -3,13 +3,4 @@ {{ $scripts := slice $jQuery $index | resources.Concat "/js/bundle.js" | fingerprint }} <script src="{{ $scripts.Permalink }}" integrity="{{ $scripts.Data.Integrity }}"></script> -{{ if and .Site.Params.localTime .Page.IsHome }} -{{ $momentjs := resources.Get "vendor/momentjs/moment.min.js" }} -{{ $momentTimezone := resources.Get "vendor/momentjs/moment-timezone.min.js" }} -{{ $momentTimezoneWithData := resources.Get "vendor/momentjs/moment-timezone-with-data-2012-2022.min.js" }} -{{ $initMomentjs := resources.Get "js/initMoment.js" | resources.ExecuteAsTemplate "js/initMoment.tmp.js" . }} -{{ $bundleMoment := slice $momentjs $momentTimezone $momentTimezoneWithData $initMomentjs | resources.Concat "/js/bundleMoment.js" | fingerprint }} -<script src="{{ $bundleMoment.Permalink }}" integrity="{{ $bundleMoment.Data.Integrity }}"></script> -{{ end }} - {{ template "_internal/google_analytics_async.html" . }} diff --git a/layouts/partials/head/favicons.html b/layouts/partials/head/favicons.html index c6813e9..e1c93d0 100644 --- a/layouts/partials/head/favicons.html +++ b/layouts/partials/head/favicons.html @@ -1,2 +1,3 @@ -<!-- Icon --> -<link rel="shortcut icon" href="{{ .Site.Params.faviconFile | default "img/favicon.ico" | relURL }}"> +{{ with .Site.Params.favicon }} +<link rel="shortcut icon" href="{{ . | relURL }}"> +{{ end }} diff --git a/layouts/partials/home/blog.html b/layouts/partials/home/blog.html index b26801c..f038e04 100644 --- a/layouts/partials/home/blog.html +++ b/layouts/partials/home/blog.html @@ -2,10 +2,10 @@ <div class="section" id="{{ .Title | urlize }}"> <!-- Begin Blog container --> <div class="container"> - {{ if .Site.Params.showLatest }} + {{ if .Site.Params.home.showLatest | default true }} <h2 class="title is-2 has-text-centered">{{ i18n "index_blog_latestPosts" . }}</h2> {{ range first 1 .Pages.ByPublishDate.Reverse }} - <div class="summary">{{ .Date.Format (.Site.Params.dateForm | default "Jan 02, 2006") }} + <div class="summary">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} <h3 class="title is-3 latest-post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3> <div class="markdown"> {{ .Summary }} @@ -16,7 +16,7 @@ </div> {{ end }} {{ end }} - {{ if .Site.Params.showAllPosts }} + {{ if .Site.Params.home.showAllPosts }} <h2 class="title is-2 has-text-centered top-pad">{{ i18n "index_blog_allPosts" . }}</h2> {{ partialCached "blog/li.html" . }} {{ else }} |