From 42e02fa00444d7f4c62f3adc5bf7e5351835aa68 Mon Sep 17 00:00:00 2001 From: kentnek Date: Tue, 23 Jun 2020 23:43:04 +0800 Subject: [PATCH 1/3] enable raw HTML by default and add some styling --- assets/scss/pages/post.scss | 16 ++++++++++++++++ assets/scss/partials/_colors.scss | 2 ++ assets/scss/partials/_typography.scss | 4 ++++ exampleSite/config.toml | 4 ++++ 4 files changed, 26 insertions(+) diff --git a/assets/scss/pages/post.scss b/assets/scss/pages/post.scss index f6fc4187..c548f5f5 100644 --- a/assets/scss/pages/post.scss +++ b/assets/scss/pages/post.scss @@ -1,5 +1,6 @@ @import '../main'; @import '../partials/github-syntax-highlighting'; +@import '../partials/colors'; .post { width: 100%; @@ -236,3 +237,18 @@ footer { margin: 1.5rem auto !important; width: 375px !important; } + +table { + max-width: 100%; + border-spacing: 0; + + thead { + background: $lightGrey; + } + + th, + td { + padding: 0.5em 1em; + border: 1px double $greyTableBorder; + } +} diff --git a/assets/scss/partials/_colors.scss b/assets/scss/partials/_colors.scss index fd1ccba7..bfe1b52b 100644 --- a/assets/scss/partials/_colors.scss +++ b/assets/scss/partials/_colors.scss @@ -1,4 +1,6 @@ $black: #111; +$lightGrey: #F7F7F7; +$greyTableBorder: #EEEEEE; $grey: #9B9B9B; $darkGrey: #717171; $white: #fff; diff --git a/assets/scss/partials/_typography.scss b/assets/scss/partials/_typography.scss index 0619c000..b8444cdf 100644 --- a/assets/scss/partials/_typography.scss +++ b/assets/scss/partials/_typography.scss @@ -117,3 +117,7 @@ pre code { .lead { font-size: $scale * 1rem; } + +abbr[title] { + text-decoration: underline double; +} diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 083c82c2..d96e0992 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -41,6 +41,10 @@ themesDir = "../../" [markup] [markup.highlight] codeFences = false + + # Set to false to disallow raw HTML in markdown files + [markup.goldmark.renderer] + unsafe = true # Controls the navigation [[menu.main]] From 9b625b55a351a6531b92579bbe9dd8ed5a1d2929 Mon Sep 17 00:00:00 2001 From: kentnek Date: Wed, 24 Jun 2020 00:19:05 +0800 Subject: [PATCH 2/3] modify blockquote style --- assets/scss/partials/_typography.scss | 27 +++++++++++++++++++-- exampleSite/content/blog/markdown-syntax.md | 8 ++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/assets/scss/partials/_typography.scss b/assets/scss/partials/_typography.scss index b8444cdf..367cb580 100644 --- a/assets/scss/partials/_typography.scss +++ b/assets/scss/partials/_typography.scss @@ -72,11 +72,34 @@ ol { } blockquote { + &::before { + position: absolute; + content: '\201C'; + + font-size: 6em; + font-family: 'Roboto', serif; + margin-top: 0.10em;; + margin-left: -0.2em; + + z-index: -1; + color: darken($white, 7%); + } + margin-top: $leading; margin-bottom: $leading; line-height: $leading; - color: $darkGrey; - font-style: italic; + color: $black; + + cite { + &::before { + content: "— " + } + + font-style: italic; + font-size: .95em; + color: $darkGrey; + } + } pre { diff --git a/exampleSite/content/blog/markdown-syntax.md b/exampleSite/content/blog/markdown-syntax.md index f6672a49..c796a6c4 100644 --- a/exampleSite/content/blog/markdown-syntax.md +++ b/exampleSite/content/blog/markdown-syntax.md @@ -38,6 +38,14 @@ The blockquote element represents content that is quoted from another source, op > Tiam, ad mint andaepu dandae nostion secatur sequo quae. > **Note** that you can use *Markdown syntax* within a blockquote. +#### Blockquote with attribution + +> Simplicity is the ultimate sophistication. +> — Leonardo da Vinci[^1] + +[^1]: The above quote is often attributed to Leonardo da Vinci but there is no concrete evidence to support this. + + ## Tables Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. From 8e032ada3a744be1ec10d775c2290d02d3b8ec9c Mon Sep 17 00:00:00 2001 From: kentnek Date: Wed, 24 Jun 2020 00:20:59 +0800 Subject: [PATCH 3/3] fix cite example --- exampleSite/content/blog/markdown-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exampleSite/content/blog/markdown-syntax.md b/exampleSite/content/blog/markdown-syntax.md index c796a6c4..8f71882d 100644 --- a/exampleSite/content/blog/markdown-syntax.md +++ b/exampleSite/content/blog/markdown-syntax.md @@ -41,7 +41,7 @@ The blockquote element represents content that is quoted from another source, op #### Blockquote with attribution > Simplicity is the ultimate sophistication. -> — Leonardo da Vinci[^1] +> Leonardo da Vinci[^1] [^1]: The above quote is often attributed to Leonardo da Vinci but there is no concrete evidence to support this.