some changes to themes

This commit is contained in:
fzorb 2025-01-16 11:26:30 +02:00
parent 26c526e433
commit 8237b6aa19
51 changed files with 852 additions and 12 deletions

5
themes/fzmin2/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
exampleSite/public

20
themes/fzmin2/LICENSE.md Normal file
View file

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2017-2022 Yihui Xie
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.

30
themes/fzmin2/README.md Normal file
View file

@ -0,0 +1,30 @@
# HUGO XMIN
**NOTE**: fzorb/zmin is the fork of xmin that runs on https://fzorb.xyz/ .
## _Keep it simple, but not simpler_
**XMin** is a Hugo theme written by [Yihui Xie](https://yihui.org) in about four hours: half an hour was spent on the Hugo templates, and 3.5 hours were spent on styling. The main motivation for writing this theme was to provide a really minimal example to beginners of Hugo templates. This XMin theme contains about 130 lines of code in total, including the code in HTML templates and CSS (also counting empty lines).
```bash
find . -not -path '*/exampleSite/*' \( -name '*.html' -o -name '*.css' \) | xargs wc -l
```
```
5 ./layouts/404.html
12 ./layouts/_default/single.html
20 ./layouts/_default/list.html
13 ./layouts/_default/terms.html
0 ./layouts/partials/foot_custom.html
0 ./layouts/partials/head_custom.html
9 ./layouts/partials/footer.html
20 ./layouts/partials/header.html
51 ./static/css/style.css
7 ./static/css/fonts.css
137 total
```
I can certainly further reduce the code, for example, by eliminating the CSS, but I believe a tiny bit of CSS can greatly improve readability. You cannot really find many CSS frameworks that only contain 50 lines of code.
[![Screenshot](https://github.com/yihui/hugo-xmin/raw/master/images/screenshot.png)](https://xmin.yihui.org)

View file

@ -0,0 +1,4 @@
---
title: ''
date: ''
---

View file

@ -0,0 +1,5 @@
{{ partial "header.html" . }}
404 NOT FOUND
{{ partial "footer.html" . }}

View file

@ -0,0 +1,7 @@
!{{ .Title }}
{{ .RawContent }}
{{ range .Pages.ByPublishDate.Reverse }}
0{{ .Title }} {{ with .OutputFormats.Get "gopher" -}}{{ .RelPermalink }} {{ $.Site.Params.hostname}} 70 {{ end }}
{{ end }}

View file

@ -0,0 +1,21 @@
{{ partial "header.html" . }}
{{if not .IsHome }}
<h1>{{ .Title | markdownify }}</h1>
{{ end }}
{{ .Content }}
{{ $pages := .Pages }}
{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
{{ range $index, $page := (where $pages "Section" "!=" "") }}
<div class="post">
<h3><a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a></h3>
<span class="date">Written on {{ .Date.Format "2006/01/02" }}</span>
<p>{{ .Summary }}</p>
</div>
{{ if not (eq $index (sub (len $pages) 1)) }}
<hr>
{{ end }}
{{ end }}
{{ partial "footer.html" . }}

View file

@ -0,0 +1,8 @@
# {{ .Title }}
{{ .Date.Format (.Site.Params.dateform | default "N/A") }}
{{ if .Params.tags }}
Posted in: {{ range .Params.tags }}{{ . }} {{ end }}
{{ end }}
{{ .RawContent }}

View file

@ -0,0 +1,12 @@
{{ partial "header.html" . }}
<div class="article-meta">
<h1><span class="title">{{ .Title | markdownify }}</span></h1>
{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}
{{ if (gt .Params.date 0) }}<h2 class="date">{{ .Date.Format "2006/01/02" }}</h2>{{ end }}
</div>
<main>
{{ .Content }}
</main>
{{ partial "footer.html" . }}

View file

@ -0,0 +1,13 @@
{{ partial "header.html" . }}
<h1>{{ .Title }}</h1>
<ul class="terms">
{{ range .Data.Terms }}
<li>
<a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a> ({{ .Count }})
</li>
{{ end }}
</ul>
{{ partial "footer.html" . }}

View file

@ -0,0 +1,13 @@
!{{ .Title }}
{{ .RawContent }}
Site sections:
{{ range .Site.Menus.main }}
1{{ .Name }} {{ .Identifier }} {{ $.Site.Params.hostname }} 70
{{ end }}
Most recent articles
{{ range first 3 .Pages.ByPublishDate.Reverse }}
0{{ .Title }} {{ with .OutputFormats.Get "gopher" -}}{{ .RelPermalink }} {{ $.Site.Params.hostname }} 70 {{ end }}
{{ end }}

View file

@ -0,0 +1,6 @@
<div>
<select id="themes">
</select>
<button onclick="changetheme()">Change theme</button>
</div>
<div id="aaa"></div>

View file

@ -0,0 +1,9 @@
<footer>
{{ partial "foot_custom.html" . }}
{{ with .Site.Params.footer }}
<hr/>
{{ replace . "{Year}" now.Year | markdownify}}
{{ end }}
</footer>
</body>
</html>

View file

@ -0,0 +1,2 @@
<script defer src="/js/themes.js"></script>
<link rel="stylesheet" href="/css/themes/default.css">

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ .Title }} | {{ .Site.Title }}</title>
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}" />
<link rel="stylesheet" href="{{ "css/fonts.css" | relURL }}" />
{{ partial "head_custom.html" . }}
</head>
<body>
<nav>
<ul class="menu">
<h1>{{ .Site.Title }}</h1>
{{ range .Site.Menus.main }}
<li><a href="{{ .URL | relURL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
<hr/>
</nav>

View file

@ -0,0 +1,9 @@
body {
font-family: Verdana,sans-serif;
font-size: 100%;
line-height: 1.5;
}
code {
font-family: monospace;
font-size: 100%;
}

View file

@ -0,0 +1,91 @@
body {
max-width: 800px;
margin: auto;
padding: 1em;
line-height: 1.5;
background: var(--bg0);
color: var(--text-color);
}
a {
color: var(--accent);
}
.isso-thread-heading {
color: var(--text-color) !important;
}
.isso-comment.isso-no-votes {
color: var(--text-color) !important;
}
.isso-author {
color: var(--text-color) !important;
}
.isso-permalink {
color: var(--text-color) !important;
}
.isso-downvote {
color: white;
}
/* header and footer areas */
.menu { padding: 0; }
.menu li { display: inline-block;}
.article-meta, .menu a {
text-decoration: none;
background: var(--bg1);
padding: 5px;
border-radius: 5px;
}
.menu h1 {
border-left: 4px solid var(--accent);
}
.menu a:hover {
border-bottom: solid var(--accent);
}
.article-meta, footer { text-align: center;}
.title { font-size: 1.1em; }
footer a { text-decoration: none; }
hr {
border-style: dashed;
color: #ddd;
}
/* code */
pre {
border: 1px solid #ddd;
/*box-shadow: 5px 5px 5px #eee;*/
padding: 1em;
overflow-x: auto;
}
code { background: none; }
pre code { background: none; }
/* misc elements */
img, iframe, video { max-width: 100%; margin-bottom: none; }
main { hyphens: auto; }
blockquote {
background: #f9f9f9;
border-left: 5px solid #ccc;
padding: 3px 1em 3px;
}
table {
margin: auto;
}
table thead th { border-bottom: 1px solid var(--bg3); }
th, td { padding: 5px; }
thead, tfoot, tr:nth-child(even) { background: var(--bg3); }
ul {margin-top: none;}
.post h3 {
margin-bottom: 0.2rem;
}
.post .date {
font-size: 12px;
}

View file

@ -0,0 +1,8 @@
:root {
--text-color: rgb(0, 255, 0);
--accent: rgb(0, 255, 0);
--bg0: black;
--bg1: black;
--bg2: black;
--bg3: black;
}

View file

@ -0,0 +1,8 @@
:root {
--text-color: #fdfaff;
--accent: #f12a2a;
--bg0: #221c1c;
--bg1: #292323;
--bg2: #332b2b;
--bg3: #645959;
}

View file

@ -0,0 +1,8 @@
:root {
--text-color: #fdfaff;
--accent: #ff4949;
--bg0: #110e0e;
--bg1: #292323;
--bg2: #131010;
--bg3: #2e2a2a;
}

View file

@ -0,0 +1,8 @@
:root {
--text-color: #fdfaff;
--accent: #f12a2a;
--bg0: #221c1c;
--bg1: #292323;
--bg2: #332b2b;
--bg3: #645959;
}

View file

@ -0,0 +1,8 @@
:root {
--text-color: #222627;
--accent: #33c5ff;
--bg0: #eafeff;
--bg1: #d3fcff;
--bg2: #d6f7ff;
--bg3: #defaff;
}

View file

@ -0,0 +1,8 @@
:root {
--text-color: black;
--accent: #666;
--bg0: #eee;
--bg1: #ddd;
--bg2: #ddd;
--bg3: #f9f9f9;
}

View file

@ -0,0 +1,19 @@
const themes = ['default', 'xmin', 'winter', '1337', 'red']
themes.forEach(theme => {
document.getElementById("themes").insertAdjacentHTML('afterbegin', "<option id='" + theme + "'>" + theme + "</option>" )
});
function changeClientTheme(theme) {
let link = document.createElement("link");
link.rel = "stylesheet";
link.href = "/css/themes/" + theme + ".css";
document.head.appendChild(link);
}
function changetheme() {
localStorage.setItem("theme", document.getElementById('themes').value);
changeClientTheme(document.getElementById('themes').value)
}
changeClientTheme(localStorage.getItem('theme'))

12
themes/fzmin2/theme.toml Normal file
View file

@ -0,0 +1,12 @@
name = "fznin"
license = "MIT"
licenselink = "https://github.com/yihui/hugo-xmin/blob/master/LICENSE.md"
description = "eXtremely Minimal Hugo theme: about 150 lines of code in total, including HTML and CSS"
homepage = "https://xmin.yihui.org"
tags = ["minimal", "blog", "personal", "clean", "simple", "starter", "minimalist"]
features = ["blog"]
min_version = "0.18"
[author]
name = "Yihui Xie"
homepage = "https://yihui.org"