commit 063f2bb49a5726299c28c7fe099f091b4ca14b71 Author: mivinci <1366723936@qq.com> Date: Sun Jul 18 16:34:01 2021 +0800 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e4483e2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2021 YOUR_NAME_HERE + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..43cb493 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Minima + +A Clean and minimal Hugo theme porting from Minima on Hexo. + +## Features + +- [x] light/dark mode +- [x] Hightlight +- [x] Comments +- [x] LaTeX + +## Usage + +Writing... + diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..a845151 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/data/svg.toml b/data/svg.toml new file mode 100644 index 0000000..8496be2 --- /dev/null +++ b/data/svg.toml @@ -0,0 +1,4 @@ +github = 'GitHub' +linkedin = 'LinkedIn' +twitter = 'Twitter' +rss = '' \ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml new file mode 100644 index 0000000..f6c884f --- /dev/null +++ b/exampleSite/config.toml @@ -0,0 +1,60 @@ +baseURL = "http://example.org" +languageCode = "en-us" +title = "Hi Folks" +copyright = "© Copyright notice" +theme = "minima" +paginate = 5 +googleAnalytics = "" +disqusShortname = "" + +[author] +name = "XJJ" +slogon = "A student and web developer from Earth 🌍" +description = "This is Minima, a clean and minimal Hugo theme porting from Minima on Hexo. It not only inherits everything from Hexo Minima like dark/light mode but intgrated KaTeX and some taxonomies like categories, series and tags. I created this from scratch using pure CSS and Vanilla JS without using unnecessary development packs! 😁" + +[params] +subtitle = "" +recent_posts = 5 + +[[params.social]] +name = "github" +url = "" +[[params.social]] +name = "linkedin" +url = "" +[[params.social]] +name = "twitter" +url = "" +[[params.social]] +name = "rss" +url = "/index.xml" + + + +[[menu.main]] +name = "Home" +url = "/" +weight = 1 +[[menu.main]] +name = "Categories" +url = "/categories" +weight = 2 +[[menu.main]] +name = "Series" +url = "/series" +weight = 3 +[[menu.main]] +name = "About" +url = "/about" +weight = 5 + +[taxonomies] +category = "categories" +tag = "tags" +series = "series" + +# Better not edit this +[markup.highlight] +lineNos = true +noClasses = false + \ No newline at end of file diff --git a/exampleSite/content/about.md b/exampleSite/content/about.md new file mode 100644 index 0000000..29cbfc6 --- /dev/null +++ b/exampleSite/content/about.md @@ -0,0 +1,7 @@ +--- +title: "About" +date: 2021-07-18T11:24:06+08:00 +draft: true +type: about +--- + diff --git a/exampleSite/content/emoji-support.md b/exampleSite/content/emoji-support.md new file mode 100644 index 0000000..2ae067d --- /dev/null +++ b/exampleSite/content/emoji-support.md @@ -0,0 +1,46 @@ ++++ +author = "Hugo Authors" +title = "Emoji Support" +date = "2021-07-18T10:52:59+08:00" +description = "Guide to emoji usage in Hugo" +tags = [ + "emoji", +] ++++ + +Emoji can be enabled in a Hugo project in a number of ways. + +The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). + +To enable emoji globally, set `enableEmoji` to `true` in your site's [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. + +

🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:

+
+ +The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. + +*** + +**N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g. + +{{< highlight html >}} +.emoji { + font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols; +} +{{< /highlight >}} + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/exampleSite/content/markdown-syntax.md b/exampleSite/content/markdown-syntax.md new file mode 100644 index 0000000..710caf7 --- /dev/null +++ b/exampleSite/content/markdown-syntax.md @@ -0,0 +1,148 @@ ++++ +author = "Hugo Authors" +title = "Markdown Syntax Guide" +date = "2021-07-18T10:52:59+08:00" +description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." +tags = [ + "markdown", + "css", + "html", +] +categories = [ + "themes", + "syntax", +] +series = ["Themes Guide"] +aliases = ["migrate-from-jekyl"] ++++ + +This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. + + +## Headings + +The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. + +# H1 +## H2 +### H3 +#### H4 +##### H5 +###### H6 + +## Paragraph + +Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. + +Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. + +## Blockquotes + +The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. + +#### Blockquote without attribution + +> Tiam, ad mint andaepu dandae nostion secatur sequo quae. +> **Note** that you can use *Markdown syntax* within a blockquote. + +#### Blockquote with attribution + +> Don't communicate by sharing memory, share memory by communicating.
+> — Rob Pike[^1] + +[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. + +## Tables + +Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. + + Name | Age +--------|------ + Bob | 27 + Alice | 23 + +#### Inline Markdown within tables + +| Italics | Bold | Code | +| -------- | -------- | ------ | +| *italics* | **bold** | `code` | + +## Code Blocks + +#### Code block with backticks + +```html + + + + + Example HTML5 Document + + +

Test

+ + +``` + +#### Code block indented with four spaces + + + + + + Example HTML5 Document + + +

Test

+ + + +#### Code block with Hugo's internal highlight shortcode +{{< highlight html >}} + + + + + Example HTML5 Document + + +

Test

+ + +{{< /highlight >}} + +## List Types + +#### Ordered List + +1. First item +2. Second item +3. Third item + +#### Unordered List + +* List item +* Another item +* And another item + +#### Nested list + +* Fruit + * Apple + * Orange + * Banana +* Dairy + * Milk + * Cheese + +## Other Elements — abbr, sub, sup, kbd, mark + +GIF is a bitmap image format. + +H2O + +Xn + Yn = Zn + +Press CTRL+ALT+Delete to end the session. + +Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. diff --git a/exampleSite/content/math-typesetting.md b/exampleSite/content/math-typesetting.md new file mode 100644 index 0000000..f3d7e1d --- /dev/null +++ b/exampleSite/content/math-typesetting.md @@ -0,0 +1,49 @@ +--- +author: Hugo Authors +title: Math Typesetting +date: 2021-07-18T10:52:59+08:00 +description: A brief guide to setup KaTeX +math: true +--- + +Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. + + +In this example we will be using [KaTeX](https://katex.org/) + +- Create a partial under `/layouts/partials/math.html` +- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. +- Include the partial in your templates like so: + +```bash +{{ if or .Params.math .Site.Params.math }} +{{ partial "math.html" . }} +{{ end }} +``` + +- To enable KaTex globally set the parameter `math` to `true` in a project's configuration +- To enable KaTex on a per page basis include the parameter `math: true` in content files + +**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) + +{{< math.inline >}} +{{ if or .Page.Params.math .Site.Params.math }} + + + + +{{ end }} +{{}} + +### Examples + +{{< math.inline >}} +

+Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) +

+{{}} + +Block math: +$$ + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } +$$ diff --git a/exampleSite/content/placeholder-text.md b/exampleSite/content/placeholder-text.md new file mode 100644 index 0000000..238252c --- /dev/null +++ b/exampleSite/content/placeholder-text.md @@ -0,0 +1,45 @@ ++++ +author = "Hugo Authors" +title = "Placeholder Text" +date = "2021-07-18T10:52:59+08:00" +description = "Lorem Ipsum Dolor Si Amet" +tags = [ + "markdown", + "text", +] ++++ + +Lorem est tota propiore conpellat pectoribus de pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. + +1. Exierant elisi ambit vivere dedere +2. Duce pollice +3. Eris modo +4. Spargitque ferrea quos palude + +Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis. + +1. Comas hunc haec pietate fetum procerum dixit +2. Post torum vates letum Tiresia +3. Flumen querellas +4. Arcanaque montibus omnes +5. Quidem et + +# Vagus elidunt + + + +[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) + +## Mane refeci capiebant unda mulcebat + +Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. + +Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et. + +Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**. + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/images/screenshot-dark.png b/images/screenshot-dark.png new file mode 100644 index 0000000..2500d90 Binary files /dev/null and b/images/screenshot-dark.png differ diff --git a/images/screenshot.png b/images/screenshot.png new file mode 100644 index 0000000..d9013c5 Binary files /dev/null and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png new file mode 100644 index 0000000..29d318e Binary files /dev/null and b/images/tn.png differ diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..41351ec --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,11 @@ + + +{{ partial "head.html" . }} + + {{ partial "header.html" . }} + + {{ block "main" . }} {{ end }} + + {{ partial "footer.html" . }} + + \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..b9f8629 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} +
+ {{ if isset .Data "Term" }} +

{{ .Data.Singular | title }} - "{{ .Data.Term }}"

+ {{ else }} + + {{ end }} +
+ {{ range .Data.Pages }} +
+
{{ dateFormat "Jan 2, 2006" .Date }}
+ {{ .Title }} +
+ {{ end }} +
+
+{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..330373e --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,24 @@ +{{ define "main" }} +
+

{{ .Title }}

+
+ Posted at — {{ dateFormat "Jan 2, 2006" .Date }} + {{ if .Draft }} + + DRAFT + + {{ end }} +
+

{{ .Description }}

+
+ {{ .Content }} +
+
+{{ if or .Params.math .Site.Params.math }} +{{ partial "math.html" . }} +{{ end }} +{{ if .Params.disqus }} +{{ partial "disqus.html" . }} +{{ end }} +{{ end }} + diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..8c37f00 --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,14 @@ +{{ define "main" }} +
+

{{ .Title }}

+ +
+{{ end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..2665888 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,22 @@ +{{ define "main" }} +
+

I am {{ .Site.Author.name }}

+

{{ .Site.Author.slogon }}

+

{{ .Site.Author.description }}

+ {{ if eq .Paginator.PageNumber 1 }} +

Recent Posts

+ {{ else }} +

All Posts

+ {{ end }} +
+ {{ $paginator := .Paginate (where .Site.RegularPages "Kind" "page") }} + {{ range $paginator.Pages }} +
+
{{ dateFormat "Jan 2, 2006" .Date }}
+ {{ .Title }} +
+ {{ end }} + {{ partial "paginator.html" . }} +
+
+{{ end }} \ No newline at end of file diff --git a/layouts/index.xml b/layouts/index.xml new file mode 100644 index 0000000..3a97292 --- /dev/null +++ b/layouts/index.xml @@ -0,0 +1,39 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo -- gohugo.io{{ with .Site.LanguageCode }} + {{.}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ .Summary | html }} + + {{ end }} + + \ No newline at end of file diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html new file mode 100644 index 0000000..14de1c0 --- /dev/null +++ b/layouts/partials/disqus.html @@ -0,0 +1,16 @@ +
+ + \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..4cf04ae --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..7cefbf6 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,37 @@ + + + + {{ template "_internal/opengraph.html" . }} + {{ template "_internal/twitter_cards.html" . }} + {{ template "_internal/google_analytics.html" . }} + + + + {{ if .IsHome }} + {{ .Site.Title }} {{ if .Site.Params.subtitle }} - {{ .Site.Params.subtitle }} {{ end }} + {{ else }} + {{ .Site.Title }} - {{ .Title }} + {{ end }} + + {{ $favicon := "favicon.ico" }} + + + + + + + + + + + \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..f962a9a --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,12 @@ +
+

+
+ {{ .Site.Title }} +

+ +
+
\ No newline at end of file diff --git a/layouts/partials/math.html b/layouts/partials/math.html new file mode 100644 index 0000000..521bfeb --- /dev/null +++ b/layouts/partials/math.html @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/layouts/partials/paginator.html b/layouts/partials/paginator.html new file mode 100644 index 0000000..64c9e61 --- /dev/null +++ b/layouts/partials/paginator.html @@ -0,0 +1,10 @@ +{{ $page := $.Paginator }} +{{ if gt $page.TotalPages 1 }} +
+ {{ if $page.HasNext }} + Older → + {{ else }} + ← Newer + {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/static/css/main.css b/static/css/main.css new file mode 100644 index 0000000..23f9b6b --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,223 @@ +:root { + --pm: #0fa0ce; + --bd: #e1e1e1; + --bg: #fff; + --ft: #222; + --tag: #333; + + --w-mobile: 640px; +} + +html.dark { + --bg: #262d33; + --ft: #eee; + --bd: #555; + --tag: #999; +} + +body { + font-family: Helvetica, sans-serif; + max-width: var(--w-mobile); + margin: 50px auto 0; + font-size: 16px; + font-weight: 400; + color: var(--ft); + background-color: var(--bg); + transition-property: background-color, border-color, color; + transition-duration: .5s; +} + +h1,h2,h3,h4,h5 { + font-family: 'Noto Serif SC', 'Times New Roman', sans-serif; + font-weight: 700; + line-height: 1.5; +} + +p { + margin-top: 0; + line-height: 1.5; + text-align: left; +} + +hr { + margin: 30px 0; + border-width: 0; + border-top: 1px solid var(--bd); +} + +a { + text-decoration: none; +} + +a:not(.icon) { + color: inherit; + text-decoration: underline; + text-decoration-color: var(--pm); + background-image: linear-gradient( to bottom, rgba(0, 0, 0, 0) 50%, var(--pm) 50% ); + background-size: 100% 200%; + transition: background-position .2s ease-in-out; +} + +a:not(.icon):hover, +a:not(.icon):focus { + background-position: 0 100%; + color: #fff; +} + +.icon:hover { + transform: translateY(-5px); + transition: transform .3s ease-in-out; +} + +main { + animation: showup 0.7s; +} + +.row { + display: flex; + align-items: center; +} + +.col { + display: flex; + flex-direction: column; +} + +.jc-bt { + justify-content: space-between; +} + +.as-s { + align-self: start; +} + +.ai-c { + align-items: center; +} + +.gap-0_5 { + gap: .8rem; +} + +.gap-1 { + gap: 1rem; +} + +.gap-2 { + gap: 2rem; +} + +.gap-3 { + gap: 3rem; +} + +.lg-1 { + font-size: 1.2em; +} + +.sm-1 { + font-size: .8em; +} + +.mtb-1 { + margin: 1em 0; +} + +.mtb-2 { + margin: 2em 0; +} + +.mb-1 { + margin-bottom: 1em; +} + +.mb-0 { + margin-bottom: 0; +} + +.mt-2 { + margin-top: 2em; +} + +.ml-1 { + margin-left: 1em; +} + +.btn { + cursor: pointer; +} + +.hidden { + display: none; +} + +.tag { + font-size: .7em; + font-weight: bold; + line-height: 1; + color: #fff; + background-color: var(--pm); + border-radius: 20px; + padding: 2px 8px; +} + +@keyframes showup { + from { + opacity: 0; + transform: translateY(20px); + } + + to { + opacity: 1; + transform: none; + } +} + +@media (max-width: 640px) { + body { + margin: 1em 2em; + } + + .row-mob { + flex-direction: column; + align-items: flex-start; + gap: 0; + } + + .al-c-mob { + align-items: center; + } + + .col-rev-mob { + flex-direction: column-reverse; + } + + .sm-2-mob { + font-size: .8em; + } + + .mb-0_5-mob { + margin-bottom: .5em; + } + + .mb-1_5-mob { + margin-bottom: 1.5em; + } +} + +/* Scroll bar */ +::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +::-webkit-scrollbar-thumb { + background: rgb(128 128 128 / 70%); +} +::-webkit-scrollbar-thumb:window-inactive { + background: rgb(128 128 128 / 20%); +} + +::-webkit-scrollbar-thumb:active { + background-color: rgb(128 128 128 / 100%); +} \ No newline at end of file diff --git a/static/css/md.css b/static/css/md.css new file mode 100644 index 0000000..b4a5ff6 --- /dev/null +++ b/static/css/md.css @@ -0,0 +1,26 @@ +.md blockquote { + font-family: 'Inter'; + background-color: rgba(148, 148, 149, 0.08) ; + margin: 1.5em 0px; + padding: 1.1em 20px 1px 20px; + border-left: 8px solid var(--pm); + font-style: italic; +} + +.md table { + border-collapse: collapse; + border-spacing: 0; + display: block; + max-width: 100%; + width: 100%; + overflow: auto; +} + +.md table th { + background-color: var(--bg); +} + +table th, table td { + padding: 10px 20px; + border: 1px solid var(--bd); +} \ No newline at end of file diff --git a/static/css/prism-dark.css b/static/css/prism-dark.css new file mode 100644 index 0000000..74c6546 --- /dev/null +++ b/static/css/prism-dark.css @@ -0,0 +1,289 @@ +/* https://github.com/PrismJS/prism-themes/blob/master/themes/prism-vsc-dark-plus.css */ +pre[class*="language-"], +code[class*="language-"] { + color: #d4d4d4; + font-size: 13px; + text-shadow: none; + font-family: Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", + "Courier New", monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + line-height: 1.5; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::selection, +code[class*="language-"]::selection, +pre[class*="language-"] *::selection, +code[class*="language-"] *::selection { + text-shadow: none; + background: #75a7ca; +} + +@media print { + pre[class*="language-"], + code[class*="language-"] { + text-shadow: none; + } +} + +pre[class*="language-"] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + background: #292929; +} + +:not(pre) > code[class*="language-"] { + padding: 0.1em 0.3em; + border-radius: 0.3em; + color: #db4c69; + background: #f9f2f4; +} +/********************************************************* +* Tokens +*/ +.namespace { + opacity: 0.7; +} + +.token.doctype .token.doctype-tag { + color: #569cd6; +} + +.token.doctype .token.name { + color: #9cdcfe; +} + +.token.comment, +.token.prolog { + color: #6a9955; +} + +.token.punctuation, +.language-html .language-css .token.punctuation, +.language-html .language-javascript .token.punctuation { + color: #d4d4d4; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.inserted, +.token.unit { + color: #b5cea8; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.deleted { + color: #ce9178; +} + +.language-css .token.string.url { + text-decoration: underline; +} + +.token.operator, +.token.entity { + color: #d4d4d4; +} + +.token.operator.arrow { + color: #569cd6; +} + +.token.atrule { + color: #ce9178; +} + +.token.atrule .token.rule { + color: #c586c0; +} + +.token.atrule .token.url { + color: #9cdcfe; +} + +.token.atrule .token.url .token.function { + color: #dcdcaa; +} + +.token.atrule .token.url .token.punctuation { + color: #d4d4d4; +} + +.token.keyword { + color: #569cd6; +} + +.token.keyword.module, +.token.keyword.control-flow { + color: #c586c0; +} + +.token.function, +.token.function .token.maybe-class-name { + color: #dcdcaa; +} + +.token.regex { + color: #d16969; +} + +.token.important { + color: #569cd6; +} + +.token.italic { + font-style: italic; +} + +.token.constant { + color: #9cdcfe; +} + +.token.class-name, +.token.maybe-class-name { + color: #4ec9b0; +} + +.token.console { + color: #9cdcfe; +} + +.token.parameter { + color: #9cdcfe; +} + +.token.interpolation { + color: #9cdcfe; +} + +.token.punctuation.interpolation-punctuation { + color: #569cd6; +} + +.token.boolean { + color: #569cd6; +} + +.token.property, +.token.variable, +.token.imports .token.maybe-class-name, +.token.exports .token.maybe-class-name { + color: #9cdcfe; +} + +.token.selector { + color: #d7ba7d; +} + +.token.escape { + color: #d7ba7d; +} + +.token.tag { + color: #569cd6; +} + +.token.tag .token.punctuation { + color: #808080; +} + +.token.cdata { + color: #808080; +} + +.token.attr-name { + color: #9cdcfe; +} + +.token.attr-value, +.token.attr-value .token.punctuation { + color: #ce9178; +} + +.token.attr-value .token.punctuation.attr-equals { + color: #d4d4d4; +} + +.token.entity { + color: #569cd6; +} + +.token.namespace { + color: #4ec9b0; +} +/********************************************************* +* Language Specific +*/ + +pre[class*="language-javascript"], +code[class*="language-javascript"], +pre[class*="language-jsx"], +code[class*="language-jsx"], +pre[class*="language-typescript"], +code[class*="language-typescript"], +pre[class*="language-tsx"], +code[class*="language-tsx"] { + color: #9cdcfe; +} + +pre[class*="language-css"], +code[class*="language-css"] { + color: #ce9178; +} + +pre[class*="language-html"], +code[class*="language-html"] { + color: #d4d4d4; +} + +.language-regex .token.anchor { + color: #dcdcaa; +} + +.language-html .token.punctuation { + color: #808080; +} +/********************************************************* +* Line highlighting +*/ +pre[data-line] { + position: relative; +} + +pre[class*="language-"] > code[class*="language-"] { + position: relative; + z-index: 1; +} + +.line-highlight { + position: absolute; + left: 0; + right: 0; + padding: inherit 0; + margin-top: 1em; + background: #f7ebc6; + box-shadow: inset 5px 0 0 #f7d87c; + z-index: 0; + pointer-events: none; + line-height: inherit; + white-space: pre; +} diff --git a/static/css/syntax.css b/static/css/syntax.css new file mode 100644 index 0000000..21f760c --- /dev/null +++ b/static/css/syntax.css @@ -0,0 +1,122 @@ +pre[class*="language-"], +code[class*="language-"] { + color: #d4d4d4; + font-size: 13px; + text-shadow: none; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + line-height: 1.5; + color: #d4d4d4; +} + +.chroma { + background-color: #292929; + margin: .5em 0; +} + +/* LineTableTD */ +.chroma .lntd { + vertical-align: top; + padding: 0; + margin: 0; + border: 0; +} + +.chroma .lntable { + border-spacing: 0; + padding: 0; + margin: 0; + border: 0; + width: auto; + overflow: auto; + display: block; +} + +/* LineNumbersTable */ +.chroma .lnt { + color: #999; + display: block; + padding-left: .5em; + padding-right: 1em; + text-align: right; + line-height: 1.5; + font-size: 13px; +} + +/* Keyword */ +.chroma .kc, +.chroma .kd, +.chroma .kn, +.chroma .kp, +.chroma .kr, +.chroma .kt, +.chroma .k, +.chroma .si { + color: #569cd6; +} + +.chroma .na { + color: #9cdcfe; +} + +.chroma .n, +.chroma .nb, +.chroma .bp, +.chroma .nc, +.chroma .no, +.chroma .nd, +.chroma .ni, +.chroma .ne, +.chroma .nf, +.chroma .fm, +.chroma .nl, +.chroma .nn { + color: #3f4c50; +} + +/* NameProperty */ +.chroma .py, +.chroma .nt, +.chroma .nv, +.chroma .vc, +.chroma .vg, +.chroma .vi, +.chroma .vm { + color: #569cd6; +} + +/* LiteralString */ +.chroma .s, +.chroma .sa, +.chroma .sb, +.chroma .sc, +.chroma .dl, +.chroma .sd, +.chroma .s2, +.chroma .se, +.chroma .sh, +.chroma .sx, +.chroma .sr, +.chroma .s1, +.chroma .ss { + color: #ce9178; +} +/* LiteralNumber */ +.chroma .m, +.chroma .mb, +.chroma .mf, +.chroma .mh, +.chroma .mi, +.chroma .il, +.chroma .mo { + color: #b5cea8; +} + +/* Comment */ +.chroma .c, +.chroma .ch, +.chroma .cm, +.chroma .c1, +.chroma .cs { + color: #517043; +} + diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..522921f Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/js/main.js b/static/js/main.js new file mode 100644 index 0000000..70636cf --- /dev/null +++ b/static/js/main.js @@ -0,0 +1,18 @@ +window.addEventListener('DOMContentLoaded', function () { + const light = '🌝', dark = '🌚'; + const LIGHT = 'light', DARK = 'dark'; + const themeSwitcher = document.getElementById('theme-switcher'); + + themeSwitcher.innerHTML = localStorage.theme === LIGHT ? light : dark; + + themeSwitcher.addEventListener('click', function () { + const currentTheme = localStorage.theme, + newTheme = currentTheme === LIGHT ? DARK : LIGHT, + { classList } = document.querySelector('html'), + text = newTheme === LIGHT ? light : dark; + classList.remove(currentTheme); + classList.add(newTheme); + localStorage.theme = newTheme; + themeSwitcher.innerHTML = text; + }) +}); \ No newline at end of file diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..b491df0 --- /dev/null +++ b/theme.toml @@ -0,0 +1,21 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "Minima" +license = "MIT" +licenselink = "https://github.com/mivinci/minima/blob/master/LICENSE" +description = "A Clean and minimal Hugo theme porting from Minima on Hexo." +homepage = "https://github.com/mivinci/hugo-theme-minima" +tags = ["minimal", "clean", "blog", "responsive", "personal", "simple", "minimalist", "portfolio", "dark"] +features = ["Dark mode", "KaTeX"] +min_version = "0.41.0" + +[author] + name = "XJJ" + homepage = "https://xjj.pub" + +# If porting an existing theme +[original] + name = "Minima" + homepage = "https://adisaktijrs.github.io/minima" + repo = "https://github.com/adisaktijrs/hexo-theme-minima"