From 967a75b9de099616b8f06da6456fa220462724d4 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 2 Feb 2022 22:27:10 +0100 Subject: [PATCH] fix: fix formatting on feature and code links (#182) --- .markdownlint.yml | 1 + .../content/posts/features/code-blocks.md | 2 +- layouts/_default/_markup/render-link.html | 10 ++++++++-- src/sass/_base.scss | 19 ++++++++++++++----- src/sass/_markdown.scss | 18 ++++++++++++++++++ 5 files changed, 42 insertions(+), 8 deletions(-) diff --git a/.markdownlint.yml b/.markdownlint.yml index b59a114..1a62b25 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -2,5 +2,6 @@ default: True MD013: False MD041: False +MD042: False MD004: style: dash diff --git a/exampleSite/content/posts/features/code-blocks.md b/exampleSite/content/posts/features/code-blocks.md index b49b9ec..6ceed88 100644 --- a/exampleSite/content/posts/features/code-blocks.md +++ b/exampleSite/content/posts/features/code-blocks.md @@ -20,7 +20,7 @@ To display an inline shortcode use single quotes: `some code` ``` -**Example:** `some code` +**Example:** `some code` with a [`link`](#) ## Code blocks diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 2a13b7b..a817ca3 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,8 +1,14 @@ {{- $raw := or (hasPrefix .Text "{{ .Text | safeHTML }} + {{- .Text | safeHTML -}} + {{- /* Drop trailing newlines */ -}} diff --git a/src/sass/_base.scss b/src/sass/_base.scss index 92b3eae..fa66101 100644 --- a/src/sass/_base.scss +++ b/src/sass/_base.scss @@ -312,7 +312,7 @@ img { } &__readmore { - margin: 1.5rem 0 $padding-32 0; + margin: $padding-16 0; a:visited { color: var(--link-color); @@ -369,20 +369,29 @@ img { } span { - background: rgba($gray-900, 0.8); + background: $gray-800; position: absolute; bottom: 0; right: 0; - padding: $padding-4; + padding: $padding-4 $padding-8; font-size: 0.8em; color: $gray-100; border-radius: $border-radius 0; } - a:hover, + a { + text-decoration: none; + color: $link-color-dark; + } + + a:hover { + text-decoration: underline; + background: none; + } + a:visited, a:visited:hover { - color: $gray-100 !important; + color: $link-color-dark; } } diff --git a/src/sass/_markdown.scss b/src/sass/_markdown.scss index 7d1091c..1fbbb87 100644 --- a/src/sass/_markdown.scss +++ b/src/sass/_markdown.scss @@ -62,6 +62,24 @@ } } + &__link--code { + text-decoration: none; + code { + color: inherit !important; + } + + &:hover { + background: none; + color: var(--link-color) !important; + text-decoration: underline; + } + + &:visited, + &:visited:hover { + color: var(--link-color-visited) !important; + } + } + img { max-width: 100%; border-radius: $border-radius;