From 6ec37a92be5fb1a026d2faf51ce5b03cb5fde0b3 Mon Sep 17 00:00:00 2001 From: "kirill.chalov" Date: Thu, 22 Aug 2024 14:19:00 +0800 Subject: [PATCH 1/2] Revert "feat: Add link back to parent page on the sidebar" This reverts commit c27f19f573c122c84993abf9abca3ce1b3d7ab7b. --- layouts/_default/single.html | 2 +- layouts/partials/back-to-parent.html | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 layouts/partials/back-to-parent.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e407398f..5d40ae05 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -67,7 +67,7 @@

lg:top-[140px]{{ else }}lg:top-10{{ end }}"> {{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in - .TableOfContents " {{ end }} diff --git a/layouts/partials/back-to-parent.html b/layouts/partials/back-to-parent.html deleted file mode 100644 index 8c933c33..00000000 --- a/layouts/partials/back-to-parent.html +++ /dev/null @@ -1,6 +0,0 @@ -
-{{ with .Parent }} - Back to {{ .Title }} -{{ end }} -
From 3f58a7a1a21a247388953e1b2b96a4f95b8240e3 Mon Sep 17 00:00:00 2001 From: "kirill.chalov" Date: Thu, 22 Aug 2024 18:47:15 +0800 Subject: [PATCH 2/2] feat: improve page layout --- assets/css/custom.css | 21 +++++++++++++++++++++ config/_default/hugo.toml | 2 +- config/_default/params.toml | 2 +- layouts/partials/head.html | 2 ++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 assets/css/custom.css diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 00000000..b5d41127 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,21 @@ +/* This makes text in code blocks smaller than body text */ +.highlight, code { + font-size: 0.85rem; +} + +/* This makes text in TOC smaller than body text */ +#TableOfContents li { + font-size: 0.85rem; +} + +/* This reduces font in article summaries */ +.py-1 { + font-size: 0.85rem; + font-weight: 400; +} + +/* For bullet points to stand out in a list, the line heights inside and + between bullet points should differ. This reduces the inside height */ + li { + line-height: 1.65; +} diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index 3069eca6..751cc7f9 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -10,7 +10,7 @@ defaultContentLanguage = "en" enableRobotsTXT = true paginate = 100 -summaryLength = 30 +summaryLength = 15 buildDrafts = false buildFuture = false diff --git a/config/_default/params.toml b/config/_default/params.toml index fff74c95..c8fcf6a1 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -88,7 +88,7 @@ smartTOCHideUnfocusedChildren = false layoutBackgroundBlur = true # only used when heroStyle equals background layoutBackgroundHeaderSpace = false showBreadcrumbs = false - showSummary = false + showSummary = true showViews = true showLikes = true showTableOfContents = true diff --git a/layouts/partials/head.html b/layouts/partials/head.html index cd61e0a6..fcd6fb03 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -47,6 +47,8 @@ {{ end }} {{ $bundleCSS := $assets.Get "css" | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint "sha512" }} + {{ $cssCustom := resources.Get "css/custom.css" }} + {{ $jsAppearance := resources.Get "js/appearance.js" }}