From fb130db4c376574a9000049da9d70ff378017eb6 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Thu, 23 Dec 2021 13:36:05 +0300 Subject: [PATCH 1/3] add anchor headings #123 --- assets/css/main.css | 52 +++++++++++++++++++- layouts/_default/_markup/render-heading.html | 3 ++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 layouts/_default/_markup/render-heading.html diff --git a/assets/css/main.css b/assets/css/main.css index 23df334..a190725 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -341,7 +341,6 @@ article:not(:last-of-type) { padding-bottom: 2em; } - article header h1 { font-size: 1.35em; line-height: 1.1em; @@ -356,6 +355,57 @@ article header h1 a { text-decoration: none; } +.post h1, +.post h2, +.post h3, +.post h4, +.post h5, +.post h6 { + position: relative; +} + +.post h1 a, +.post h2 a, +.post h3 a, +.post h4 a, +.post h5 a, +.post h6 a { + opacity: 0; + position: absolute; + left: -0.7em; + color: var(--font-color); +} + +.post h1:hover a, +.post h2:hover a, +.post h3:hover a, +.post h4:hover a, +.post h5:hover a, +.post h6:hover a { + opacity: 1; +} + +.post h1:hover a:hover, +.post h1:hover a:focus, +.post h1:hover a:active, +.post h2:hover a:hover, +.post h2:hover a:focus, +.post h2:hover a:active, +.post h3:hover a:hover, +.post h3:hover a:focus, +.post h3:hover a:active, +.post h4:hover a:hover, +.post h4:hover a:focus, +.post h4:hover a:active, +.post h5:hover a:hover, +.post h5:hover a:focus, +.post h5:hover a:active, +.post h6:hover a:hover, +.post h6:hover a:focus, +.post h6:hover a:active { + color: var(--link-state-color); +} + .post-info { color: var(--post-info-color); font-size: 0.75em; diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..7e34fa1 --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,3 @@ +{{ .Text | safeHTML }} +# + \ No newline at end of file From a5e44ced3cd23c1a09ed137592f772c30532081a Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Mon, 27 Dec 2021 23:02:57 +0300 Subject: [PATCH 2/3] changed anchor to icon #123 --- assets/css/main.css | 3 ++- layouts/_default/_markup/render-heading.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index a190725..46784e5 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -372,7 +372,7 @@ article header h1 a { .post h6 a { opacity: 0; position: absolute; - left: -0.7em; + left: -1.05rem; color: var(--font-color); } @@ -404,6 +404,7 @@ article header h1 a { .post h6:hover a:focus, .post h6:hover a:active { color: var(--link-state-color); + border-bottom: none; } .post-info { diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 7e34fa1..8a9dbb1 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1,3 +1,3 @@ {{ .Text | safeHTML }} -# + \ No newline at end of file From 5d199f595ee98be3c458570abf9d0572fa4900d5 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Mon, 27 Dec 2021 23:06:21 +0300 Subject: [PATCH 3/3] Revert "changed anchor to icon #123" This reverts commit a5e44ced3cd23c1a09ed137592f772c30532081a. --- assets/css/main.css | 3 +-- layouts/_default/_markup/render-heading.html | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 46784e5..a190725 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -372,7 +372,7 @@ article header h1 a { .post h6 a { opacity: 0; position: absolute; - left: -1.05rem; + left: -0.7em; color: var(--font-color); } @@ -404,7 +404,6 @@ article header h1 a { .post h6:hover a:focus, .post h6:hover a:active { color: var(--link-state-color); - border-bottom: none; } .post-info { diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 8a9dbb1..7e34fa1 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1,3 +1,3 @@ {{ .Text | safeHTML }} - +# \ No newline at end of file