website

Personal website
git clone https://github.com/michaelneuper/website.git
README | Files | Log | Refs

commit 9b7b8a9a2ed82aad27b71655ac3cd90b2095144d
parent ac7b306d030dcc59ec9ef75206a61019ea7f4238
Author: Michael Neuper <michael@michaelneuper.com>
Date:   Fri,  3 Nov 2023 18:01:26 +0200

Run postCSS on all css

Diffstat:
Aassets/css/common.css | 198+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aassets/css/content.css | 231+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aassets/css/index.css | 41+++++++++++++++++++++++++++++++++++++++++
Aassets/css/list.css | 25+++++++++++++++++++++++++
Aassets/css/single.css | 40++++++++++++++++++++++++++++++++++++++++
Mlayouts/_default/baseof.html | 8++++++--
Mlayouts/_default/list.html | 4+++-
Mlayouts/_default/single.html | 5+++--
Mlayouts/index.html | 4+++-
9 files changed, 550 insertions(+), 6 deletions(-)

diff --git a/assets/css/common.css b/assets/css/common.css @@ -0,0 +1,198 @@ +/* fonts */ + +@font-face { + font-display: swap; + font-family: 'Latin Modern Mono'; + font-style: normal; + font-weight: bold; + src: url('../font/lmmono-bold.woff'); +} + +@font-face { + font-display: swap; + font-family: 'Latin Modern Mono'; + font-style: italic; + font-weight: bold; + src: url('../font/lmmono-bolditalic.woff'); +} + +@font-face { + font-display: swap; + font-family: 'Latin Modern Mono'; + font-style: italic; + font-weight: normal; + src: url('../font/lmmono-italic.woff'); +} + +@font-face { + font-display: swap; + font-family: 'Latin Modern Mono'; + font-style: normal; + font-weight: normal; + src: url('../font/lmmono-normal.woff'); +} + +@font-face { + font-display: swap; + font-family: 'Latin Modern Roman'; + font-style: normal; + font-weight: bold; + src: url('../font/lmroman-bold.woff'); +} + +@font-face { + font-display: swap; + font-family: 'Latin Modern Roman'; + font-style: italic; + font-weight: bold; + src: url('../font/lmroman-bolditalic.woff'); +} + +@font-face { + font-display: swap; + font-family: 'Latin Modern Roman'; + font-style: italic; + font-weight: normal; + src: url('../font/lmroman-italic.woff'); +} + +@font-face { + font-display: swap; + font-family: 'Latin Modern Roman'; + font-style: normal; + font-weight: normal; + src: url('../font/lmroman-normal.woff'); +} + +/* global */ + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +a { + color: inherit; + text-decoration: none; +} + +time { + color: gray; + margin-left: 1rem; + min-width: 5rem; +} + +#wrapper { + background-color: #FAFAFA; + display: flex; + flex-direction: column; + font-family: 'Latin Modern Roman', 'Times New Roman', serif; + min-height: 100vh; + overflow-wrap: break-word; + padding: 1rem; +} + +.link { + color: #AA0000; + text-decoration: underline; +} + +.paginator { + align-items: flex-end; + display: flex; + flex-direction: row; + justify-content: space-between; + margin-top: 2rem; +} + +::-webkit-scrollbar { + background-color: #FAFAFA; + height: 8px; + width: 8px; +} + +::-webkit-scrollbar-thumb { + background-color: #AAAAAA; +} + +::-webkit-scrollbar-thumb:hover { + background-color: #888888; +} + +/* header */ + +#header { + align-items: center; + display: flex; + flex-direction: column; +} + +#header > h1 { + text-align: center; +} + +@media screen and (min-width: 768px) { + #header > h1 { + font-size: 2.8rem; + } +} + +#header > nav { + display: flex; + flex-direction: row; + justify-content: space-around; + flex-wrap: wrap; + max-width: 768px; + width: 100%; +} + +#header > nav > span > a { + font-size: 1.2rem; +} + +/* main */ + +#main { + align-self: center; + display: flex; + flex-direction: column; + flex-grow: 1; + max-width: 768px; + padding: 2rem 0; + width: calc(100% - 2rem); +} + +/* footer */ + +#footer { + align-items: center; + display: flex; + font-size: .9rem; + flex-direction: column;; +} + +#footer > .footnote { + text-align: center; +} + +#sharingbuttons { + align-items: center; + display: flex; + flex-direction: row; + justify-content: space-between; + margin-top: 1rem; + flex-wrap: wrap; +} + +#searchbox { + align-items: center; + display: flex; + flex-direction: row; + justify-content: space-between; + margin-top: 1rem; +} + +#searchbox > #search > input { + font-size: 1.2rem; +} diff --git a/assets/css/content.css b/assets/css/content.css @@ -0,0 +1,231 @@ +.content .MathJax { + font-size: 100%!important; + overflow-x: auto; + overflow-y: hidden; +} + +.content .katex { + font-size: 100%!important; + overflow-x: auto; + overflow-y: hidden; +} + +.content :last-child { + margin-bottom: 0; +} + +.content a { + color: #AA0000; + text-decoration: underline; +} + +.content a.footnote-ref::before { + content: "["; +} + +.content a.footnote-ref::after { + content: "]"; +} + +.content blockquote, +.content div, +.content h1, +.content h2, +.content h3, +.content h4, +.content h5, +.content h6, +.content p, +.content pre, +.content ol, +.content table, +.content ul { + margin-bottom: 1rem; +} + +.content blockquote { + border-left: black 2px solid; + font-style: italic; + padding: 1rem 0 1rem 2rem; +} + +.content code { + background-color: #F5F5F5; + border-radius: .2rem; + color: #AA0000; + font-family: 'Latin Modern Mono', Courier, monospace; + padding: 0 .2rem; +} + +.content h1, .content h2, .content h3, +.content h4, .content h5, .content h6 { + line-height: 1.5; +} + +.content h1 { + font-size: 2.4rem; +} + +.content h2 { + font-size: 1.8rem; +} + +.content h3 { + font-size: 1.4rem; +} + +.content h4 { + font-size: 1.2rem; +} + +.content h5 { + font-size: 1.1rem; +} + +.content h6 { + font-size: 1rem; +} + +.content img { + max-width: 100%; +} + +.content p { + text-align: justify; +} + +.content pre { + background-color: #F5F5F5!important; + border-radius: .2rem; + font-family: 'Latin Modern Mono', Courier, monospace; + margin-top: .5rem; + overflow-x: auto; + padding: .5rem; +} + +.content pre code { + padding: 0; +} + +.content strong.chinese { + font-weight: normal; + text-emphasis-style: dot; + text-emphasis-position: under; + -webkit-text-emphasis-style: dot; + -webkit-text-emphasis-position: under; +} + +.content table { + display: block; + overflow-x: auto; +} + +.content td, .content th { + border: #575C61 1px solid; + padding: .1rem .5rem; +} + +.content th { + background-color: #575C61; + color: #FAFAFA; +} + +.content ol, .content ul { + margin-left: 1.5rem; +} + +.content.numbered-subtitles { + counter-reset: section-h2; +} + +.content.numbered-subtitles h2 { + counter-reset: section-h3; +} + +.content.numbered-subtitles h2:before { + counter-increment: section-h2; + content: counter(section-h2) " "; +} + +.content.numbered-subtitles h3 { + counter-reset: section-h4; +} + +.content.numbered-subtitles h3:before { + counter-increment: section-h3; + content: counter(section-h2) "." counter(section-h3) " "; +} + +.content.numbered-subtitles h4 { + counter-reset: section-h5; +} + +.content.numbered-subtitles h4:before { + counter-increment: section-h4; + content: counter(section-h2) "." counter(section-h3) "." counter(section-h4) " "; +} + +.content.numbered-subtitles h5 { + counter-reset: section-h6; +} + +.content.numbered-subtitles h5:before { + counter-increment: section-h5; + content: counter(section-h2) "." counter(section-h3) "." counter(section-h4) "." counter(section-h5) " "; +} + +.content.numbered-subtitles h6:before { + counter-increment: section-h6; + content: counter(section-h2) "." counter(section-h3) "." counter(section-h4) "." counter(section-h5) "." counter(section-h6) " "; +} + + + + + + + +.toc.numbered-subtitles { + counter-reset: ul-h2; +} + +.toc.numbered-subtitles li { + counter-reset: ul-h3; +} + +.toc.numbered-subtitles li:before { + counter-increment: ul-h2; + content: counter(ul-h2) " "; +} + +.toc.numbered-subtitles li li { + counter-reset: ul-h4; +} + +.toc.numbered-subtitles li li:before { + counter-increment: ul-h3; + content: counter(ul-h2) "." counter(ul-h3) " "; +} + +.toc.numbered-subtitles li li li { + counter-reset: ul-h5; +} + +.toc.numbered-subtitles li li li:before { + counter-increment: ul-h4; + content: counter(ul-h2) "." counter(ul-h3) "." counter(ul-h4) " "; +} + +.toc.numbered-subtitles li li li li { + counter-reset: ul-h6; +} + +.toc.numbered-subtitles li li li li:before { + counter-increment: ul-h5; + content: counter(ul-h2) "." counter(ul-h3) "." counter(ul-h4) "." counter(ul-h5) " "; +} + +.toc.numbered-subtitles li li li li li:before { + counter-increment: ul-h6; + content: counter(ul-h2) "." counter(ul-h3) "." counter(ul-h4) "." counter(ul-h5) "." counter(ul-h6) " "; +} diff --git a/assets/css/index.css b/assets/css/index.css @@ -0,0 +1,41 @@ +#main > .post + .post { + margin-top: 2rem; +} + +#main > .post > h2 { + align-items: center; + display: flex; + flex-direction: row; + justify-content: space-between; + flex-wrap: wrap; +} + +#main > .post > h2 > div { + align-items: center; + display: flex; + flex-direction: row; + justify-content: flex-end; +} + +#main > .post > h2 > div > time { + font-size: 1rem; + font-weight: normal; + justify-self: flex-end; +} + +#main > .post > h2 > div > span { + font-size: 1rem; + font-weight: normal; + color: gray; + margin-left: 1rem; +} + +#main > .post > .content { + padding-top: 1rem; +} + +@media screen and (min-width: 768px) { + #main > .post > div { + margin-left: 2rem; + } +} diff --git a/assets/css/list.css b/assets/css/list.css @@ -0,0 +1,25 @@ +#main > .post-group > ul { + border-left: gray solid 1px; + list-style-type: none; + margin-left: .5rem; + padding-left: 1rem; +} + +#main > .post-group > ul > li { + align-items: center; + display: flex; + flex-direction: row; + justify-content: space-between; + line-height: 1.6; +} + +#main > .post-group > ul > li > time { + text-align: right; +} + +@media screen and (min-width: 768px) { + #main > .post-group > ul { + margin-left: 1rem; + padding-left: 2rem; + } +} diff --git a/assets/css/single.css b/assets/css/single.css @@ -0,0 +1,40 @@ +#main > h1 { + text-align: center; +} + +#main > .content { + padding-top: 1rem; +} + +#main > .warning { + background-color: brown; + color: white; + font-size: 1.1rem; + margin: 2rem 0; + padding: 1rem 0; + text-align: center; +} + +#main .toc { + background-color: #EEEEEE; + border: black 1px dashed; + display: inline-block; + margin: 1rem; + padding: .5rem 1rem; +} + +#main .toc a:hover { + text-decoration: underline; +} + +#main .toc li > ul { + margin-left: 1.5rem; +} + +#main .toc ul { + list-style: none; +} + +#main :target { + background-color: azure; +} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html @@ -53,8 +53,12 @@ {{ template "_internal/schema.html" . }} <!-- style --> - <link media="screen" rel="stylesheet" href='{{ "css/common.css" | absURL }}'> - <link media="screen" rel="stylesheet" href='{{ "css/content.css" | absURL }}'> + {{ with resources.Get "css/common.css" | postCSS }} + <link rel="stylesheet" href="{{ .RelPermalink }}"> + {{ end }} + {{ with resources.Get "css/content.css" | postCSS }} + <link rel="stylesheet" href="{{ .RelPermalink }}"> + {{ end }} <!-- title --> {{ if .IsHome }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html @@ -1,5 +1,7 @@ {{ define "head" }} -<link rel="stylesheet" href='{{ "css/list.css" | absURL }}'> +{{ with resources.Get "css/list.css" | postCSS }} + <link rel="stylesheet" href="{{ .RelPermalink }}"> +{{ end }} {{ end }} {{ define "main" }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html @@ -1,6 +1,7 @@ {{ define "head" }} -<link rel="stylesheet" href='{{ "css/single.css" | absURL }}'> -<link rel="stylesheet" href='{{ "css/sharingbuttons.css" | absURL }}'> +{{ with resources.Get "css/single.css" | postCSS }} + <link rel="stylesheet" href="{{ .RelPermalink }}"> +{{ end }} {{ end }} {{ define "main" }} diff --git a/layouts/index.html b/layouts/index.html @@ -1,5 +1,7 @@ {{ define "head" }} -<link rel="stylesheet" href='{{ "css/index.css" | absURL }}'> +{{ with resources.Get "css/index.css" | postCSS }} + <link rel="stylesheet" href="{{ .RelPermalink }}"> +{{ end }} {{ end }} {{ define "main" }}