From df3a7039889207cf65c21bfbb71ee8115058e307 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 1 Dec 2021 21:48:57 +0800 Subject: [PATCH 1/2] Refactor HTML structure --- _includes/disqus.html | 4 + _includes/panel.html | 59 --------- _includes/search-results.html | 8 -- _includes/toc.html | 10 ++ _includes/trending-tags.html | 14 +++ _includes/update-list.html | 16 +++ _layouts/default.html | 2 +- _layouts/page.html | 49 +++++--- _layouts/post.html | 217 ++++++++++++++-------------------- 9 files changed, 170 insertions(+), 209 deletions(-) delete mode 100644 _includes/panel.html create mode 100644 _includes/toc.html diff --git a/_includes/disqus.html b/_includes/disqus.html index 65af8b5..c4746de 100644 --- a/_includes/disqus.html +++ b/_includes/disqus.html @@ -2,6 +2,8 @@ The Disqus lazy loading. --> +{% if site.disqus.comments and page.comments %} +
Comments powered by Disqus. @@ -52,3 +54,5 @@ } + +{% endif %} diff --git a/_includes/panel.html b/_includes/panel.html deleted file mode 100644 index 98b859c..0000000 --- a/_includes/panel.html +++ /dev/null @@ -1,59 +0,0 @@ - - -{% include lang.html %} - -
- - {% for item in update_list %} - {% assign index = item | split: "::" | last | plus: 0 %} - {% assign post = site.posts[index] %} - {% assign url = post.url | relative_url %} -- {{ post.title }}
- {% endfor %}
-
-
-{{ site.data.locales[lang].panel.trending_tags }}
- {% include trending-tags.html %} - - {% for tag in trending_tags %} - {% capture url %}/tags/{{ tag | slugify | url_encode }}/{% endcapture %} - {{ tag | replace: '-', ' ' }} - {% endfor %} -+ {{- site.data.locales[lang].panel.toc -}} +
+ +{{- site.data.locales[lang].panel.trending_tags -}}
+{{- site.data.locales[lang].panel.lastmod -}}
++ {% for item in update_list %} + {% assign index = item | split: "::" | last | plus: 0 %} + {% assign post = site.posts[index] %} + {% assign url = post.url | relative_url %} +- {{ post.title }}
+ {% endfor %}
+
+{% if page.collection == 'tabs' %} @@ -16,26 +19,40 @@ layout: default {% endif %}
{{ page.title }}
-{{ page.title }}
- -+ + {% if page.last_modified_at %} + + {{ site.data.locales[lang].post.updated }} + {% include timeago.html date=page.last_modified_at class="lastmod" tooltip=true %} + {% endif %} + + + {% include read-time.html content=content prompt=true %} + + + {% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %} + + + + {{ site.data.locales[lang].post.pageview_measure }} + {% endif %} + +