Hugo内容
This commit is contained in:
3
Hugo/.gitignore
vendored
Normal file
3
Hugo/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
public/
|
||||
*.lock
|
||||
_gen/
|
||||
5
Hugo/archetypes/default.md
Normal file
5
Hugo/archetypes/default.md
Normal file
@@ -0,0 +1,5 @@
|
||||
+++
|
||||
date = '{{ .Date }}'
|
||||
draft = true
|
||||
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
|
||||
+++
|
||||
79
Hugo/content/dev/关于代码维护.md
Normal file
79
Hugo/content/dev/关于代码维护.md
Normal file
@@ -0,0 +1,79 @@
|
||||
---
|
||||
draft: true
|
||||
title: 关于代码维护
|
||||
which_category: dev
|
||||
date: 2026-01-22T13:13:00+08:00
|
||||
---
|
||||
|
||||
# 代码维护方式
|
||||
|
||||
较低成本的维护方法就是,局域网内维护,具体方案为局域网内gitlab服务器。
|
||||
|
||||
目前手里有如下硬件(长期运行的):
|
||||
|
||||
- 树莓派5(8G)。
|
||||
- 微型主机(8G,x86_64架构,120G固态)。
|
||||
- 路由器。
|
||||
|
||||
为了使以上3个硬件的相互访问更加便利以及使gitlab的域名固定。树莓派搭建一个DNS服务器,路由器固定树莓派的IP地址,路由器DNS服务器指向树莓派。微型主机作为gitlab的Runner,跑代码的流水线。
|
||||
|
||||
# 安装记录
|
||||
|
||||
下面逐一记录这一块的安装过程。
|
||||
|
||||
## DNS服务器
|
||||
|
||||
先在路由器中固定树莓派地址,本次固定为192.168.0.150。
|
||||
|
||||
sudo apt-get install dnsmasq,安装工具,编辑文件`/etc/dnsmasq.conf`:
|
||||
|
||||
```shell
|
||||
#设置resolv目录
|
||||
resolv-file=/etc/resolv.conf
|
||||
#严格按照从上到下选择dns
|
||||
strict-order
|
||||
#当前机器的ip,如果只想本地访问可以改为127.0.0.1
|
||||
listen-address=192.168.0.150
|
||||
address=/gitlab.cc/192.168.0.150
|
||||
server=8.8.8.8
|
||||
server=114.114.114.114
|
||||
```
|
||||
|
||||
sudo systemctl restart dnsmasq.service,重启服务。
|
||||
|
||||
在路由器中设置首选DNS为192.168.0.150(树莓派地址),重启路由器,然后在其他设备上ping一下设定的域名:
|
||||
|
||||

|
||||
|
||||
## Gitlab
|
||||
|
||||
下载[gitlab/gitlab-ce - Packages · packages.gitlab.com](https://packages.gitlab.com/gitlab/gitlab-ce),本次下载为:gitlab-ce_18.6.4-ce.0_arm64.deb。
|
||||
|
||||
上传到树莓派后进行安装。
|
||||
|
||||

|
||||
|
||||
根据图中的提示,编辑:/etc/gitlab/gitlab.rb,设定 external_url 为 gitlab.cc,然后执行 gitlab-ctl reconfigure,最后执行 gitlab-ctl start。
|
||||
|
||||
邮件配置,参考下方内容:
|
||||
|
||||

|
||||
|
||||
配置结束后,执行 gitlab-ctl reconfigure,执行 sudo gitlab-rails console,执行
|
||||
|
||||
```ruby
|
||||
Notify.test_email('taynpg@163.com', 'test content', 'test').deliver_now
|
||||
```
|
||||
|
||||
类似如下显示,即为成功:
|
||||
|
||||

|
||||
|
||||
### GitRunner
|
||||
|
||||
关于git-runner,windows上有一个关键部分就是,install的时候要传入绝对路径参数。
|
||||
|
||||
```powershell
|
||||
.\gitlab-runner.exe install --working-directory "C:\Bin\RunnerWork" --config "C:\Bin\program\config.toml"
|
||||
```
|
||||
|
||||
61
Hugo/content/yi/关于置润的排法.md
Normal file
61
Hugo/content/yi/关于置润的排法.md
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
draft: true
|
||||
title: 关于置润的排法
|
||||
which_category: qimen
|
||||
date: 2026-01-13T23:00:00+08:00
|
||||
---
|
||||
|
||||
一年四个季节,每个季节三个月。每季的这三个月,头一个称“孟”,第二个月称“仲”,每三个月称“季”。
|
||||
|
||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|
||||
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: |
|
||||
| 甲子 | 乙丑 | 丙寅 | 丁卯 | 戊辰 | 己巳 | 庚午 | 辛未 | 壬申 | 癸酉 |
|
||||
| 甲戌 | 乙亥 | 丙子 | 丁丑 | 戊寅 | 己卯 | 庚辰 | 辛巳 | 壬午 | 癸未 |
|
||||
| 甲申 | 乙酉 | 丙戌 | 丁亥 | 戊子 | 己丑 | 庚寅 | 辛卯 | 壬辰 | 癸巳 |
|
||||
| 甲午 | 乙未 | 丙申 | 丁酉 | 戊戌 | 己亥 | 庚子 | 辛丑 | 壬寅 | 癸卯 |
|
||||
| 甲辰 | 乙巳 | 丙午 | 丁未 | 戊申 | 己酉 | 庚戌 | 辛亥 | 壬子 | 癸丑 |
|
||||
| 甲寅 | 乙卯 | 丙辰 | 丁巳 | 戊午 | 己未 | 庚申 | 辛酉 | 壬戌 | 癸亥 |
|
||||
|
||||
一年二十四个节气,一个月两个节气,一个节气管十五天。依照六十甲子来排,甲子开始到一个节气结束,就来到了己卯,后面以此类推。六十甲子中,一个节气的上元就轮流是`甲子`、`己卯`、`甲午`、`己酉`。
|
||||
|
||||
| | 冬 | 春 | 夏 | 秋 | |
|
||||
| :--------: | :--: | :--: | :--: | :--: | :--: |
|
||||
| 中元头一天 | 亥 | 寅 | 巳 | 申 | 孟 |
|
||||
| 上元头一天 | 子 | 卯 | 午 | 酉 | 仲 |
|
||||
| 下元头一天 | 丑 | 辰 | 未 | 戌 | 季 |
|
||||
|
||||
一个节气上元的头一天,有时在这个节气的前头,有时则落在后头,只在个别情况下和节气是同一天。节气上元头一天称作“符头”。
|
||||
|
||||
节气上元的头一天落到节气的后边,即符头未到而节气先至,这叫“接气”。节气上元的头一天跑到节气的前边,即符头先至而节气未到,这叫“超神”。节气上元的头和节气正好碰到一天,即符头与节气同至,这叫“正授”。
|
||||
|
||||
“超神”在开始时,符头只超过节气一两天,以后逐渐超得越来越多,至超过九天时就要置闰,就是重复一个节气,即把某个节气的上中下三元再重复一次。如在芒种节置闰,芒种上中下三元为阳遁六、三、九局,就是在芒种下元阳遁九局之后,接着最后一天(芒种下元的第五天),按照日辰次序向下排,再安排阳遁六、三、九局,然后才开始夏至上元阴遁九局。置闰的三元称作“闰奇”。
|
||||
|
||||
须要注意的是,并非在哪一个节气中进行。这两个节所就是芒种和大雪,如果不是在这两个节气时,即使超过十天也不能置闰。为什么要放在这两个节气呢?这是因为这两个节气恰在二至之前。阳遁从冬至开始,阴遁从夏至开始,在二至之前的节气置闰,就是在阳遁阴遁开始之前把符头调好,使符头和节气尽量接近,而不致超过过多。
|
||||
|
||||
那么关键点就在大雪和芒种,目前我的方法是,给定一个日期,从该日期去年的大雪起排,排到下一年的春节结束,也就是说推演一年的顺序,为什么要推一年而不是直接判定某个节气和符头,这是因为置润的时候只能在指定的两个节气处理,相当于期间的日期都可能与这两个节气相关,需要处理“超神”、“接气”和“置闰”的动态连续关系。
|
||||
|
||||
## 具体到算法
|
||||
|
||||
这里面一个关键的点只有一个,那就是大雪交节这一天,寻找与符头的关系时,应该算在上一个符头的后面还是算在下一个符头的前面。
|
||||
|
||||
### 节气如何“认领”符头——从“正授”点倒推
|
||||
|
||||
这个认领关系的基准点,就是 “正授” —— 当节气交节之日恰好就是某个“符头”日。在奇门理论中,冬至和夏至这两个至点,理论上应该与“正授“状态最为接近(即尽量让符头与节气同步)。其中:
|
||||
|
||||
- 冬至的理论理想符头是甲子或己卯(阳遁开始)。
|
||||
|
||||
- 夏至的理论理想符头是甲午或己酉(阴遁开始)。
|
||||
|
||||
由于干支纪日与太阳年长度(365.2422天)不成整数倍,真正的“正授”很少见,大部分时间是“超神”或“接气”。向前倒推,建立归属链:大雪是冬至的前一个节气。在“正授”的理想模型下,各节气与其符头的关系链是固定的:冬至(符头假设为 甲子)← 向前推15天(一个节气长度)→ 大雪的符头就应该是甲子之前的那个符头,即己酉。同样,从夏至(符头假设为 己酉)向前推:夏至(符头 己酉)← 向前推15天 → 芒种的符头就应该是己酉之前的那个符头,即甲午。
|
||||
|
||||
这就是为什么“大雪的符头为己酉,芒种的符头为甲午”是规则。 它们是从二至(冬至、夏至)的基准符头,按照三元固定顺序向前倒推15天(一个节气)而得出的固定对应关系。
|
||||
|
||||
所有节气的理论符头可以按照四轮固定循环反推。
|
||||
|
||||
### 算法确定
|
||||
|
||||
这个规则是:
|
||||
|
||||
> **“实际上元符头日”是离“节气日”最近的、满足该节气符头特征(对大雪来说是“甲午”或“己酉”)的那个干支日。**
|
||||
>
|
||||
> **然后,比较“节气日”和“符头日”的先后顺序来判定“超神/接气/正授”。**
|
||||
4
Hugo/hugo.toml
Normal file
4
Hugo/hugo.toml
Normal file
@@ -0,0 +1,4 @@
|
||||
baseURL = 'https://example.org/'
|
||||
languageCode = 'en-us'
|
||||
title = 'TAYNPG'
|
||||
theme = 'nostyleplease'
|
||||
BIN
Hugo/static/images/PixPin_2026-01-23_19-20-56.png
Normal file
BIN
Hugo/static/images/PixPin_2026-01-23_19-20-56.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 290 KiB |
BIN
Hugo/static/images/PixPin_2026-01-23_20-25-07.png
Normal file
BIN
Hugo/static/images/PixPin_2026-01-23_20-25-07.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
BIN
Hugo/static/images/PixPin_2026-01-23_21-38-14.png
Normal file
BIN
Hugo/static/images/PixPin_2026-01-23_21-38-14.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 179 KiB |
BIN
Hugo/static/images/PixPin_2026-01-23_21-42-56.png
Normal file
BIN
Hugo/static/images/PixPin_2026-01-23_21-42-56.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 130 KiB |
20
Hugo/themes/nostyleplease/LICENSE
Normal file
20
Hugo/themes/nostyleplease/LICENSE
Normal 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.
|
||||
85
Hugo/themes/nostyleplease/README.md
Normal file
85
Hugo/themes/nostyleplease/README.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# no style, please!
|
||||
|
||||
<img src="https://raw.githubusercontent.com/hanwenguo/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/hanwenguo/hugo-theme-nostyleplease/main/images/screenshot-both.png" />
|
||||
|
||||
## Features
|
||||
|
||||
* Fast (**under 3kb of CSS!**)
|
||||
* Light, dark and auto modes
|
||||
* Responsive
|
||||
* Content first (typography optimized for maximum readability)
|
||||
* RSS feed (using Hugo's embedded RSS template)
|
||||
* MathJax support
|
||||
* Supporting details HTML tag
|
||||
|
||||
## Installation
|
||||
|
||||
The easiest way is to clone this repo (or add as a submodule) to themes/nostyleplease then append `theme = 'nostyleplease'` as a newline to config.toml. Pages shipped with theme as examples have `draft: true` in their frontmatters, use `--buildDrafts` to build them.
|
||||
|
||||
## 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. Note that the `config.toml` under root directory of your hugo site will completely override the one in the theme directory, so copy the attributes you want to keep or edit from the theme's `config.toml` to your site's `config.toml`.
|
||||
|
||||
### 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`.
|
||||
|
||||
You can also add footer. Just edit ..nostyleplease/layouts/footer.md.
|
||||
### Adding table of contents
|
||||
|
||||
You can add a table of contents by supplying the `toc: true` param to your post front matter. If you want a border around it you can also set `tocBorder: true`. The toc style behavior is handled by Goldmark and the defaults can be found in the `config.toml` file.
|
||||
|
||||
### Posts list group by date in descending order.
|
||||
|
||||
just edit `config.toml` and change `params.theme_config.isListGroupByDate` 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/hanwenguo/hugo-theme-nostyleplease/.
|
||||
|
||||
## Thanks
|
||||
|
||||
Some of the code comes from [wooseopkim/hugo-theme-nostyleplease](https://github.com/wooseopkim/hugo-theme-nostyleplease), a fork of this theme.
|
||||
|
||||
Some of the test pages are from [this jekyll theme](https://github.com/huangyz0918/moving).
|
||||
|
||||
## License
|
||||
|
||||
The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
||||
181
Hugo/themes/nostyleplease/assets/css/main.scss
Normal file
181
Hugo/themes/nostyleplease/assets/css/main.scss
Normal file
@@ -0,0 +1,181 @@
|
||||
// -------------- THEME SWITCHER -------------- //
|
||||
@mixin theme($--bg-color, $--primary-text-color, $--secondary-text-color, $--link-color, $--visited-link-color, $--highlight) {
|
||||
background-color: $--bg-color;
|
||||
|
||||
color: $--primary-text-color;
|
||||
|
||||
a {
|
||||
color: $--link-color;
|
||||
&:visited { color: $--visited-link-color; }
|
||||
}
|
||||
|
||||
details {
|
||||
border: thin solid $--primary-text-color;
|
||||
}
|
||||
|
||||
details summary {
|
||||
color: $--primary-text-color;
|
||||
}
|
||||
|
||||
details[open] summary {
|
||||
border-bottom: 1px solid $--primary-text-color;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: $--bg-color;
|
||||
}
|
||||
|
||||
code:not(pre > code) {
|
||||
background-color: $--primary-text-color;
|
||||
color: $--bg-color;
|
||||
}
|
||||
|
||||
*:target {
|
||||
background: $--highlight;
|
||||
color: $--primary-text-color;
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
border: thin solid $--primary-text-color;
|
||||
}
|
||||
|
||||
.toc {
|
||||
border: thin solid $--primary-text-color;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
figcaption { color: $--secondary-text-color; }
|
||||
|
||||
blockquote {
|
||||
border: thin solid $--primary-text-color;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin dark-appearance {
|
||||
@include theme(#000000, #ffffff, #000000, #79a8ff, #f78fe7, #2f3849); // modus-vivendi
|
||||
}
|
||||
|
||||
@mixin light-appearance {
|
||||
@include theme(#ffffff, #000000, #595959, #3548cf, #8f0075, #dae5ec); // modus-operandi
|
||||
}
|
||||
|
||||
body[a="dark"] { @include dark-appearance; }
|
||||
body[a="light"] { @include light-appearance; }
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body[a="auto"] { @include dark-appearance; }
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
body[a="auto"] { @include light-appearance; }
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
||||
html { height: 100%; }
|
||||
|
||||
body {
|
||||
font-family: monospace;
|
||||
font-size: 16px;
|
||||
line-height: 1.4;
|
||||
margin: 0;
|
||||
min-height: 100%;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
h2, h3, h4, h5, h6 { margin-top: 1.5rem; }
|
||||
|
||||
p { margin: 1rem 0; }
|
||||
|
||||
li { margin: 0.4rem 0; }
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
&:hover { text-decoration: underline; }
|
||||
}
|
||||
|
||||
hr {
|
||||
text-align: center;
|
||||
border: 0;
|
||||
margin: 2rem 0;
|
||||
|
||||
&:before { content: '/////' }
|
||||
&:after { content: attr(data-content) '/////' }
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 1em;
|
||||
overflow-x: auto; /* Fix pre content overflowing parent without scroll bar */
|
||||
}
|
||||
|
||||
table { width: 100%; }
|
||||
|
||||
table, th, td {
|
||||
border-collapse: collapse;
|
||||
padding: 0.4rem;
|
||||
}
|
||||
|
||||
code {
|
||||
text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
-moz-text-size-adjust: 100%;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
code:not(pre > code) {
|
||||
padding: 0.1em 0.2em;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
code.has-jax {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
background: inherit !important;
|
||||
border: none !important;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
padding: 1rem;
|
||||
|
||||
p { margin: 0; }
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
figcaption {
|
||||
text-align: center;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
details {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
details summary {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
details[open] summary {
|
||||
margin-bottom: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.w {
|
||||
max-width: 640px;
|
||||
margin: 0 auto;
|
||||
padding: 4rem 2rem;
|
||||
}
|
||||
|
||||
.toc {
|
||||
padding: 1rem;
|
||||
}
|
||||
9
Hugo/themes/nostyleplease/assets/js/mouse_coords.js
Normal file
9
Hugo/themes/nostyleplease/assets/js/mouse_coords.js
Normal 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}`;
|
||||
});
|
||||
39
Hugo/themes/nostyleplease/config.toml
Normal file
39
Hugo/themes/nostyleplease/config.toml
Normal file
@@ -0,0 +1,39 @@
|
||||
[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
|
||||
|
||||
[markup.tableOfContents]
|
||||
startLevel = 2
|
||||
endLevel = 3
|
||||
ordered = false
|
||||
|
||||
[params]
|
||||
[params.theme_config]
|
||||
appearance = "auto"
|
||||
back_home_text = ".."
|
||||
date_format = "2006-01-02"
|
||||
isListGroupByDate = false
|
||||
isShowFooter = true
|
||||
25
Hugo/themes/nostyleplease/data/menu.toml
Normal file
25
Hugo/themes/nostyleplease/data/menu.toml
Normal file
@@ -0,0 +1,25 @@
|
||||
[[entries]]
|
||||
title = "info"
|
||||
|
||||
[[entries.entries]]
|
||||
title = "github repo"
|
||||
url = "https://github.com/taynpg"
|
||||
|
||||
|
||||
[[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"
|
||||
8
Hugo/themes/nostyleplease/layouts/404.html
Normal file
8
Hugo/themes/nostyleplease/layouts/404.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ define "main" }}
|
||||
|
||||
{{- partial "back_link.html" . -}}
|
||||
|
||||
<header>
|
||||
<h1>404 Not Found</h1>
|
||||
</header>
|
||||
{{ end }}
|
||||
12
Hugo/themes/nostyleplease/layouts/_default/baseof.html
Normal file
12
Hugo/themes/nostyleplease/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ $.Site.LanguageCode }}">
|
||||
{{- 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 }}
|
||||
{{ partial "footer.html" }}
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
8
Hugo/themes/nostyleplease/layouts/_default/list.html
Normal file
8
Hugo/themes/nostyleplease/layouts/_default/list.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ define "main" }}
|
||||
{{ partial "back_link.html" .}}
|
||||
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ .Content }}
|
||||
{{ partial "post_list.html" (dict "context" . "section" .Section)}}
|
||||
{{ end }}
|
||||
21
Hugo/themes/nostyleplease/layouts/_default/single.html
Normal file
21
Hugo/themes/nostyleplease/layouts/_default/single.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{ 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>
|
||||
|
||||
{{ if .Params.toc }}
|
||||
<aside {{ if .Params.tocBorder }} class="toc" {{ end }}>
|
||||
{{ .TableOfContents }}
|
||||
</aside>
|
||||
{{ end }}
|
||||
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
8
Hugo/themes/nostyleplease/layouts/_default/taxonomy.html
Normal file
8
Hugo/themes/nostyleplease/layouts/_default/taxonomy.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ define "main" }}
|
||||
{{ partial "back_link.html" .}}
|
||||
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ .Content }}
|
||||
{{ partial "post_list.html" (dict "context" .)}}
|
||||
{{ end }}
|
||||
8
Hugo/themes/nostyleplease/layouts/_default/term.html
Normal file
8
Hugo/themes/nostyleplease/layouts/_default/term.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ define "main" }}
|
||||
{{ partial "back_link.html" .}}
|
||||
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ .Content }}
|
||||
{{ partial "post_list.html" (dict "context" .)}}
|
||||
{{ end }}
|
||||
1
Hugo/themes/nostyleplease/layouts/footer.md
Normal file
1
Hugo/themes/nostyleplease/layouts/footer.md
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
12
Hugo/themes/nostyleplease/layouts/index.html
Normal file
12
Hugo/themes/nostyleplease/layouts/index.html
Normal 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 }}
|
||||
@@ -0,0 +1 @@
|
||||
<a href="{{ "" | relURL }}">{{ $.Site.Params.theme_config.back_home_text }}</a>
|
||||
11
Hugo/themes/nostyleplease/layouts/partials/footer.html
Normal file
11
Hugo/themes/nostyleplease/layouts/partials/footer.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ if site.Params.theme_config.isShowFooter }}
|
||||
{{ $footerContent := readFile "layouts/footer.md" }}
|
||||
{{ if and $footerContent (ne $footerContent "") }}
|
||||
{{ $footerContent | markdownify }}
|
||||
{{ else }}
|
||||
{{ warnf "layouts/footer.md file is not found or empty. Falling back to default footer." }}
|
||||
<footer class="site-footer">
|
||||
<p>© {{ now.Format "2006" }} {{ site.Title }}</p>
|
||||
</footer>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
22
Hugo/themes/nostyleplease/layouts/partials/head.html
Normal file
22
Hugo/themes/nostyleplease/layouts/partials/head.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
{{ if .IsPage }} <meta name="description" content="{{ .Summary }}"> {{ end }}
|
||||
|
||||
<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 | css.Sass $options | resources.Fingerprint "sha512" }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink | relURL }}" integrity="{{ $style.Data.Integrity }}" />
|
||||
{{ if .Params.mathjax }} {{ partial "mathjax.html" . }} {{ end }}
|
||||
</head>
|
||||
21
Hugo/themes/nostyleplease/layouts/partials/mathjax.html
Normal file
21
Hugo/themes/nostyleplease/layouts/partials/mathjax.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
||||
displayMath: [['$$','$$'], ['\\[', '\\]']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true
|
||||
},
|
||||
options: {
|
||||
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('load', (event) => {
|
||||
document.querySelectorAll("mjx-container").forEach(function(x){
|
||||
x.parentElement.classList += 'has-jax'})
|
||||
});
|
||||
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
|
||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
19
Hugo/themes/nostyleplease/layouts/partials/menu_item.html
Normal file
19
Hugo/themes/nostyleplease/layouts/partials/menu_item.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<ul>
|
||||
{{- range $item := .collection -}}
|
||||
<li>
|
||||
{{- with $item.url -}}
|
||||
<a href="{{ $item.url | relURL }}">{{ safeHTML $item.title }}</a>
|
||||
{{- else -}}
|
||||
{{ safeHTML $item.title }}
|
||||
{{- end -}}
|
||||
</li>
|
||||
|
||||
{{- if $item.entries }}
|
||||
{{ partial "menu_item.html" (dict "context" . "collection" $item.entries) }}
|
||||
{{- end -}}
|
||||
|
||||
{{- 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 -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
39
Hugo/themes/nostyleplease/layouts/partials/post_list.html
Normal file
39
Hugo/themes/nostyleplease/layouts/partials/post_list.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{{- $posts := "" -}}
|
||||
|
||||
{{- if .section -}}
|
||||
{{- $posts = (where site.RegularPages "Section" .section) -}}
|
||||
{{- else -}}
|
||||
{{- if (eq .context.Kind "taxonomy") -}}
|
||||
{{- $posts = .context.Pages -}}
|
||||
{{- else -}}
|
||||
{{- if (eq .context.Kind "term") -}}
|
||||
{{- $posts = .context.Data.Pages -}}
|
||||
{{- else -}}
|
||||
{{- $posts = site.RegularPages }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- 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 | relURL }}">{{ $post.Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{- if and .show_more $limit_exceeded }}
|
||||
<li><a href="{{ .show_more_url | relURL }}">{{ .show_more_text | default "Show more..." }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
25
Hugo/themes/nostyleplease/layouts/posts/baseof.html
Normal file
25
Hugo/themes/nostyleplease/layouts/posts/baseof.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ $.Site.LanguageCode }}">
|
||||
{{- partial "head.html" . -}}
|
||||
<body a="{{ $.Site.Params.theme_config.appearance | default "auto" }}">
|
||||
<main class="page-content" aria-label="Content">
|
||||
<div class="w">
|
||||
<div class="post-meta">
|
||||
{{ partial "back_link.html" .}}
|
||||
<p>
|
||||
<time datetime="{{ .Date }}">
|
||||
{{ .Date | time.Format site.Params.theme_config.date_format }}
|
||||
</time>
|
||||
</p>
|
||||
</div>
|
||||
{{- 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>
|
||||
21
Hugo/themes/nostyleplease/layouts/posts/list.html
Normal file
21
Hugo/themes/nostyleplease/layouts/posts/list.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
<!-- divide post list by year -->
|
||||
{{ if .Site.Params.theme_config.isListGroupByDate }}
|
||||
{{ range .Pages.GroupByDate "2006 Year" }}
|
||||
<p>{{ .Key }}</p>
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ partial "post_list.html" (dict "context" . "section" .Section)}}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
14
Hugo/themes/nostyleplease/layouts/posts/single.html
Normal file
14
Hugo/themes/nostyleplease/layouts/posts/single.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<article>
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ if .Params.toc }}
|
||||
<aside {{ if .Params.tocBorder }} class="toc" {{ end }}>
|
||||
{{ .TableOfContents }}
|
||||
</aside>
|
||||
{{ end }}
|
||||
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,6 @@
|
||||
<details {{ if eq (.Get "open" | default "false") "true" }}open{{ end }}>
|
||||
<summary>
|
||||
{{ .Get "summary" | default "Details:" }}
|
||||
</summary>
|
||||
{{ .Inner | markdownify }}
|
||||
</details>
|
||||
3
Hugo/themes/nostyleplease/layouts/shortcodes/texd.html
Normal file
3
Hugo/themes/nostyleplease/layouts/shortcodes/texd.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<span>
|
||||
$${{ .Get 0 }}$$
|
||||
</span>
|
||||
3
Hugo/themes/nostyleplease/layouts/shortcodes/texi.html
Normal file
3
Hugo/themes/nostyleplease/layouts/shortcodes/texi.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<span>
|
||||
\({{ .Get 0 }}\)
|
||||
</span>
|
||||
BIN
Hugo/themes/nostyleplease/logo.png
Normal file
BIN
Hugo/themes/nostyleplease/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 474 B |
21
Hugo/themes/nostyleplease/theme.toml
Normal file
21
Hugo/themes/nostyleplease/theme.toml
Normal 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"
|
||||
Reference in New Issue
Block a user