Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vaga/hugo-theme-m10c.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien CASTERS <fabien@vaga.io>2021-01-05 16:50:39 +0300
committerFabien <vaga@users.noreply.github.com>2021-01-05 16:57:29 +0300
commit5c7aaea10093505a903a3fd49d247f2545e96b04 (patch)
treee8a9c46e9d48770c88aebd35e1d04d50193dfe4f
parentb3e4d71512169c58ec7d00d14b7d8a29cdc2636c (diff)
improve preformatted text with or without line numbers
-rw-r--r--assets/css/_base.scss6
-rw-r--r--assets/css/components/_post.scss12
-rw-r--r--exampleSite/content/posts/test-1.md24
3 files changed, 39 insertions, 3 deletions
diff --git a/assets/css/_base.scss b/assets/css/_base.scss
index 9848303..d0a3f3f 100644
--- a/assets/css/_base.scss
+++ b/assets/css/_base.scss
@@ -38,13 +38,17 @@ code {
}
pre {
+ font-size: 1rem;
+ line-height: 1.2em;
+ margin: 0;
+ overflow: auto;
+
// A larger monospaced block of text (that isn't mixed with normal text)
// generally looks heavier than normal text with the same font size. For this
// reason using a smaller monospaced font size makes sense in this situation.
code {
font-size: .8em;
}
- overflow: auto;
}
::selection {
diff --git a/assets/css/components/_post.scss b/assets/css/components/_post.scss
index b8265a7..afecccd 100644
--- a/assets/css/components/_post.scss
+++ b/assets/css/components/_post.scss
@@ -3,10 +3,18 @@
}
.post-content {
- pre {
+ & > pre,
+ .highlight {
+ margin: 1em 0;
+ }
+
+ & > pre,
+ .highlight > pre,
+ .highlight > div {
border-left: 0.4em solid rgba($primary-color, .8);
- padding-left: 1em;
+ padding: .5em 1em;
}
+
img {
max-width: 100%;
}
diff --git a/exampleSite/content/posts/test-1.md b/exampleSite/content/posts/test-1.md
index 2b2d622..8675550 100644
--- a/exampleSite/content/posts/test-1.md
+++ b/exampleSite/content/posts/test-1.md
@@ -7,5 +7,29 @@ date = "1012-01-01"
Test 1
I am referencing a footnote[^1]
+```go {linenos=inline}
+package main
+
+import "fmt"
+
+func main() {
+ fmt.Println("{linenos=inline}")
+}
+```
+
+```go {linenos=table}
+package main
+
+import "fmt"
+
+func main() {
+ fmt.Println("{linenos=table}")
+}
+```
+
+```
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis in dictum tortor.
+Morbi laoreet enim id sem euismod lobortis. Donec quam libero, bibendum non cursus vitae, dictum vel eros.
+```
[^1]: I am the footnote