diff options
| author | Eltrac <eltrac233@gmail.com> | 2024-11-28 23:27:47 +0800 |
|---|---|---|
| committer | Eltrac <eltrac233@gmail.com> | 2024-11-28 23:27:47 +0800 |
| commit | 454312c6cb5d070a62f2bdeaee7a2b98bde64c89 (patch) | |
| tree | 3222c20739ba0ab3d356b51cee70fadbf6d0050f | |
| parent | 9a5213bc7fbecbcc19af73dd9d437458949827be (diff) | |
remove(theme): no title in pages and no author in posts
| -rw-r--r-- | themes/yinyang/layouts/_default/single.html | 30 | ||||
| -rw-r--r-- | themes/yinyang/layouts/partials/scripts.html | 15 | ||||
| -rw-r--r-- | themes/yinyang/layouts/partials/snippets/waline-init.html | 12 |
3 files changed, 20 insertions, 37 deletions
diff --git a/themes/yinyang/layouts/_default/single.html b/themes/yinyang/layouts/_default/single.html index 4a4d4037..53401748 100644 --- a/themes/yinyang/layouts/_default/single.html +++ b/themes/yinyang/layouts/_default/single.html @@ -7,19 +7,22 @@ <article class="post {{ .Site.Language.LanguageName }}" id="article"> <div class="row"> <div class="col-xs-12"> + <!-- Site Header --> <div class="site-header"> {{ partial "header.html" . }} </div> + + <!-- Post Header --> <header class="post-header"> + {{ if in .Site.Params.mainSections .Type }} + <!-- Title and Subtitle --> <h1 class="post-title"> {{ .Title }} {{ with .Params.subtitle }} <small class="post-subtitle">{{ . }}</small> {{ end }} </h1> - - - {{ if in .Site.Params.mainSections .Type }} + <!-- Post Meta --> <div class="row post-desc"> <div class="col-xs-6"> {{ if .Date }} @@ -33,13 +36,6 @@ Views </span> </div> - <div class="col-xs-6"> - {{ if .Site.Author.name }} - <div class="post-author"> - <a target="_blank" href="{{ .Site.Author.homepage }}">@{{ .Site.Author.name }}</a> - </div> - {{ end }} - </div> </div> {{ end }} </header> @@ -73,19 +69,7 @@ <div id="waline"></div> <script type="module"> import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js'; - - const options = { - el: '#waline', - serverURL: 'https://waline.geedea.pro', - dark: 'auto', - pageview: true, - }; - - if (location.href.includes('localhost') || location.href.includes('127.0.0.1')) { - options.pageview = false; - } - - init(options); + {{ partial "snippets/waline-init.html" . | safeJS }} </script> </div> {{ end }} diff --git a/themes/yinyang/layouts/partials/scripts.html b/themes/yinyang/layouts/partials/scripts.html index 3e7116fe..1e6768bb 100644 --- a/themes/yinyang/layouts/partials/scripts.html +++ b/themes/yinyang/layouts/partials/scripts.html @@ -11,19 +11,6 @@ const swup = new Swup(); swup.hooks.on('page:view', (visit) => { - if (!location.href.includes('/posts')) return; - - const options = { - el: '#waline', - serverURL: 'https://waline.geedea.pro', - dark: 'auto', - pageview: true, - }; - - if (location.href.includes('localhost') || location.href.includes('127.0.0.1')) { - options.pageview = false; - } - - init(options); + {{ partial "snippets/waline-init.html" . | safeJS }} }); </script>
\ No newline at end of file diff --git a/themes/yinyang/layouts/partials/snippets/waline-init.html b/themes/yinyang/layouts/partials/snippets/waline-init.html new file mode 100644 index 00000000..8b3fa795 --- /dev/null +++ b/themes/yinyang/layouts/partials/snippets/waline-init.html @@ -0,0 +1,12 @@ +const options = { + el: '#waline', + serverURL: 'https://waline.geedea.pro', + dark: 'auto', + pageview: true, +}; + +if (location.href.includes('localhost') || location.href.includes('127.0.0.1')) { + options.pageview = false; +} + +init(options);
\ No newline at end of file |
