From bd8e03ba6113f544194ae5de7a098a1c6973d681 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Mon, 28 Sep 2020 16:12:52 +0200 Subject: [PATCH 1/5] fix(rss): remove featured image width height attr Throws error when featured image is not found inside page bundle. closes https://github.com/CaiJimmy/hugo-theme-stack/issues/20 --- layouts/rss.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/rss.xml b/layouts/rss.xml index 7ca03dd..178f997 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -34,9 +34,9 @@ {{- $image := partial "helper/image" (dict "Context" . "Type" "rss") -}} {{- if $image.exists -}} - {{ "<" | html }}img src="{{ $image.permalink | absURL }}" width="{{ $image.resource.Width }}" height="{{ $image.resource.Height }}" alt="Featured image of post {{ .Title }}" {{ "/>" | html}} + {{ "<" | html }}img src="{{ $image.permalink | absURL }}" alt="Featured image of post {{ .Title }}" {{ "/>" | html}} {{- end -}}{{ $content }} {{ end }} - \ No newline at end of file + From f92fb41fd73b15ad840f9258f59e9487e7d847f2 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Fri, 2 Oct 2020 00:35:13 +0200 Subject: [PATCH 2/5] doc: update theme.toml --- theme.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme.toml b/theme.toml index a17c4c9..82dbc48 100644 --- a/theme.toml +++ b/theme.toml @@ -5,7 +5,7 @@ name = "Stack" license = "GPL-3.0-only" licenselink = "https://github.com/CaiJimmy/hugo-theme-stack/blob/master/LICENSE" description = "Card-style Hugo theme designed for bloggers" -homepage = "https://blog.jimmycai.com/p/hugo-theme-stack" +homepage = "https://theme-stack.jimmycai.com" tags = [ "blog", "responsive", @@ -24,4 +24,4 @@ min_version = "0.74.0" [author] name = "Jimmy Cai" - homepage = "https://jimmycai.com" \ No newline at end of file + homepage = "https://jimmycai.com" From c2e8d7fc5bd635e5d7134bf41b4d348db71afd87 Mon Sep 17 00:00:00 2001 From: ress <48500247+ress997@users.noreply.github.com> Date: Sun, 4 Oct 2020 05:24:28 +0900 Subject: [PATCH 3/5] fix(config.toml): typo Licenced -> Licensed (#22) --- exampleSite/config.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index cc83511..97df7bb 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -25,7 +25,7 @@ DefaultContentLanguage = "en" # Theme i18n support math = false [params.article.license] enabled = true - default = "Licenced under CC BY-NC-SA 4.0" + default = "Licensed under CC BY-NC-SA 4.0" [params.comments] enabled = true # Only Disqus is available so far @@ -91,4 +91,4 @@ DefaultContentLanguage = "en" # Theme i18n support [markup] [markup.highlight] - noClasses = false \ No newline at end of file + noClasses = false From 1749a9168f559b70ae53cc28e86d429e2100c92a Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 4 Oct 2020 15:58:32 +0200 Subject: [PATCH 4/5] feat: style adjustment --- assets/scss/grid.scss | 2 +- assets/scss/partials/article.scss | 20 ++++++-------------- assets/scss/partials/menu.scss | 10 ++++++++-- assets/scss/partials/sidebar.scss | 19 ++++++++++++------- assets/scss/variables.scss | 5 +++++ 5 files changed, 32 insertions(+), 24 deletions(-) diff --git a/assets/scss/grid.scss b/assets/scss/grid.scss index 1d19067..73fcdfc 100644 --- a/assets/scss/grid.scss +++ b/assets/scss/grid.scss @@ -54,7 +54,7 @@ } @media (min-width: $on-desktop) { - max-width: 1200px; + max-width: 1050px; .left-sidebar { width: 20%; diff --git a/assets/scss/partials/article.scss b/assets/scss/partials/article.scss index 4f2b940..e8b9fcf 100644 --- a/assets/scss/partials/article.scss +++ b/assets/scss/partials/article.scss @@ -75,10 +75,14 @@ } .article-title { - font-size: 2.4rem; font-weight: 600; margin: 10px 0; color: var(--card-text-color-main); + font-size: 2.2rem; + + @media (min-width: $on-desktop-large) { + font-size: 2.4rem; + } a { color: var(--card-text-color-main); @@ -88,14 +92,6 @@ } } - @media (min-width: $on-desktop-large) { - font-size: 2.4rem; - } - - @media (max-width: $on-desktop) { - font-size: 2rem; - } - & + .article-subtitle { margin-top: 0; } @@ -103,18 +99,14 @@ .article-subtitle { font-weight: normal; - font-size: 1.8rem; color: var(--card-text-color-secondary); margin: 5px 0; line-height: 1.5; + font-size: 1.75rem; @media (min-width: $on-desktop-large) { font-size: 2rem; } - - @media (max-width: $on-desktop) { - font-size: 1.6rem; - } } .article-time { diff --git a/assets/scss/partials/menu.scss b/assets/scss/partials/menu.scss index c0d7c0a..5cefeb3 100644 --- a/assets/scss/partials/menu.scss +++ b/assets/scss/partials/menu.scss @@ -126,7 +126,8 @@ list-style: none; display: flex; flex-direction: column; - margin-top: 25px; + margin-top: var(--sidebar-element-separation); + margin-bottom: 0; overflow-y: auto; @media (min-width: $on-desktop-large) { @@ -179,6 +180,11 @@ height: 25px; stroke-width: 1.33; margin-right: 40px; + + @media (max-width: $on-desktop-large) { + width: 20px; + height: 20px; + } } a { @@ -188,7 +194,7 @@ color: var(--body-text-color); font-size: 1.5rem; - @media (max-width: $on-desktop) { + @media (max-width: $on-desktop-large) { font-size: 1.4rem; } } diff --git a/assets/scss/partials/sidebar.scss b/assets/scss/partials/sidebar.scss index ce546fa..8eddafc 100644 --- a/assets/scss/partials/sidebar.scss +++ b/assets/scss/partials/sidebar.scss @@ -12,6 +12,14 @@ flex-direction: column; flex-shrink: 0; + --sidebar-avatar-size: 150px; + --sidebar-element-separation: 25px; + + @media (max-width: $on-desktop-large) { + --sidebar-avatar-size: 120px; + --sidebar-element-separation: 20px; + } + @media (max-width: $on-phone) { width: 100%; padding: 30px 0; @@ -49,6 +57,7 @@ .site-info { z-index: 1; transition: box-shadow 0.5s ease; + @media (max-width: $on-phone) { padding: 15px 30px; } @@ -56,14 +65,10 @@ .site-avatar { position: relative; margin: 0; - margin-bottom: 25px; - width: 150px; - height: 150px; + width: var(--sidebar-avatar-size); + height: var(--sidebar-avatar-size); - @media (max-width: $on-desktop-large) { - height: 120px; - width: 120px; - } + margin-bottom: var(--sidebar-element-separation); .site-logo { width: 100%; diff --git a/assets/scss/variables.scss b/assets/scss/variables.scss index d3ed0ce..14d9e07 100644 --- a/assets/scss/variables.scss +++ b/assets/scss/variables.scss @@ -6,9 +6,14 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff; */ :root { @media (min-width: $on-phone + 1) { + --main-top-padding: 35px; + } + + @media (min-width: $on-desktop-large) { --main-top-padding: 50px; } + --body-background: #f5f5fa; --accent-color: #34495e; From fa0f8fa365296e773fd46e4955f759a5cf80f543 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 4 Oct 2020 15:59:56 +0200 Subject: [PATCH 5/5] feat(gallery): load PhotoSwipe lib from JSDelivr --- assets/ts/gallery.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/ts/gallery.ts b/assets/ts/gallery.ts index b9871ff..41fba8e 100644 --- a/assets/ts/gallery.ts +++ b/assets/ts/gallery.ts @@ -236,10 +236,10 @@ function wrap(gallery: HTMLElement[]) { */ function loadPhotoSwipe() { const tasks = [ - loadScript("https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.js"), - loadScript("https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe-ui-default.min.js"), - loadStyle("https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.css"), - loadStyle("https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/default-skin/default-skin.min.css") + loadScript("https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"), + loadScript("https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"), + loadStyle("https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css"), + loadStyle("https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css") ]; return Promise.all(tasks);