From 6220d09ffba112dd6bbe4b48c8f3957deac9cb52 Mon Sep 17 00:00:00 2001
From: Cotes Chung <11371340+cotes2020@users.noreply.github.com>
Date: Fri, 3 Dec 2021 20:50:12 +0800
Subject: [PATCH] Replace the pageviews with categories on home page
---
_includes/js-selector.html | 2 +-
_layouts/home.html | 16 ++++++++++------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/_includes/js-selector.html b/_includes/js-selector.html
index 20531b4..219fe96 100644
--- a/_includes/js-selector.html
+++ b/_includes/js-selector.html
@@ -4,7 +4,7 @@
-{% if page.layout == 'home' or page.layout == 'post' %}
+{% if page.layout == 'post' %}
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
diff --git a/_layouts/home.html b/_layouts/home.html
index 6cf5e3c..1233e10 100644
--- a/_layouts/home.html
+++ b/_layouts/home.html
@@ -68,13 +68,17 @@ layout: page
{% include read-time.html content=post.content %}
-
- {% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
-
-
-
-
+
+ {% if post.categories.size > 0 %}
+
+
+ {% for category in post.categories %}
+ {{ category }}
+ {%- unless forloop.last -%},{%- endunless -%}
+ {% endfor %}
+
{% endif %}
+
{% if post.pin %}