Initial commit

This commit is contained in:
Hanwen Guo 2022-08-26 15:15:25 +08:00
commit d4fc55a757
32 changed files with 687 additions and 0 deletions

20
LICENSE Normal file
View File

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

71
README.md Normal file
View File

@ -0,0 +1,71 @@
# no style, please!
<img src="https://raw.githubusercontent.com/Masellum/hugo-theme-nostyleplease/main/logo.png" width="64" align="left" />A (nearly) no-CSS, fast, minimalist [Hugo](https://gohugo.io/) theme ported from [riggraz
/
no-style-please](https://github.com/riggraz/no-style-please/).
<img src="https://raw.githubusercontent.com/Masellum/hugo-theme-nostyleplease/main/images/screenshot-both.png" />
## Features
* Fast (**1kb of CSS!**)
* Light, dark and auto modes
* Responsive
* Content first (typography optimized for maximum readability)
* RSS feed (using Hugo's embedded RSS template)
## Installation
Just the same as any other Hugo theme.
## Usage
You can edit `config.toml` file to customize your blog. You can change things such as the name of the blog, the author, the appearance of the theme (light, dark or auto), how dates are formatted, etc. Customizable fields should be straightforward to understand. Still, `config.toml` contains some comments to help you understand what each field does.
### Customize the menu
In order to add/edit/delete entries from the main menu, you have to edit the `menu.toml` file inside `data` folder. Through that file you can define the structure of the menu. Take a look at the default configuration to get an idea of how it works and read on for a more comprehensive explanation.
The `menu.toml` file accepts the following fields:
- `entries` define a new unordered list that will contain menu entries
- each entry is a member of the TOML array `entries` in question
- each entry can have the following attributes:
- `title`, which defines the text to render for this menu entry (**NB: you can also specify HTML!**)
- `url`, which can be used to specify an URL for this entry. If not specified, `title` will be rendered as-is; otherwise `title` will be sorrounded by a link tag pointing to the specified URL. Note that the URL can either be relative or absolute. Also note that you can get the same result by placing an ```<a>``` tag in the `title` field.
- `post_list`, which can be set either to `true` or to an object. If it is true, the entry will have a list of all posts as subentries. This is used to render your post list. If you want to customize which posts to render (e.g. by section), you can add one or more of the following attributes under `post_list`:
- `section`, which can be set to a string. It is used to render a list of posts of the specified section only. If you don't set it, then posts of all sections will be rendered.
- `limit`, which can be set to a number. It specifies the number of posts to show. If not set, all posts will be rendered.
- `show_more`, which can be true. If it is true and if the number of posts to show is greater than the specified `limit`, render a link to another page. To specify the URL and the text of the link, you can set `show_more_url` and `show_more_text` attributes, which are documented below.
- `show_more_url`, which can be a string. It specifies the URL for the show more link. Use only if `show_more` is true. This will usually redirect to a page containing all posts, which you can easily create using an section page (see [section pages](#section-pages) section)
- `show_more_text`, which can be a string. It specifies the text for the show more link. Use only if `show_more` is true.
- `entries`, yes, you can have entries inside entries. In this way you can create nested sublists!
### Section pages
A so-called section page is a page that shows a list of posts in a specific section. It should be automatically created by hugo when a new section is created.
### Customize the index page
The `index.md` page should use layout `home`, which is the layout that displays the menu. If you want to have some content after the menu, you can just add that content in the `_index.md` file, and it will automatically show under the menu.
Another thing you can do to customize the index page is show the description of your blog between the title and the menu. To do this, just edit `config.toml` and change `params.theme_config.show_description` to `true`.
### Pro tips
#### Dark mode for images
This theme provides dark mode by inverting all colors of light mode throught the CSS `invert()` function. This approach would also invert the color of all images, but, since this is not the behaviour one would expect, images are not inverted by default.
However, if you would like to force the color inversion on a specific image you can do so by applying `class="ioda"` to that image ("ioda" stands for "invert on dark appearance"). See the image in the [overview post](https://github.com/riggraz/no-style-please/blob/master/_posts/2020-07-07-overview-post.md) for an example of this approach. Note that color inversion will take place only when the theme has dark appearance!
For example, if you have a black and white image it could make sense to invert it in dark mode. On the other hand, a colorful image will probably look bad if inverted.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Masellum/hugo-theme-nostyleplease.
## License
The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

91
assets/css/main.scss Normal file
View File

@ -0,0 +1,91 @@
// -------------- THEME SWITCHER -------------- //
@mixin dark-appearance {
filter: invert(1);
img {
filter: invert(1);
&.ioda { filter: invert(0); }
}
}
body[a="dark"] { @include dark-appearance; }
@media (prefers-color-scheme: dark) {
body[a="auto"] { @include dark-appearance; }
}
// -------------------------------------------- //
// bg color is also needed in html in order to
// block body's background propagation
// see: https://stackoverflow.com/a/61265706
html, body { background: white; }
html { height: 100%; }
body {
color: black;
font-family: monospace;
font-size: 16px;
line-height: 1.4;
margin: 0;
min-height: 100%;
overflow-wrap: break-word;
}
.post-meta { text-align: right; }
h2, h3, h4, h5, h6 { margin-top: 3rem; }
hr { margin: 2rem 0; }
p { margin: 1rem 0; }
li { margin: 0.4rem 0; }
*:target { background: yellow; }
.w {
max-width: 640px;
margin: 0 auto;
padding: 4rem 2rem;
}
hr {
text-align: center;
border: 0;
&:before { content: '/////' }
&:after { content: attr(data-content) '/////' }
}
pre {
padding: 1em;
}
table { width: 100%; }
table, th, td {
border: thin solid black;
border-collapse: collapse;
padding: 0.4rem;
}
code {
color: white;
background: black;
}
blockquote {
font-style: italic;
border: thin solid black;
padding: 1rem;
p { margin: 0; }
}
img {
max-width: 100%;
display: block;
margin: 0 auto;
}

View File

@ -0,0 +1,9 @@
const p = document.createElement("p");
p.style.textAlign = "center";
p.style.fontSize = "18pt";
p.innerHTML = "C'mon, move your mouse!"
document.body.append(p);
document.addEventListener("mousemove", e => {
p.innerHTML = `mouseX: ${e.clientX}, mouseY: ${e.clientY}`;
});

30
config.toml Normal file
View File

@ -0,0 +1,30 @@
[module]
[module.hugoVersion]
extended=true
min = "0.41.0"
[markup]
[markup.goldmark]
[markup.goldmark.parser]
[markup.goldmark.parser.attribute]
block = true
title = true
[markup.highlight]
anchorLineNos = false
codeFences = true
guessSyntax = false
hl_Lines = ''
hl_inline = false
lineAnchors = ''
lineNoStart = 1
lineNos = false
lineNumbersInTable = true
noClasses = true
noHl = false
style = 'rrt'
tabWidth = 4
[params]
[params.theme_config]
back_home_text = ".."
date_format = "2006-01-02"

5
content/_index.md Normal file
View File

@ -0,0 +1,5 @@
+++
title = ""
date = 2022-08-25T21:30:04+08:00
draft = false
+++

View File

@ -0,0 +1,7 @@
---
title: "strange post with custom js"
custom_js: [mouse_coords]
date: 2020-07-06T00:00:00+08:00
---
This post is strange. It also has some custom js.

View File

@ -0,0 +1,85 @@
---
title: "overview"
date: 2020-07-07T00:00:00+08:00
---
Lorem ipsum[^1] dolor sit amet, consectetur adipiscing elit. Pellentesque vel lacinia neque. Praesent nulla quam, ullamcorper in sollicitudin ac, molestie sed justo. Cras aliquam, sapien id consectetur accumsan, augue magna faucibus ex, ut ultricies turpis tortor vel ante. In at rutrum tellus.
# Sample heading 1
## Sample heading 2
### Sample heading 3
#### Sample heading 4
##### Sample heading 5
###### Sample heading 6
Mauris viverra dictum ultricies. Vestibulum quis ipsum euismod, facilisis metus sed, varius ipsum. Donec scelerisque lacus libero, eu dignissim sem venenatis at. Etiam id nisl ut lorem gravida euismod.
## Lists
Unordered:
- Fusce non velit cursus ligula mattis convallis vel at metus[^2].
- Sed pharetra tellus massa, non elementum eros vulputate non.
- Suspendisse potenti.
Ordered:
1. Quisque arcu felis, laoreet vel accumsan sit amet, fermentum at nunc.
2. Sed massa quam, auctor in eros quis, porttitor tincidunt orci.
3. Nulla convallis id sapien ornare viverra.
4. Nam a est eget ligula pellentesque posuere.
## Blockquote
The following is a blockquote:
> Suspendisse tempus dolor nec risus sodales posuere. Proin dui dui, mollis a consectetur molestie, lobortis vitae tellus.
## Thematic breaks (<hr>)
Mauris viverra dictum ultricies[^3]. Vestibulum quis ipsum euismod, facilisis metus sed, varius ipsum. Donec scelerisque lacus libero, eu dignissim sem venenatis at. Etiam id nisl ut lorem gravida euismod. **You can put some text inside the horizontal rule like so.**
---
{data-content = "with text"}
Mauris viverra dictum ultricies. Vestibulum quis ipsum euismod, facilisis metus sed, varius ipsum. Donec scelerisque lacus libero, eu dignissim sem venenatis at. Etiam id nisl ut lorem gravida euismod. **Or you can just have an clean horizontal rule.**
---
Mauris viverra dictum ultricies. Vestibulum quis ipsum euismod, facilisis metus sed, varius ipsum. Donec scelerisque lacus libero, eu dignissim sem venenatis at. Etiam id nisl ut lorem gravida euismod. Or you can just have an clean horizontal rule.
## Code
Now some code:
{{< highlight javascript >}}
const ultimateTruth = 'this theme is the best!';
console.log(ultimateTruth);
{{< / highlight >}}
And here is some `inline code`!
## Tables
Now a table:
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
## Images
![theme logo](https://raw.githubusercontent.com/Masellum/hugo-theme-nostyleplease/main/logo.png)
{.ioda}
Logo of *no style, please!* theme[^4]
---
{data-content = "footnotes"}
[^1]: this is a footnote. It should highlight if you click on the corresponding superscript number.
[^2]: hey there, i'm using no style please!
[^3]: this is another footnote.
[^4]: this is a very very long footnote to test if a very very long footnote brings some problems or not. I strongly hope that there are no problems but you know sometimes problems arise from nowhere.

View File

@ -0,0 +1,52 @@
---
title: "Language Tests"
category: example2
date: 2020-07-08T00:00:00+08:00
---
Note: I took this test post from [moving](https://github.com/huangyz0918/moving), which is another Jekyll theme which is better that this one so I should not have linked it because now you will decide to use it instead of mine.
### 1. 日本語テスト
This is a Japanese test post to show you how japanese is displayed.
私は昨日ついにその助力家というのの上よりするたなけれ。
最も今をお話団はちょうどこの前後なかろでくらいに困りがいるたをは帰着考えたなかって、そうにもするでうたらない。
がたを知っないはずも同時に九月をいよいよたありた。
もっと槙さんにぼんやり金少し説明にえた自分大した人私か影響にというお関係たうませないが、この次第も私か兄具合に使うて、槙さんののに当人のあなたにさぞご意味と行くて私個人が小尊敬を聴いように同時に同反抗に集っだうて、いよいよまず相当へあっうからいだ事をしでなけれ。
> それでそれでもご時日をしはずはたったいやと突き抜けるますて、その元がは行ったてという獄を尽すていけですた。
この中道具の日その学校はあなたごろがすまなりかとネルソンさんの考えるですん、辺の事実ないというご盲従ありたですと、爺さんのためが薬缶が結果までの箸の当時してならて、多少の十月にためからそういう上からとにかくしましないと触れべきものたで、ないうですと多少お人達したのでたた。
From [すぐ使えるダミーテキスト - 日本語 Lorem ipsum.](http://lipsum.sugutsukaeru.jp/index.cgi)
### 2. 繁体中文测试
This is a chinese test post to show you how chinese is displayed.
善我王上魚、產生資西員合兒臉趣論。畫衣生這著爸毛親可時,安程幾?合學作。觀經而作建。都非子作這!法如言子你關!手師也。
以也座論頭室業放。要車時地變此親不老高小是統習直麼調未,行年香一?
就竟在,是我童示讓利分和異種百路關母信過明驗有個歷洋中前合著區亮風值新底車有正結,進快保的行戰從:弟除文辦條國備當來際年每小腳識世可的的外的廣下歌洲保輪市果底天影;全氣具些回童但倒影發狀在示,數上學大法很,如要我……月品大供這起服滿老?應學傳者國:山式排只不之然清同關;細車是!停屋常間又,資畫領生,相們制在?公別的人寫教資夠。資再我我!只臉夫藝量不路政吃息緊回力之;兒足灣電空時局我怎初安。意今一子區首者微陸現際安除發連由子由而走學體區園我車當會,經時取頭,嚴了新科同?很夫營動通打,出和導一樂,查旅他。坐是收外子發物北看蘭戰坐車身做可來。道就學務。
國新故。
> 工步他始能詩的,裝進分星海演意學值例道……於財型目古香亮自和這乎?化經溫詩。只賽嚴大一主價世哥受的沒有中年即病行金拉麼河。主小路了種就小為廣不?
From [亂數假文產生器 - Chinese Lorem Ipsum.](http://www.richyli.com/tool/loremipsum/)
### 3. 简体中文测试
效育声去本义然空,各值太法心想,场强实地。 题铁习点儿表管少间千,只何政亲织文意部,千影画派证男须。 手反取长风治增非等直难群,连取及天他己事头级,影数弦适把气快目人。 专议以省通引而千个,格则口段度样水热马,地教少务改磨。 包思外心半院应她算斯,市外会快记路又火学,劳如肃它准众丧边。
> 团算部住县单总边素格军所,合音府教看和广光采率位转,位用品根确针百。 证其标元角工方海接交他,论象切万世认一响义,治然身本风弦带题。 向我次路持加北,她不反心。 说总元军例市决,现始即算证养,规走还壳。
因林可相儿应满军,热影省条律因资再,整肃赤心将届。 局广写两量备验还,南教事争工民的,备进研上布。 素身电活非直,速这区交示从,百层达。 资量那毛什京身,白这快。 半打容三手开常价或,手严量般象式效,名可重芽门适。 来设什一我么,光界美么或,住身式准。 造酸改表委验众办地百养,商物战众本列听度名院,制压录丽快与千机内。 住需当四议决得命南然照按民置,当住命形金决否矿单外。 气象理离开新集增际,三划方工义很年关,拉许准孝口。 构片出干计由备美打养,持育总指承入无己。
From [假文生成器, lorem ipsum Chinese](http://www.cancms.com/content/dummytext)

View File

@ -0,0 +1,6 @@
---
title: "very very very long title and very very very short content"
date: 2020-07-08T00:00:00+08:00
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque vel lacinia neque. Praesent nulla quam, ullamcorper in sollicitudin ac, molestie sed justo. Cras aliquam, sapien id consectetur accumsan, augue magna faucibus ex, ut ultricies turpis tortor vel ante. In at rutrum tellus. Nullam vestibulum metus eu purus malesuada, volutpat mattis leo facilisis.

View File

@ -0,0 +1,27 @@
---
title: "headings and toc"
date: 2020-07-09T00:00:00+08:00
---
Mauris viverra dictum ultricies. Vestibulum quis ipsum euismod, facilisis metus sed, varius ipsum. Donec scelerisque lacus libero, eu dignissim sem venenatis at. Nunc a egestas tortor, sed feugiat leo.
## Table of contents
- [Table of contents](#table-of-contents)
- [The start](#the-start)
- [The middle](#the-middle)
- [The end](#the-end)
Mauris viverra dictum ultricies. Vestibulum quis ipsum euismod, facilisis metus sed, varius ipsum. Donec scelerisque lacus libero, eu dignissim sem venenatis at. Nunc a egestas tortor, sed feugiat leo. Vestibulum porta tincidunt tellus, vitae ornare tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed nunc neque, tempor in iaculis non, faucibus et metus. Etiam id nisl ut lorem gravida euismod.
## [The start](#the-start)
Fusce non velit cursus ligula mattis convallis vel at metus. Sed pharetra tellus massa, non elementum eros vulputate non. Suspendisse potenti. Quisque arcu felis, laoreet vel accumsan sit amet, fermentum at nunc. Sed massa quam, auctor in eros quis, porttitor tincidunt orci. Nulla convallis id sapien ornare viverra. Cras nec est lacinia ligula porta tincidunt. Nam a est eget ligula pellentesque posuere. Maecenas quis enim ac risus accumsan scelerisque. Aliquam vitae libero sapien. Etiam convallis, metus nec suscipit condimentum, quam massa congue velit, sit amet sollicitudin nisi tortor a lectus. Cras a arcu enim. Suspendisse hendrerit euismod est ac gravida. Donec vitae elit tristique, suscipit eros at, aliquam augue. In ac faucibus dui. Sed tempor lacus tristique elit sagittis, vitae tempor massa convallis.
## [The middle](#the-middle)
Proin quis velit et eros auctor laoreet. Aenean eget nibh odio. Suspendisse mollis enim pretium, fermentum urna vitae, egestas purus. Donec convallis tincidunt purus, scelerisque fermentum eros sagittis vel. Aliquam ac aliquet risus, tempus iaculis est. Fusce molestie mauris non interdum hendrerit. Curabitur ullamcorper, eros vitae interdum volutpat, lacus magna lacinia turpis, at accumsan dui tortor vel lectus. Aenean risus massa, semper non lectus rutrum, facilisis imperdiet mi. Praesent sed quam quis purus auctor ornare et sed augue. Vestibulum non quam quis ligula luctus placerat sed sit amet erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Fusce auctor, sem eu volutpat dignissim, turpis nibh malesuada arcu, in consequat elit mauris quis sem. Nam tristique sit amet enim vel accumsan. Sed id nibh commodo, dictum sem id, semper quam.
## The end
Donec ex lectus, tempus non lacinia quis, pretium non ipsum. Praesent est nunc, rutrum vel tellus eu, tristique laoreet purus. In rutrum orci sit amet ex ornare, sit amet finibus lacus laoreet. Etiam ac facilisis purus, eget porttitor odio. Suspendisse tempus dolor nec risus sodales posuere. Proin dui dui, mollis a consectetur molestie, lobortis vitae tellus. Vivamus at purus sed urna sollicitudin mattis. Mauris lacinia libero in lobortis pulvinar. Nullam sit amet condimentum justo. Donec orci justo, pharetra ut dolor non, interdum finibus orci. Proin vitae ante a dui sodales commodo ac id elit. Nunc vel accumsan nunc, sit amet congue nunc. Aliquam in lacinia velit. Integer lobortis luctus eros, in fermentum metus aliquet a. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

View File

@ -0,0 +1,28 @@
---
title: "hr"
date: 2020-07-09T00:00:00+08:00
---
Lorem ipsum[^1] dolor sit amet, consectetur adipiscing elit. Pellentesque vel lacinia neque. Praesent nulla quam, ullamcorper in sollicitudin ac, molestie sed justo. Cras aliquam, sapien id consectetur accumsan, augue magna faucibus ex, ut ultricies turpis tortor vel ante. In at rutrum tellus. Nullam vestibulum metus eu purus malesuada, volutpat mattis leo facilisis. Sed consectetur, nisl et semper laoreet, velit augue congue nunc, eget eleifend odio erat eu sapien. Phasellus dictum efficitur dapibus. Morbi porta lacinia tincidunt. Nam aliquet est mi, nec lacinia ipsum elementum sed. Nam feugiat ipsum tortor, et pretium purus sollicitudin et.
---
Mauris viverra dictum ultricies[^2]. Vestibulum[^3] quis ipsum euismod, facilisis metus sed, varius ipsum. Donec scelerisque lacus libero, eu dignissim sem venenatis at. Nunc a egestas tortor, sed feugiat leo. Vestibulum porta tincidunt tellus, vitae ornare tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed nunc neque, tempor in iaculis non, faucibus et metus. Etiam id nisl ut lorem gravida euismod.
Fusce non velit cursus ligula mattis convallis vel at metus. Sed pharetra tellus massa, non elementum eros vulputate non. Suspendisse potenti. Quisque arcu felis, laoreet vel accumsan sit amet, fermentum at nunc. Sed massa quam, auctor in eros quis, porttitor tincidunt orci. Nulla convallis id sapien ornare viverra. Cras nec est lacinia ligula porta tincidunt. Nam a est eget ligula pellentesque posuere. Maecenas quis enim ac risus accumsan scelerisque. Aliquam vitae libero sapien. Etiam convallis, metus nec suscipit condimentum, quam massa congue velit, sit amet sollicitudin nisi tortor a lectus. Cras a arcu enim. Suspendisse hendrerit euismod est ac gravida. Donec vitae elit tristique, suscipit eros at, aliquam augue. In ac faucibus dui. Sed tempor lacus tristique elit sagittis, vitae tempor massa convallis.
---
{data-content="discussions"}
This article has been discussed here:
- [lobste.rs](#)
- [/r/webdev](#)
Feel free to reach out at my email to leave feedback and talk about the article.
---
{data-content="footnotes"}
[^1]: Okay here I should put something about "ipsum".
[^2]: same goes for this.
[^3]: I studied latin in high school but im not able to translate *anything*! By the way this is a longer footnote and i think it is still pretty cool, even prettier than shortier ones even though it does not say anything useful but whatever.

53
data/menu.toml Normal file
View File

@ -0,0 +1,53 @@
[[entries]]
title = "info"
[[entries.entries]]
title = "a (nearly) no-CSS, fast, minimalist Hugo theme ported from <a href='https://github.com/riggraz/no-style-please'>riggraz/no-style-please</a>."
[[entries.entries]]
title = "github repo"
url = "https://github.com/riggraz/no-style-please"
[[entries.entries]]
title = "used by <a href='https://riggraz.dev'>riggraz.dev</a> and <a href='https://github.com/riggraz/no-style-please/network/dependents'>many others</a>"
[[entries]]
title = "all posts"
[entries.post_list]
limit = 5
show_more = true
show_more_text = "See archive..."
show_more_url = "posts"
[[entries]]
title = "posts by category"
[entries.post_list]
section = "posts"
show_more = true
show_more_text = "See more posts..."
show_more_url = "posts"
[[entries]]
title = "rss"
url = "index.xml"
[[entries]]
title = "another list"
[[entries.entries]]
title = "with subitems"
[[entries.entries.entries]]
title = "with subsubitems"
[[entries.entries.entries]]
title = "example page"
url = "about"
[[entries]]
title = "PRO TIP"
entries = [
{ title = "to edit this menu, edit data/menu.toml file" }
]

BIN
images/screenshot-both.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
images/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 KiB

BIN
images/screenshot_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 KiB

BIN
images/tn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 KiB

8
layouts/404.html Normal file
View File

@ -0,0 +1,8 @@
{{ define "main" }}
{{- partial "back_link.html" . -}}
<header>
<h1>404 Not Found</h1>
</header>
{{ end }}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body a="{{ $.Site.Params.theme_config.appearance | default "auto" }}">
<main class="page-content" aria-label="Content">
<div class="w">
{{- block "main" . }}{{- end }}
</div>
</main>
</body>
</html>

View File

@ -0,0 +1,8 @@
{{ define "main" }}
{{ partial "back_link.html" .}}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ partial "post_list.html" (dict "context" . "section" .Section)}}
{{ end }}

12
layouts/baseof.html Normal file
View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body a="{{ $.Site.Params.theme_config.appearance | default "auto" }}">
<main class="page-content" aria-label="Content">
<div class="w">
{{- block "main" . }}{{- end }}
</div>
</main>
</body>
</html>

12
layouts/index.html Normal file
View File

@ -0,0 +1,12 @@
{{ define "main" }}
<header>
<h1>{{ $.Site.Title }}</h1>
{{- if $.Site.Params.theme_config.show_description -}}
<p>{{ $.Site.Params.description }}</p>
{{- end -}}
</header>
{{ .Content }}
{{ partial "menu_item.html" (dict "context" . "collection" $.Site.Data.menu.entries) }}
{{ end }}

View File

@ -0,0 +1 @@
<a href="{{ "/" | relURL }}">{{ $.Site.Params.theme_config.back_home_text }}</a>

View File

@ -0,0 +1,20 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
{{ if not .IsHome }}
{{ .Title }}
{{ else }}
{{ $.Site.Title }}
{{ end }}
</title>
<link rel="shortcut icon" type="image/x-icon" href="{{ $.Site.Params.favicon | relURL }}" />
{{ $options := (dict "outputStyle" "compressed" "enableSourceMap" (not hugo.IsProduction)) }}
{{ $sass := resources.Get "css/main.scss" }}
{{ $style := $sass | resources.ToCSS $options }}
<link rel="stylesheet" href="{{ $style.Permalink | relURL }}" />
</head>

View File

@ -0,0 +1,26 @@
<ul>
{{- range $item := .collection -}}
<li>
{{- with $item.url -}}
<a href="{{ $item.url }}">{{ safeHTML $item.title }}</a>
{{- else -}}
{{ safeHTML $item.title }}
{{- end -}}
</li>
{{- if $item.post_list -}}
{{ partial "post_list.html" (dict
"context" .
"section" $item.post_list.section
"limit" $item.post_list.limit
"show_more" $item.post_list.show_more
"show_more_text" $item.post_list.show_more_text
"show_more_url" $item.post_list.show_more_url
) -}}
{{- end -}}
{{- if $item.entries }}
{{ partial "menu_item.html" (dict "context" . "collection" $item.entries) }}
{{- end -}}
{{- end -}}
</ul>

View File

@ -0,0 +1,31 @@
{{- $posts := "" -}}
{{- if .section -}}
{{- $posts = (where site.RegularPages "Section" .section) -}}
{{- else -}}
{{- $posts = site.RegularPages }}
{{- end -}}
{{- $limit_exceeded:= "" -}}
{{- if (and .limit (gt (len $posts) .limit)) -}}
{{- $limit_exceeded = true -}}
{{- else -}}
{{- $limit_exceeded = false -}}
{{ end }}
{{- if (gt (len $posts) 0) }}
{{- if .limit }}
{{ $posts = (first .limit $posts ) }}
{{ end }}
<ul>
{{- range $post := $posts -}}
<li>
<span>{{- ($post.Date | time.Format site.Params.theme_config.date_format) }}</span>
<a href="{{ $post.Permalink }}">{{ $post.Title }}</a>
</li>
{{ end }}
{{- if and .show_more $limit_exceeded }}
<li><a href="{{ .show_more_url }}">{{ .show_more_text | default "Show more..." }}</a></li>
{{ end }}
</ul>
{{ end }}

17
layouts/posts/baseof.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body a="{{ $.Site.Params.theme_config.appearance | default "auto" }}">
<main class="page-content" aria-label="Content">
<div class="w">
{{- block "main" . }}{{- end }}
</div>
</main>
</body>
{{- if .Params.custom_js -}}
{{- range .Params.custom_js -}}
{{ $js := resources.Get (print "js/" . ".js") }}
<script type="text/javascript" src="{{ $js.RelPermalink }}"></script>
{{- end -}}
{{- end -}}
</html>

8
layouts/posts/list.html Normal file
View File

@ -0,0 +1,8 @@
{{ define "main" }}
{{ partial "back_link.html" .}}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ partial "post_list.html" (dict "context" . "section" .Section)}}
{{ end }}

15
layouts/posts/single.html Normal file
View File

@ -0,0 +1,15 @@
{{ define "main" }}
{{ partial "back_link.html" .}}
<article>
<p class="post-meta">
<time datetime="{{ .Date }}">
{{ .Date | time.Format site.Params.theme_config.date_format }}
</time>
</p>
<h1>{{ .Title }}</h1>
{{ .Content }}
</article>
{{ end }}

View File

@ -0,0 +1,13 @@
{{ if .IsNamedParams }}
{{ with .Get "text" }}
<hr data-content='{{ . }}' />
{{ else }}
<hr />
{{ end }}
{{ else }}
{{ with .Get 0 }}
<hr data-content="{{ . }}" />
{{ else }}
<hr />
{{ end }}
{{ end }}

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

21
theme.toml Normal file
View File

@ -0,0 +1,21 @@
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
name = "no-style-please"
license = "MIT"
licenselink = "https://github.com/Masellum/hugo-theme-nostyleplease/blob/main/LICENSE"
description = "a (nearly) no-CSS, fast, minimalist Hugo theme ported from riggraz/no-style-please."
homepage = "https://github.com/Masellum/hugo-theme-nostyleplease"
tags = ["blog", "minimalist"]
features = []
min_version = "0.41.0"
[author]
name = "Masellum"
homepage = "Masellum.github.io"
# If porting an existing theme
[original]
name = "riggraz"
homepage = "https://riggraz.dev/"
repo = "https://github.com/riggraz/no-style-please"