diff --git a/assets/js/main.js b/assets/js/main.js index 64b3c605..5260fa5e 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -55,29 +55,29 @@ jQuery(function($) { }; _Blog.toggleTheme = function() { - const currentTheme = window.localStorage && window.localStorage.getItem('theme') - const isDark = currentTheme === 'dark' - $('body').toggleClass('dark-theme', isDark) + const currentTheme = window.localStorage && window.localStorage.getItem('theme'); + const isDark = currentTheme === 'dark'; + $('body').toggleClass('dark-theme', isDark); $('.theme-switch').on('click', () => { - $('body').toggleClass('dark-theme') + $('body').toggleClass('dark-theme'); window.localStorage && - window.localStorage.setItem('theme', document.body.classList.contains('dark-theme') ? 'dark' : 'light', ) - }) + window.localStorage.setItem('theme', document.body.classList.contains('dark-theme') ? 'dark' : 'light', ); + }); } _Blog.toggleMobileMenu = function() { $('.menu-toggle').on('click', () => { - $('.menu-toggle').toggleClass('active') - $('#mobile-menu').toggleClass('active') - }) + $('.menu-toggle').toggleClass('active'); + $('#mobile-menu').toggleClass('active'); + }); } $(document).ready(function() { - _Blog.toggleTheme() - _Blog.prettify() - _Blog.countdown() - _Blog.changeTitle() - _Blog.toggleMobileMenu() - _Blog.typeit() + _Blog.toggleTheme(); + _Blog.prettify(); + _Blog.countdown(); + _Blog.changeTitle(); + _Blog.toggleMobileMenu(); + _Blog.typeit(); }); }); diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 5a9e7d6e..066d19a1 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -11,7 +11,7 @@ - {{ block "title" . -}}{{ .Site.Title }}{{- end }} + {{ block "title" . }}{{ .Site.Title }}{{ end }} {{ partial "head.html" . }} diff --git a/layouts/partials/home_post.html b/layouts/partials/home_post.html index f53dac50..729562fa 100644 --- a/layouts/partials/home_post.html +++ b/layouts/partials/home_post.html @@ -2,27 +2,29 @@
- {{ with .Site.Params.avatar}} - {{ $avatar := .}} -
- -
- {{ end }} + {{ $avatar := "" }} {{ if or .Params.gravatar.Email (and .Site.Params.gravatar.Email (ne .Params.gravatar.Email false)) }} -
- gravatar -
+ {{ $avatar = (printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" (md5 .Site.Params.gravatar.email)) }} + {{ else if .Site.Params.avatar }} + {{ $avatar = (printf "%s%s" $cdn_url .) }} + {{ end }} + {{ if $avatar }} +
+ avatar +
{{ end }} {{ with .Site.Params.subtitle }}

+ {{ end }} -
+ {{ range (.Paginate .Pages).Pages }}
diff --git a/layouts/partials/home_profile.html b/layouts/partials/home_profile.html index c3799569..a9951465 100644 --- a/layouts/partials/home_profile.html +++ b/layouts/partials/home_profile.html @@ -2,20 +2,25 @@
{{ $avatar := "" }} - {{ with .Site.Params.avatar}} - {{ $avatar = (printf "%s%s" $cdn_url .) }} - {{ end }} {{ if or .Params.gravatar.Email (and .Site.Params.gravatar.Email (ne .Params.gravatar.Email false)) }} {{ $avatar = (printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" (md5 .Site.Params.gravatar.email)) }} + {{ else if .Site.Params.avatar }} + {{ $avatar = (printf "%s%s" $cdn_url .) }} {{ end }} {{ if $avatar }} - +
+ avatar +
{{ end }} {{ with .Site.Params.subtitle }}

+ {{ end }}