some changes to themes
This commit is contained in:
parent
26c526e433
commit
8237b6aa19
51 changed files with 852 additions and 12 deletions
5
themes/fzmin2/.gitignore
vendored
Normal file
5
themes/fzmin2/.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
.Rproj.user
|
||||
.Rhistory
|
||||
.RData
|
||||
.Ruserdata
|
||||
exampleSite/public
|
20
themes/fzmin2/LICENSE.md
Normal file
20
themes/fzmin2/LICENSE.md
Normal 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
30
themes/fzmin2/README.md
Normal 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.
|
||||
|
||||
[](https://xmin.yihui.org)
|
4
themes/fzmin2/archetypes/default.md
Normal file
4
themes/fzmin2/archetypes/default.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: ''
|
||||
date: ''
|
||||
---
|
5
themes/fzmin2/layouts/404.html
Normal file
5
themes/fzmin2/layouts/404.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{{ partial "header.html" . }}
|
||||
|
||||
404 NOT FOUND
|
||||
|
||||
{{ partial "footer.html" . }}
|
7
themes/fzmin2/layouts/_default/list.gopher.txt
Normal file
7
themes/fzmin2/layouts/_default/list.gopher.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
!{{ .Title }}
|
||||
|
||||
{{ .RawContent }}
|
||||
|
||||
{{ range .Pages.ByPublishDate.Reverse }}
|
||||
0{{ .Title }} {{ with .OutputFormats.Get "gopher" -}}{{ .RelPermalink }} {{ $.Site.Params.hostname}} 70 {{ end }}
|
||||
{{ end }}
|
21
themes/fzmin2/layouts/_default/list.html
Normal file
21
themes/fzmin2/layouts/_default/list.html
Normal 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" . }}
|
8
themes/fzmin2/layouts/_default/single.gopher.txt
Normal file
8
themes/fzmin2/layouts/_default/single.gopher.txt
Normal 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 }}
|
12
themes/fzmin2/layouts/_default/single.html
Normal file
12
themes/fzmin2/layouts/_default/single.html
Normal 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" . }}
|
13
themes/fzmin2/layouts/_default/terms.html
Normal file
13
themes/fzmin2/layouts/_default/terms.html
Normal 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" . }}
|
13
themes/fzmin2/layouts/index.gopher.txt
Normal file
13
themes/fzmin2/layouts/index.gopher.txt
Normal 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 }}
|
6
themes/fzmin2/layouts/partials/foot_custom.html
Normal file
6
themes/fzmin2/layouts/partials/foot_custom.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<div>
|
||||
<select id="themes">
|
||||
</select>
|
||||
<button onclick="changetheme()">Change theme</button>
|
||||
</div>
|
||||
<div id="aaa"></div>
|
9
themes/fzmin2/layouts/partials/footer.html
Normal file
9
themes/fzmin2/layouts/partials/footer.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<footer>
|
||||
{{ partial "foot_custom.html" . }}
|
||||
{{ with .Site.Params.footer }}
|
||||
<hr/>
|
||||
{{ replace . "{Year}" now.Year | markdownify}}
|
||||
{{ end }}
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
2
themes/fzmin2/layouts/partials/head_custom.html
Normal file
2
themes/fzmin2/layouts/partials/head_custom.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
<script defer src="/js/themes.js"></script>
|
||||
<link rel="stylesheet" href="/css/themes/default.css">
|
21
themes/fzmin2/layouts/partials/header.html
Normal file
21
themes/fzmin2/layouts/partials/header.html
Normal 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>
|
9
themes/fzmin2/static/css/fonts.css
Normal file
9
themes/fzmin2/static/css/fonts.css
Normal 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%;
|
||||
}
|
91
themes/fzmin2/static/css/style.css
Normal file
91
themes/fzmin2/static/css/style.css
Normal 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;
|
||||
}
|
8
themes/fzmin2/static/css/themes/1337.css
Normal file
8
themes/fzmin2/static/css/themes/1337.css
Normal 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;
|
||||
}
|
8
themes/fzmin2/static/css/themes/default.css
Normal file
8
themes/fzmin2/static/css/themes/default.css
Normal file
|
@ -0,0 +1,8 @@
|
|||
:root {
|
||||
--text-color: #fdfaff;
|
||||
--accent: #f12a2a;
|
||||
--bg0: #221c1c;
|
||||
--bg1: #292323;
|
||||
--bg2: #332b2b;
|
||||
--bg3: #645959;
|
||||
}
|
8
themes/fzmin2/static/css/themes/red.css
Normal file
8
themes/fzmin2/static/css/themes/red.css
Normal file
|
@ -0,0 +1,8 @@
|
|||
:root {
|
||||
--text-color: #fdfaff;
|
||||
--accent: #ff4949;
|
||||
--bg0: #110e0e;
|
||||
--bg1: #292323;
|
||||
--bg2: #131010;
|
||||
--bg3: #2e2a2a;
|
||||
}
|
8
themes/fzmin2/static/css/themes/red2.css
Normal file
8
themes/fzmin2/static/css/themes/red2.css
Normal file
|
@ -0,0 +1,8 @@
|
|||
:root {
|
||||
--text-color: #fdfaff;
|
||||
--accent: #f12a2a;
|
||||
--bg0: #221c1c;
|
||||
--bg1: #292323;
|
||||
--bg2: #332b2b;
|
||||
--bg3: #645959;
|
||||
}
|
8
themes/fzmin2/static/css/themes/winter.css
Normal file
8
themes/fzmin2/static/css/themes/winter.css
Normal file
|
@ -0,0 +1,8 @@
|
|||
:root {
|
||||
--text-color: #222627;
|
||||
--accent: #33c5ff;
|
||||
--bg0: #eafeff;
|
||||
--bg1: #d3fcff;
|
||||
--bg2: #d6f7ff;
|
||||
--bg3: #defaff;
|
||||
}
|
8
themes/fzmin2/static/css/themes/xmin.css
Normal file
8
themes/fzmin2/static/css/themes/xmin.css
Normal file
|
@ -0,0 +1,8 @@
|
|||
:root {
|
||||
--text-color: black;
|
||||
--accent: #666;
|
||||
--bg0: #eee;
|
||||
--bg1: #ddd;
|
||||
--bg2: #ddd;
|
||||
--bg3: #f9f9f9;
|
||||
}
|
19
themes/fzmin2/static/js/themes.js
Normal file
19
themes/fzmin2/static/js/themes.js
Normal 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
12
themes/fzmin2/theme.toml
Normal 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"
|
Loading…
Add table
Add a link
Reference in a new issue