From e0fc64c43e8f170c50c58907d3074e563f55399c Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Sun, 10 Dec 2023 12:36:05 +0530
Subject: [PATCH 01/19] Optimize footer margins
---
assets/css/common/post-single.css | 24 +++---
assets/css/core/zmedia.css | 6 ++
layouts/partials/share_icons.html | 118 +++++++++++++++++-------------
3 files changed, 87 insertions(+), 61 deletions(-)
diff --git a/assets/css/common/post-single.css b/assets/css/common/post-single.css
index 47b9888..14dc701 100644
--- a/assets/css/common/post-single.css
+++ b/assets/css/common/post-single.css
@@ -296,10 +296,18 @@
margin-top: 56px;
}
+.post-footer>* {
+ margin-bottom: 10px;
+}
+
+.post-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 10px;
+}
+
.post-tags li {
display: inline-block;
- margin-inline-end: 3px;
- margin-bottom: 5px;
}
.post-tags a,
@@ -312,8 +320,7 @@
.post-tags a {
display: block;
- padding-inline-start: 14px;
- padding-inline-end: 14px;
+ padding: 0 14px;
color: var(--secondary);
font-size: 14px;
line-height: 34px;
@@ -326,15 +333,16 @@
}
.share-buttons {
- margin: 14px 0;
- padding-inline-start: var(--radius);
+ padding: 10px;
display: flex;
justify-content: center;
overflow-x: auto;
+ gap: 10px;
}
+.share-buttons li,
.share-buttons a {
- margin-top: 10px;
+ display: inline-flex;
}
.share-buttons a:not(:last-of-type) {
@@ -355,10 +363,8 @@ h6:hover .anchor {
}
.paginav {
- margin: 10px 0;
display: flex;
line-height: 30px;
- border-radius: var(--radius);
}
.paginav a {
diff --git a/assets/css/core/zmedia.css b/assets/css/core/zmedia.css
index 210d486..a68fd71 100644
--- a/assets/css/core/zmedia.css
+++ b/assets/css/core/zmedia.css
@@ -36,6 +36,12 @@
}
}
+@media screen and (max-width: 340px) {
+ .share-buttons {
+ justify-content: unset;
+ }
+}
+
@media (prefers-reduced-motion) {
/* terms; profile-mode; post-single; post-entry; post-entry; search; search */
.terms-tags a:active,
diff --git a/layouts/partials/share_icons.html b/layouts/partials/share_icons.html
index 4ae1879..910ba7f 100644
--- a/layouts/partials/share_icons.html
+++ b/layouts/partials/share_icons.html
@@ -13,69 +13,83 @@
{{- $ShareButtons := (.Param "ShareButtons")}}
{{- with $ShareButtons }}{{ $custom = true }}{{ end }}
-
+
From 2ecb08a5bac9723f264a1ee767494d2599a15aa3 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Fri, 15 Dec 2023 22:08:25 +0530
Subject: [PATCH 02/19] Plainify items insize toc list
---
layouts/partials/toc.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index d9b8b23..28f8694 100644
--- a/layouts/partials/toc.html
+++ b/layouts/partials/toc.html
@@ -71,10 +71,10 @@
{{- end -}}
{{- end }}
- {{- $header | safeHTML -}}
+ {{- $header | plainify | safeHTML -}}
{{- else }}
- {{- $header | safeHTML -}}
+ {{- $header | plainify | safeHTML -}}
{{- end -}}
{{- end -}}
From 6864770ad4dd67fe381e143ca48bdd81c38835ce Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Fri, 15 Dec 2023 22:09:15 +0530
Subject: [PATCH 03/19] Fix social icons extraneous margin
---
assets/css/common/main.css | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/assets/css/common/main.css b/assets/css/common/main.css
index 50022ac..cd5c76f 100644
--- a/assets/css/common/main.css
+++ b/assets/css/common/main.css
@@ -28,14 +28,12 @@
}
.social-icons {
- padding: 12px 0;
-}
-
-.social-icons a:not(:last-of-type) {
- margin-inline-end: 12px;
+ display: flex;
+ gap: 1rem;
}
.social-icons a svg {
+ display: block;
height: 26px;
width: 26px;
}
From 705ebeb72982dca772d2307cf3936710866dae99 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Fri, 15 Dec 2023 22:09:48 +0530
Subject: [PATCH 04/19] table styles update - reduce margins - rm reduced
fontsize
---
assets/css/common/post-single.css | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/assets/css/common/post-single.css b/assets/css/common/post-single.css
index 14dc701..7e40eea 100644
--- a/assets/css/common/post-single.css
+++ b/assets/css/common/post-single.css
@@ -130,19 +130,18 @@
}
.post-content table {
- margin-bottom: 32px;
+ margin-bottom: var(--content-gap);
}
.post-content table th,
.post-content table:not(.highlighttable, .highlight table, .gist .highlight) td {
min-width: 80px;
- padding: 12px 8px;
+ padding: 8px 5px;
line-height: 1.5;
border-bottom: 1px solid var(--border);
}
.post-content table th {
- font-size: 14px;
text-align: start;
}
From 28ec7a407d5c44789d6f608419dc147692a00327 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Sat, 16 Dec 2023 00:32:25 +0530
Subject: [PATCH 05/19] Revert "Fix social icons extraneous margin"
This reverts commit 6864770ad4dd67fe381e143ca48bdd81c38835ce.
---
assets/css/common/main.css | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/assets/css/common/main.css b/assets/css/common/main.css
index cd5c76f..50022ac 100644
--- a/assets/css/common/main.css
+++ b/assets/css/common/main.css
@@ -28,12 +28,14 @@
}
.social-icons {
- display: flex;
- gap: 1rem;
+ padding: 12px 0;
+}
+
+.social-icons a:not(:last-of-type) {
+ margin-inline-end: 12px;
}
.social-icons a svg {
- display: block;
height: 26px;
width: 26px;
}
From 65c2720ab99368c2125fa39ed1433e0677683b75 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Sat, 16 Dec 2023 13:09:19 +0530
Subject: [PATCH 06/19] lazy load cover images in lists only
---
layouts/_default/list.html | 2 +-
layouts/_default/single.html | 2 +-
layouts/partials/cover.html | 11 ++++++-----
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 833f923..2640f16 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -65,7 +65,7 @@
{{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }}
- {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }}
+ {{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}
{{- $isHidden := (.Param "cover.hiddenInSingle") | default (.Param "cover.hidden") | default false }}
- {{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
+ {{- partial "cover.html" (dict "cxt" . "IsSingle" true "isHidden" $isHidden) }}
{{- if (.Param "ShowToc") }}
{{- partial "toc.html" . }}
{{- end }}
diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html
index 0f8bfbc..e92b555 100644
--- a/layouts/partials/cover.html
+++ b/layouts/partials/cover.html
@@ -1,9 +1,10 @@
{{- with .cxt}} {{/* Apply proper context from dict */}}
{{- if (and .Params.cover.image (not $.isHidden)) }}
{{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }}
+{{- $loading := cond $.IsSingle "eager" "lazy" }}
{{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }}
- {{- $addLink := (and site.Params.cover.linkFullImages (not $.IsHome)) }}
+ {{- $addLink := (and site.Params.cover.linkFullImages $.IsSingle) }}
{{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
{{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
{{- $cover := (or $pageBundleCover $globalResourcesCover)}}
@@ -17,7 +18,7 @@
{{- end -}}
{{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }}
{{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }}
-
{{- else }}{{/* Unprocessable image or responsive images disabled */}}
-
+
{{- end }}
{{- else }}{{/* For absolute urls and external links, no img processing here */}}
{{- if $addLink }}{{ end -}}
-
+
{{- end }}
{{- if $addLink }}{{ end -}}
{{/* Display Caption */}}
- {{- if not $.IsHome }}
+ {{- if $.IsSingle }}
{{ with .Params.cover.caption }}{{ . | markdownify }}
{{- end }}
{{- end }}
From 60984fd13658db175e8945467d3dd799f2fdcc32 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Sat, 16 Dec 2023 14:06:46 +0530
Subject: [PATCH 07/19] Add icon for 'draft' posts
https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aedit_note%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048
LICENSE: https://developers.google.com/fonts/faq#can_i_use_any_font_in_a_commercial_product
---
assets/css/common/post-entry.css | 10 +++++++---
layouts/_default/archives.html | 13 ++++++++++---
layouts/_default/list.html | 11 +++++++++--
layouts/_default/single.html | 11 +++++++++--
4 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/assets/css/common/post-entry.css b/assets/css/common/post-entry.css
index 885aa2a..c3cba37 100644
--- a/assets/css/common/post-entry.css
+++ b/assets/css/common/post-entry.css
@@ -80,13 +80,17 @@
bottom: 0;
}
-.entry-cover,
-.entry-isdraft {
- font-size: 14px;
+.entry-hint {
color: var(--secondary);
}
+.entry-hint-parent {
+ display: flex;
+ justify-content: space-between;
+}
+
.entry-cover {
+ font-size: 14px;
margin-bottom: var(--gap);
text-align: center;
}
diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html
index d2c4d76..b38e39a 100644
--- a/layouts/_default/archives.html
+++ b/layouts/_default/archives.html
@@ -6,7 +6,7 @@
{{- if (.Param "ShowRssButtonInSectionTermList") }}
{{- $rss := (.OutputFormats.Get "rss") }}
{{- if (eq .Kind `page`) }}
- {{- $rss = (.Parent.OutputFormats.Get "rss") }}
+ {{- $rss = (.Parent.OutputFormats.Get "rss") }}
{{- end }}
{{- with $rss }}
@@ -46,9 +46,16 @@
{{- range .Pages }}
{{- if eq .Kind "page" }}
-
+
{{- .Title | markdownify }}
- {{- if .Draft }} [draft]{{- end }}
+ {{- if .Draft }}
+
+
+
+ {{- end }}