mirror of
https://github.com/Dichgrem/Blog.git
synced 2026-02-05 01:21:57 -05:00
Compare commits
9 Commits
main
...
2507f3a381
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2507f3a381 | ||
|
|
663989a328 | ||
|
|
bd91722e17 | ||
|
|
39ec7848aa | ||
|
|
1f827723c0 | ||
|
|
742abf8a37 | ||
|
|
e055808ffe | ||
|
|
fc411e21d8 | ||
|
|
e6869053fe |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.idea/
|
||||||
|
public
|
||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2025 Dichgrem
|
Copyright (c) 2026 Dichgrem
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
428
Terminimal.md
428
Terminimal.md
@@ -1,428 +0,0 @@
|
|||||||
# Terminimal
|
|
||||||
|
|
||||||
[](https://github.com/pawroman/zola-theme-terminimal/actions/workflows/pages/pages-build-deployment)
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
See the live demo (of the default configuration) here:
|
|
||||||
https://pawroman.github.io/zola-theme-terminimal/
|
|
||||||
|
|
||||||
Tested with Zola v0.17.2. Please note that earlier versions might not work because of breaking changes across Zola versions.
|
|
||||||
|
|
||||||
#### Fork disclaimer
|
|
||||||
|
|
||||||
This theme is a fork (not a port) of "Terminal" Hugo theme
|
|
||||||
by Radosław Kozieł (aka. panr):
|
|
||||||
https://github.com/panr/hugo-theme-terminal
|
|
||||||
|
|
||||||
Many thanks for that outstanding original theme, Radek!
|
|
||||||
|
|
||||||
For more information about this fork and the differences to the original theme, please see:
|
|
||||||
[Changes compared to the original theme](#changes-compared-to-the-original-theme) below.
|
|
||||||
|
|
||||||
## Versioning
|
|
||||||
|
|
||||||
This theme used to be non-versioned, e.g. you'd pull the master branch, and occasionally new features or fixes would
|
|
||||||
be released.
|
|
||||||
|
|
||||||
Starting from version v1.0.0, the project adopted [Semantic Versioning](https://semver.org/).
|
|
||||||
|
|
||||||
Please check the [GitHub releases](https://github.com/pawroman/zola-theme-terminimal/releases) to see a change log
|
|
||||||
and work out if there's any breaking changes.
|
|
||||||
|
|
||||||
## How to start
|
|
||||||
|
|
||||||
Option A: clone the theme directly into your Zola site folder:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ git clone https://github.com/pawroman/zola-theme-terminimal.git themes/terminimal
|
|
||||||
```
|
|
||||||
|
|
||||||
Option B: include it as a git submodule (it's better if you plan to use CI builders):
|
|
||||||
|
|
||||||
```
|
|
||||||
$ git submodule add https://github.com/pawroman/zola-theme-terminimal.git themes/terminimal
|
|
||||||
```
|
|
||||||
|
|
||||||
Then in your `config.toml` set:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
theme = "terminimal"
|
|
||||||
|
|
||||||
# Sass compilation is required
|
|
||||||
compile_sass = true
|
|
||||||
```
|
|
||||||
|
|
||||||
Also see the Zola documentation on using themes:
|
|
||||||
https://www.getzola.org/documentation/themes/installing-and-using-themes/
|
|
||||||
|
|
||||||
## Shortcodes
|
|
||||||
|
|
||||||
The theme adds two custom shortcodes related to image handling.
|
|
||||||
|
|
||||||
### `image`
|
|
||||||
|
|
||||||
Used to show images.
|
|
||||||
|
|
||||||
Required arguments:
|
|
||||||
|
|
||||||
- **`src`**
|
|
||||||
|
|
||||||
Optional arguments:
|
|
||||||
|
|
||||||
- **`alt`**
|
|
||||||
- **`position`** (center \[default\] | left | right)
|
|
||||||
- **`style`**
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```
|
|
||||||
{{ image(src="/img/hello.png", alt="Hello Friend",
|
|
||||||
position="left", style="border-radius: 8px;") }}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `figure`
|
|
||||||
|
|
||||||
Same as `image`, but with a few extra optional arguments:
|
|
||||||
|
|
||||||
- **`caption`** (supports markdown)
|
|
||||||
- **`caption_position`** (center \[default\] | left | right)
|
|
||||||
- **`caption_style`**
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```
|
|
||||||
{{ figure(src="http://rustacean.net/assets/rustacean-flat-gesture.png",
|
|
||||||
style="width: 25%;",
|
|
||||||
position="right",
|
|
||||||
caption_position="left",
|
|
||||||
caption="**Ferris**, the (unofficial) Rust mascot",
|
|
||||||
caption_style="font-style: italic;") }}
|
|
||||||
```
|
|
||||||
|
|
||||||
## OpenGraph
|
|
||||||
|
|
||||||
To add an image to a post, set the `og_image` extra option to the desired image
|
|
||||||
in the same directory of the markdown file:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
og_image = "colocated_image.png"
|
|
||||||
```
|
|
||||||
|
|
||||||
Additionally, for the section pages and for posts to have a fallback image, add
|
|
||||||
`default_og_image` to the `[extra]` section:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
default_og_image = "static/ocean.jpg"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
### Only show the post's description
|
|
||||||
|
|
||||||
On each post you can specify the following:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
description = "test description"
|
|
||||||
|
|
||||||
[extra]
|
|
||||||
show_only_description = true
|
|
||||||
```
|
|
||||||
|
|
||||||
This will render `test description` under this
|
|
||||||
particular post on the homepage instead of a summary.
|
|
||||||
|
|
||||||
### Colors
|
|
||||||
|
|
||||||
Both the accent colors and background colors are
|
|
||||||
configurable.
|
|
||||||
|
|
||||||
By default, both accent and background are set
|
|
||||||
to `blue`.
|
|
||||||
|
|
||||||
To configure menu, add this in `[extra]` section
|
|
||||||
of your `config.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
|
|
||||||
# One of: blue, green, orange, pink, red.
|
|
||||||
# Defaults to blue.
|
|
||||||
# Append -light for light themes, e.g. blue-light
|
|
||||||
# Or append -auto, e.g. blue-auto
|
|
||||||
accent_color = "green"
|
|
||||||
|
|
||||||
# One of: blue, dark, green, orange, pink, red, light, auto
|
|
||||||
# Enabling dark background will also modify primary font color to be darker.
|
|
||||||
# Defaults to accent color (or, if not accent color specified, to blue).
|
|
||||||
background_color = "dark"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Logo text and link
|
|
||||||
|
|
||||||
You can set the "logo" text and what it links to,
|
|
||||||
by modifying `config.toml` like so:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
|
|
||||||
# The logo text - defaults to "Terminimal theme"
|
|
||||||
logo_text = "My blog"
|
|
||||||
|
|
||||||
# The logo link - defaults to base_url.
|
|
||||||
logo_home_link = "/take/me/away!"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Author and copyright
|
|
||||||
|
|
||||||
You can set the footer's copyright author name like this:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
|
|
||||||
# Author name: when specified, modifies the default
|
|
||||||
# copyright text. Apart from author, it will
|
|
||||||
# contain current year and a link to the theme.
|
|
||||||
author = "My Name"
|
|
||||||
```
|
|
||||||
|
|
||||||
If you don't like the default copyright text,
|
|
||||||
you can set it to completely custom HTML:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
|
|
||||||
# Copyright text in HTML format. If specified,
|
|
||||||
# entirely replaces default copyright and author.
|
|
||||||
copyright_html = "My custom <b>copyright</b>"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Menu
|
|
||||||
|
|
||||||
The menu is optional, static (all items are always shown,
|
|
||||||
no matter what the screen size) and fully user-configurable.
|
|
||||||
|
|
||||||
To configure menu, add this in `[extra]` section
|
|
||||||
of your `config.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
|
|
||||||
# menu is enabled by adding menu_items (optional)
|
|
||||||
menu_items = [
|
|
||||||
# each of these is optional, name and url are required
|
|
||||||
# $BASE_URL is going to be substituted by base_url from configuration
|
|
||||||
{name = "blog", url = "$BASE_URL"},
|
|
||||||
|
|
||||||
# tags should only be enabled if you have "tags" taxonomy
|
|
||||||
# see documentation below for more details
|
|
||||||
{name = "tags", url = "$BASE_URL/tags"},
|
|
||||||
{name = "archive", url = "$BASE_URL/archive"},
|
|
||||||
{name = "about me", url = "$BASE_URL/about"},
|
|
||||||
|
|
||||||
# set newtab to true to make the link open in new tab
|
|
||||||
{name = "github", url = "url-to-your-github", newtab = true},
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Tags
|
|
||||||
|
|
||||||
The theme optionally supports tags. To enable them, create
|
|
||||||
a "tags" taxonomy in your `config.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
taxonomies = [
|
|
||||||
{name = "tags"},
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
Enabling tags will create a new `/tags` page, and
|
|
||||||
cause them to show up in `archive` section. Note
|
|
||||||
that you still need to create a menu link to the tags
|
|
||||||
page manually.
|
|
||||||
|
|
||||||
### Pagination
|
|
||||||
|
|
||||||
Pagination is fully supported for post list (main site)
|
|
||||||
and intra-post (you can navigate to earlier and later posts).
|
|
||||||
|
|
||||||
To make sure pagination works properly, you must first configure
|
|
||||||
it in `content/_index.md`:
|
|
||||||
|
|
||||||
```
|
|
||||||
+++
|
|
||||||
# number of pages to paginate by
|
|
||||||
paginate_by = 2
|
|
||||||
|
|
||||||
# sorting order for pagination
|
|
||||||
sort_by = "date"
|
|
||||||
+++
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, tweak the theme's pagination config in `config.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
|
|
||||||
# Whether to show links to earlier and later posts
|
|
||||||
# on each post page (defaults to true).
|
|
||||||
enable_post_view_navigation = true
|
|
||||||
|
|
||||||
# The text shown at the bottom of a post,
|
|
||||||
# before earlier/later post links.
|
|
||||||
# Defaults to "Thanks for reading! Read other posts?"
|
|
||||||
post_view_navigation_prompt = "Read more"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Language code
|
|
||||||
|
|
||||||
Internationalization / translation is not supported
|
|
||||||
but you can set the HTML language code for your
|
|
||||||
site:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
default_language = "en"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Hack font subset
|
|
||||||
|
|
||||||
By default, the theme uses a mixed subset of the Hack font.
|
|
||||||
Normal weight font uses full character set
|
|
||||||
(for Unicode icons and special symbols), but all others
|
|
||||||
(bold, italic etc) use a limited subset.
|
|
||||||
|
|
||||||
This results in much smaller transfer sizes, but the subset
|
|
||||||
might not contain all the Unicode characters you need.
|
|
||||||
|
|
||||||
You can enable full unicode support in `config.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
|
|
||||||
# Use full Hack character set, not just a subset.
|
|
||||||
# Switch this to true if you need full unicode support.
|
|
||||||
# Defaults to false.
|
|
||||||
use_full_hack_font = true
|
|
||||||
```
|
|
||||||
|
|
||||||
Also see [Hack's docs](https://github.com/source-foundry/Hack/blob/master/docs/WEBFONT_USAGE.md).
|
|
||||||
|
|
||||||
### Favicon
|
|
||||||
|
|
||||||
The theme supports adding a global favicon (applies to
|
|
||||||
all pages) to the site:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
# Optional: Global favicon URL and mimetype.
|
|
||||||
# Mimetype defaults to "image/x-icon".
|
|
||||||
# The URL should point at a file located
|
|
||||||
# in your site's "static" directory.
|
|
||||||
favicon = "/favicon.png"
|
|
||||||
favicon_mimetype = "image/png"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Page titles
|
|
||||||
|
|
||||||
The theme allows you to configure how the page titles (the `<title>` elements) are rendered.
|
|
||||||
|
|
||||||
Use `"combined"` to render titles as `"Page title | Main title"`.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
# Optional: Set how <title> elements are rendered.
|
|
||||||
# Values:
|
|
||||||
# - "main_only" -- only the main title (`config.title`) is rendered.
|
|
||||||
# - "page_only" -- only the page title (if defined) is rendered,
|
|
||||||
# falling back to `config.title` if not defined or empty.
|
|
||||||
# - "combined" -- combine like so: "page_title | main_title",
|
|
||||||
# or if page_title is not defined or empty, fall back to `main_title`
|
|
||||||
#
|
|
||||||
# Note that the main (index) page only has the main title.
|
|
||||||
page_titles = "combined"
|
|
||||||
```
|
|
||||||
|
|
||||||
All the configuration options are also described in
|
|
||||||
[`config.toml`](../master/config.toml).
|
|
||||||
|
|
||||||
## Extending
|
|
||||||
|
|
||||||
Each of the templates defines named blocks, so
|
|
||||||
it should be quite easy to customize the most common things.
|
|
||||||
|
|
||||||
For example, if you want to add extra `<meta>` tags to the
|
|
||||||
base template, `index.html`, create file like this in `templates/index.html`:
|
|
||||||
|
|
||||||
```html
|
|
||||||
{% extends "terminimal/templates/index.html" %}
|
|
||||||
|
|
||||||
{% block extra_head %}
|
|
||||||
<meta name="description" content="My awesome website"/>
|
|
||||||
<meta name="keywords" content="Hacking,Programming,Ranting"/>
|
|
||||||
{% endblock %}
|
|
||||||
```
|
|
||||||
|
|
||||||
## How to contribute
|
|
||||||
|
|
||||||
If you spot any bugs or wish to contribute new features, please create a new
|
|
||||||
[Pull Request](https://github.com/pawroman/zola-theme-terminimal/pulls).
|
|
||||||
|
|
||||||
## Changes compared to the original theme
|
|
||||||
|
|
||||||
This theme has been forked from https://github.com/panr/hugo-theme-terminal
|
|
||||||
|
|
||||||
- Slight changes in the layout and styling.
|
|
||||||
- Content has been centered (instead of left-aligned).
|
|
||||||
- The header stripes have been spaced out.
|
|
||||||
- Tweaks to pagination, especially on mobile (small screens).
|
|
||||||
- The post title underline is dashed instead of doubly-dotted.
|
|
||||||
- All links are underlined, as per
|
|
||||||
[Brutalist Web Design Guidelines](https://www.brutalist-web.design/).
|
|
||||||
- Tweaks to header font sizes.
|
|
||||||
- Minor footer tweaks.
|
|
||||||
|
|
||||||
- Absolutely **no JavaScript**.
|
|
||||||
- No JavaScript needed to pre-process anything.
|
|
||||||
Zola with its Sass pre-processor is the only dependency.
|
|
||||||
- There's no menu trigger.
|
|
||||||
- Things load crazy fast, as it's all static content.
|
|
||||||
- Prism.js syntax highlighting is not supported (you can use
|
|
||||||
[Zola's](https://www.getzola.org/documentation/content/syntax-highlighting/)).
|
|
||||||
|
|
||||||
- All references to social media (e.g. Twitter) have been removed.
|
|
||||||
|
|
||||||
- All references to external URLs (e.g. Google CDN) have been removed.
|
|
||||||
This theme's static assets are meant to be served from where it's hosted.
|
|
||||||
|
|
||||||
- [Hack](https://github.com/source-foundry/Hack) is the default font.
|
|
||||||
|
|
||||||
- The default color theme is blue (original uses orange).
|
|
||||||
|
|
||||||
### New features
|
|
||||||
|
|
||||||
- You can pick the accent color as well as background color.
|
|
||||||
There's a new `dark` background. See [Configuration](#configuration)
|
|
||||||
below for details.
|
|
||||||
- Active "section" links will change color indicating the
|
|
||||||
active section. This is all static, done at template level.
|
|
||||||
|
|
||||||
### Features retained from the original
|
|
||||||
|
|
||||||
- 5 color themes, depending on your preference:
|
|
||||||
blue (default), green, orange, pink, red.
|
|
||||||
- The shortcodes `image` and `figure` (See [Shortcodes](#shortcodes)).
|
|
||||||
- Fully responsive.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
Copyright © 2019 Paweł Romanowski (pawroman)
|
|
||||||
|
|
||||||
Original theme: Copyright © 2019 Radosław Kozieł ([@panr](https://twitter.com/panr))
|
|
||||||
|
|
||||||
The theme is released under the MIT License.
|
|
||||||
Check the [license file](../master/LICENSE.md)
|
|
||||||
for more information.
|
|
||||||
|
|
||||||
The license for Hack fonts used is included in
|
|
||||||
[LICENSE-Hack.md](../master/LICENSE-Hack.md).
|
|
||||||
@@ -61,13 +61,13 @@ menu_items = [
|
|||||||
# see documentation below for more details
|
# see documentation below for more details
|
||||||
{name = "Archive", url = "$BASE_URL/archive"},
|
{name = "Archive", url = "$BASE_URL/archive"},
|
||||||
{name = "Weekly", url = "$BASE_URL/weekly"},
|
{name = "Weekly", url = "$BASE_URL/weekly"},
|
||||||
|
|
||||||
{name = "Tags", url = "$BASE_URL/tags"},
|
{name = "Tags", url = "$BASE_URL/tags"},
|
||||||
{name = "Search", url = "$BASE_URL/search"},
|
{name = "Search", url = "$BASE_URL/search"},
|
||||||
|
|
||||||
{name = "Links", url = "$BASE_URL/links"},
|
{name = "Links", url = "$BASE_URL/links"},
|
||||||
{name = "Rss", url = "$BASE_URL/atom.xml"},
|
{name = "Rss", url = "$BASE_URL/atom.xml"},
|
||||||
|
|
||||||
{name = "About me", url = "$BASE_URL/about"},
|
{name = "About me", url = "$BASE_URL/about"},
|
||||||
# set newtab to true to make the link open in new tab
|
# set newtab to true to make the link open in new tab
|
||||||
{name = "My github", url = "https://github.com/Dichgrem", newtab = true},
|
{name = "My github", url = "https://github.com/Dichgrem", newtab = true},
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
+++
|
|
||||||
title = "乱七八糟:2024年度总结"
|
|
||||||
date = 2025-01-04
|
|
||||||
|
|
||||||
[taxonomies]
|
|
||||||
tags = ["乱七八糟"]
|
|
||||||
+++
|
|
||||||
|
|
||||||
前言 又是新的一年,时间流速感觉越来越快了。
|
|
||||||
|
|
||||||
<!-- more -->
|
|
||||||
## 大事记
|
|
||||||
|
|
||||||
- 六月份暑假将家里大翻新,包括水晶头,吊灯,门锁,水龙头等等;
|
|
||||||
- 买了新柜子,房间更有序了;
|
|
||||||
- 和朋友们聚餐;
|
|
||||||
- 采用Mesh进行家庭组网;
|
|
||||||
- 安装了一盏太阳能路灯,院子里更明亮了;
|
|
||||||
- 和父母看电影;
|
|
||||||
- 将博客迁移到新平台,用上亚马逊CDN;
|
|
||||||
- 更换域名,不再续费 .ink;
|
|
||||||
- 使用国家补贴更换电脑,换掉了故障百出的机械革命;
|
|
||||||
- 办理校园网套餐并注销掉旧的电话卡;
|
|
||||||
- 买了一台AX3000路由器并刷成openwrt,绕过校园网检测;
|
|
||||||
- 开了azure虚拟机并研究;
|
|
||||||
- 卖掉了chromebook;
|
|
||||||
- 配置了Qemu虚拟机;
|
|
||||||
- 给父母加装了流量包;
|
|
||||||
- 更换了鼠标,并买了显示器和沙发椅;
|
|
||||||
- 家里更换新热水器;
|
|
||||||
- 修理亲戚家的网络问题;
|
|
||||||
- 在学校和家里两处配备常用药箱;
|
|
||||||
- 将所有设备更换为typec接口;
|
|
||||||
- 整理并精简了RSS订阅源;
|
|
||||||
- 重构了书签结构,增加用途分类;
|
|
||||||
- 用上了Android 15,并使用多种开源软件;
|
|
||||||
- 研究不同的root方案并完美隐藏环境;
|
|
||||||
- 自制养生茶,咖啡和燕麦粥;
|
|
||||||
- 养成跑步习惯;
|
|
||||||
- 使用Deepl api进行翻译学习;
|
|
||||||
- 看Netflix并研究浏览器环境检测;
|
|
||||||
- 搭建Syncthing同步服务器实现三端同步;
|
|
||||||
- 定时备份重要数据;
|
|
||||||
- 学习英语纪录片,每天背单词;
|
|
||||||
|
|
||||||
|
|
||||||
## 成长与反思
|
|
||||||
|
|
||||||
- 谋定而后动,不要冲动消费;
|
|
||||||
- 实践出真知,不要轻易下定论;
|
|
||||||
- 适合自己的才是最好的;
|
|
||||||
- 锻炼自身,早点睡觉,饮食规律是最好的养生;
|
|
||||||
|
|
||||||
|
|
||||||
## 新的一年的目标
|
|
||||||
|
|
||||||
- 在各大SRC平台挖点漏洞;
|
|
||||||
- 封装一个完美的windows系统用于对外使用;
|
|
||||||
- 研究并总结各大代理技术;
|
|
||||||
- 重构家庭数据中心;
|
|
||||||
- 学习一门新的语言并熟悉一种业务;
|
|
||||||
- 控制体重并研究低成本健身;
|
|
||||||
|
|
||||||
@@ -50,18 +50,16 @@ Enter file in which to save the key (/home/dich/.ssh/id_rsa): /home/dich/.ssh/Gi
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# GitHub
|
# GitHub
|
||||||
|
Host github github.com
|
||||||
Host github
|
|
||||||
HostName github.com
|
HostName github.com
|
||||||
User git
|
User git
|
||||||
IdentityFile ~/.ssh/Github
|
IdentityFile ~/.ssh/github
|
||||||
|
|
||||||
# Gitee
|
# Gitee
|
||||||
|
Host gitee gitee.com
|
||||||
Host gitee
|
|
||||||
HostName gitee.com
|
HostName gitee.com
|
||||||
User git
|
User git
|
||||||
IdentityFile ~/.ssh/Gitee
|
IdentityFile ~/.ssh/gitee
|
||||||
```
|
```
|
||||||
|
|
||||||
> 这边的IdentityFile是你的私钥位置,即为不带pub后缀的文件。如果你不想将私钥放在~/.ssh/下,可以查看我的另一篇[博客](https://blog.dich.bid/network-ssh/)
|
> 这边的IdentityFile是你的私钥位置,即为不带pub后缀的文件。如果你不想将私钥放在~/.ssh/下,可以查看我的另一篇[博客](https://blog.dich.bid/network-ssh/)
|
||||||
@@ -315,5 +313,23 @@ git reset --soft HEAD~1
|
|||||||
git reset --hard HEAD~1
|
git reset --hard HEAD~1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 教学复习
|
||||||
|
|
||||||
|
```
|
||||||
|
0. 如何配置Git?
|
||||||
|
|
||||||
|
1. 为什么Git协作的时候往往是fork别人的仓库?能不能直接在原仓库里面修改?
|
||||||
|
|
||||||
|
2. fork完如何修改并提交更改?
|
||||||
|
|
||||||
|
3. git clone 的 http 链接和 git 链接有什么不同?
|
||||||
|
|
||||||
|
4. 如何将修改合并到原仓库?
|
||||||
|
|
||||||
|
5. 如何合并发PR?
|
||||||
|
|
||||||
|
6. 如何查看状态和日志
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
**Done.**
|
**Done.**
|
||||||
|
|||||||
124
content/about-github.md
Normal file
124
content/about-github.md
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
+++
|
||||||
|
title = "乱七八糟:Github的使用"
|
||||||
|
date = 2025-08-24
|
||||||
|
|
||||||
|
[taxonomies]
|
||||||
|
tags = ["乱七八糟"]
|
||||||
|
+++
|
||||||
|
|
||||||
|
前言 对于GitHub,相信我们都不陌生。本文介绍GitHub上许多好用的服务和资源。
|
||||||
|
<!-- more -->
|
||||||
|
|
||||||
|
## Github Gist
|
||||||
|
|
||||||
|
GitHub Gist 是 GitHub 提供的代码片段服务,用来``存放单个或少量文件的代码/文本``(如示例代码、配置片段、日志、临时笔记等)。
|
||||||
|
|
||||||
|
官方说明是
|
||||||
|
|
||||||
|
```
|
||||||
|
Instantly share code, notes, and snippets.
|
||||||
|
```
|
||||||
|
|
||||||
|
和 repo 相同的是,gist 也分为``public``和``private``;
|
||||||
|
|
||||||
|
我们可以从一个简单的书签同步服务来实践:
|
||||||
|
|
||||||
|
1. 创建一个gist,权限为 private; 随后可以看到类似``Dichgrem / gist:37f2ebad89923d49d8854c368d7f5c91``,gist后面这一串就是GistID;
|
||||||
|
|
||||||
|
2. 在这个[界面](https://github.com/settings/tokens)创建一个token,选择开启gist权限;
|
||||||
|
|
||||||
|
3. 安装这个书签同步[浏览器扩展](https://www.github.com/dudor/BookmarkHub);
|
||||||
|
|
||||||
|
3. 将tokens 和 前面的 GistID 复制到这个浏览器扩展中;
|
||||||
|
|
||||||
|
4. 随后可以使用这个插件进行书签同步。
|
||||||
|
|
||||||
|
> 原理:使用浏览器api提取出书签,向 gist 仓库进行上传,gist仓库验证 tokens 后保存,在另一个浏览器中用同样的插件进行下载,即可同步.
|
||||||
|
|
||||||
|
## GitHub Pages
|
||||||
|
|
||||||
|
GitHub Pages 是 GitHub 提供的静态托管服务,常常用于快速部署纯前端网站。
|
||||||
|
|
||||||
|
比如你有一个 Vue 写的网站仓库,在该仓库的``设置-Build and deployment``下,选择source,选择分支,并将public目录部署到GitHub Pages,随后会得到一个类似dichgrem.github.io 的域名,即可看到网站。
|
||||||
|
|
||||||
|
当然你也可以绑定自己的域名,在custom dommain下添加,并在你的dns解析处添加对应的CNAME记录。
|
||||||
|
|
||||||
|
> 具体流程可以参考Hexo的[文档](https://hexo.io/zh-cn/docs/github-pages)
|
||||||
|
|
||||||
|
> GitHub Pages 的限制
|
||||||
|
|
||||||
|
- 不能运行后端代码
|
||||||
|
- 站点大小有限制
|
||||||
|
- 构建和发布有时间限制
|
||||||
|
- 私有仓库 Pages 需要付费计划
|
||||||
|
|
||||||
|
## Github actions
|
||||||
|
|
||||||
|
GitHub Actions 是 GitHub 提供的 CI/CD 与自动化平台,用于``在代码仓库中自动执行任务,比如测试、构建、发布、部署``等。
|
||||||
|
|
||||||
|
听起来有点抽象,实际上就是在仓库的这个位置放入一个yml文件 ``.github/workflows/*.yml``,比如
|
||||||
|
|
||||||
|
```bash
|
||||||
|
name: C Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-run:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Show compiler version
|
||||||
|
run: gcc --version
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: gcc -O2 -Wall -Wextra -std=c11 -o app main.c
|
||||||
|
|
||||||
|
- name: Run
|
||||||
|
run: ./app
|
||||||
|
```
|
||||||
|
|
||||||
|
这个文件的意思就是
|
||||||
|
|
||||||
|
- 触发条件:push / pull_request / 手动触发
|
||||||
|
- actions/checkout@v4:拉取仓库代码
|
||||||
|
- gcc ... main.c:将main.c编译成产物 app
|
||||||
|
- ./app:运行,确保编译出来的程序能执行
|
||||||
|
|
||||||
|
|
||||||
|
把本地的环境迁移到github的runner中,这样做有几个好处:
|
||||||
|
|
||||||
|
- 统一了编译环境,不用考虑开发成员之间的环境区别;
|
||||||
|
- 将构建自动化,开发者可以专注于代码,新人也可以快速上手;
|
||||||
|
- 自动发布到release,极大方便了项目管理;
|
||||||
|
- GitHub Actions提供许多现有的steps,类似乐高积木的体验;
|
||||||
|
|
||||||
|
|
||||||
|
> GitHub Actions的限制
|
||||||
|
|
||||||
|
- public仓库通常没有限制
|
||||||
|
- privat仓库为2,000 分钟,500 MB
|
||||||
|
|
||||||
|
## GitHub Copilot
|
||||||
|
|
||||||
|
从11月起GitHub首页增加了AI对话功能,调用的就是 [GitHub Copilot](https://github.com/features/copilot)。
|
||||||
|
|
||||||
|
GitHub Copilot 是一个 AI 驱动的 智能编码助手,由 GitHub 和 OpenAI 联合开发。可以调用GPT/gemini/Claude等多家模型.
|
||||||
|
|
||||||
|
你可以在vscode中下载copilot插件并使用,它会给你带来自动补全以及按照上下文生成整段代码的功能.
|
||||||
|
|
||||||
|
> 现在copilot已经开源,并且在vscode中自带,直接登录就可以使用,无须手动下载.
|
||||||
|
|
||||||
|
> GitHub Copilot的限制
|
||||||
|
|
||||||
|
- 免费版本约 2,000 次代码自动完成(completions) —— 即 Copilot 在 IDE 里根据你的输入生成代码的次数。
|
||||||
|
- 约 50 次 Copilot Chat 消息 / 会话请求 —— 即和 Copilot Chat 对话或高级问答次数。
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
**Done.**
|
||||||
@@ -34,7 +34,7 @@ tags = ["综合工程"]
|
|||||||
```bash
|
```bash
|
||||||
# gui
|
# gui
|
||||||
|
|
||||||
paru -S floorp-bin keepassxc qemu-full virt-manager materialgram-bin legcord-bin onlyoffice-bin localsend-bin kazumi-bin foliate vlc krita qtscrcpy strawberry oculante obs-studio
|
paru -S floorp-bin keepassxc qemu-full virt-manager materialgram-bin legcord-bin onlyoffice-bin localsend-bin kazumi-bin foliate vlc krita qtscrcpy strawberry oculante obs-studio scx-manager daed
|
||||||
|
|
||||||
# tui
|
# tui
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ paru -S peazip
|
|||||||
|
|
||||||
# Type
|
# Type
|
||||||
|
|
||||||
paru -S fcitx5-configtool fcitx5-chinese-addons fcitx5-skin-material fcitx5-im fcitx5-rime
|
paru -S fcitx5-configtool fcitx5-skin-material fcitx5-rime fcitx5-gtk
|
||||||
|
|
||||||
# Blog
|
# Blog
|
||||||
|
|
||||||
@@ -63,11 +63,12 @@ paru -S zola npm pnpm just go
|
|||||||
|
|
||||||
# ttf
|
# ttf
|
||||||
|
|
||||||
paru -S ttf-jetbrains-mono-nerd
|
paru -S ttf-jetbrains-mono-nerd ttf-sarasa-gothic-sc
|
||||||
|
|
||||||
# Wayland
|
# Wayland
|
||||||
|
|
||||||
paru -S hyprland waybar wofi network-manager-applet swww wl-gammarelay-rs brightnessctl easyeffects wireplumber pipewire blueman wl-clipboard-rs swaync swayosd swappy grim wlogout hyprlock hyprpolkitagent
|
paru -S hyprland waybar network-manager-applet swww wl-gammarelay-rs brightnessctl easyeffects wireplumber pipewire blueman bluez-utils wl-clipboard-rs wl-clip-persist swaync swayosd swappy grim wlogout hyprlock hyprpolkitagent
|
||||||
|
|
||||||
```
|
```
|
||||||
| 分类 | 软件列表 |
|
| 分类 | 软件列表 |
|
||||||
| ------------ | ------------------------------------------------ |
|
| ------------ | ------------------------------------------------ |
|
||||||
@@ -198,6 +199,47 @@ menuentry "Windows 11 (Manual)" {
|
|||||||
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 制服华硕VMD
|
||||||
|
|
||||||
|
华硕的BIOS有一个VMD选项,它的机制是这样的:如果你想安linux,得先关闭VMD;但如果你的windows是出厂自带的,没有重装过,那又得开启VMD,否则无法进入windows;这里记录在不关闭VMD的情况下如何让linux支持它:(以arch linux为例)
|
||||||
|
|
||||||
|
|
||||||
|
先使用这个命令查看磁盘:
|
||||||
|
```
|
||||||
|
> lsblk -f
|
||||||
|
nvme1n1
|
||||||
|
├─nvme1n1p1 vfat FAT32 SYSTEM xxxx-xxxx
|
||||||
|
├─nvme1n1p2 ntfs OS
|
||||||
|
├─nvme1n1p3 ntfs 新加卷
|
||||||
|
├─nvme1n1p4 ntfs 新加卷
|
||||||
|
├─nvme1n1p5 ntfs 新加卷
|
||||||
|
├─nvme1n1p6 ntfs 新加卷
|
||||||
|
nvme0n1
|
||||||
|
├─nvme0n1p1
|
||||||
|
├─nvme0n1p2 ntfs 新加卷
|
||||||
|
└─nvme0n1p3 xfs xxxxxxxxxxxxxx
|
||||||
|
```
|
||||||
|
随后使用以下方法将VMD支持加入initramfs:
|
||||||
|
```
|
||||||
|
## 挂载linux根分区
|
||||||
|
mount /dev/nvme0n1p3 /mnt
|
||||||
|
## 创建boot目录
|
||||||
|
mkdir -p /mnt/boot
|
||||||
|
## 挂载EFI
|
||||||
|
mkdir -p /mnt/boot/EFI
|
||||||
|
mount /dev/nvme1n1p1 /mnt/boot/EFI
|
||||||
|
## Chroot进入已经安装的系统
|
||||||
|
arch-chroot /mnt
|
||||||
|
## 重新生成 initramfs
|
||||||
|
nano /etc/mkinitcpio.conf
|
||||||
|
MODULES=(vmd nvme)
|
||||||
|
mkinitcpio -P
|
||||||
|
## 退出重启
|
||||||
|
exit
|
||||||
|
reboot
|
||||||
|
```
|
||||||
|
|
||||||
## Arch中安装QEMU虚拟机
|
## Arch中安装QEMU虚拟机
|
||||||
|
|
||||||
前面我们已经安装了Qemu高性能虚拟机平台和virt-manager用来管理虚拟机的图形界面,随后配置virt-manager并安装Ubuntu-server:
|
前面我们已经安装了Qemu高性能虚拟机平台和virt-manager用来管理虚拟机的图形界面,随后配置virt-manager并安装Ubuntu-server:
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ Linux有许多不同的发行版,但大致可以分为几个系:
|
|||||||
|
|
||||||
因此对于Linux而言,文件系统是这样的:
|
因此对于Linux而言,文件系统是这样的:
|
||||||
|
|
||||||
```shell
|
```bash
|
||||||
/ — 根
|
/ — 根
|
||||||
/home — 用户家目录
|
/home — 用户家目录
|
||||||
/root — 超级用户的家
|
/root — 超级用户的家
|
||||||
@@ -114,7 +114,7 @@ Linux有许多不同的发行版,但大致可以分为几个系:
|
|||||||
|
|
||||||
在Ubuntu的界面中李华看到了一个名为``终端``的应用,输入``apt install neofetch``,就安装成功...不,暂时还没有成功,再次输入``sudo apt install neofetch``,就成功安装了neofetch这个软件,随后我们输入``neofetch``,可以看到系统的一些信息:
|
在Ubuntu的界面中李华看到了一个名为``终端``的应用,输入``apt install neofetch``,就安装成功...不,暂时还没有成功,再次输入``sudo apt install neofetch``,就成功安装了neofetch这个软件,随后我们输入``neofetch``,可以看到系统的一些信息:
|
||||||
|
|
||||||
```shell
|
```bash
|
||||||
❯ neofetch
|
❯ neofetch
|
||||||
.-/+oossssoo+/-. dich@uos
|
.-/+oossssoo+/-. dich@uos
|
||||||
`:+ssssssssssssssssss+:` --------
|
`:+ssssssssssssssssss+:` --------
|
||||||
@@ -376,4 +376,4 @@ Linux 的内核天然支持 **Cgroups** 和 **Namespaces**,这是 **Docker**
|
|||||||
* **KVM/QEMU:** 内置的高性能虚拟化技术,相比 Windows 的 Hyper-V 或 VMware,性能更好更通用。
|
* **KVM/QEMU:** 内置的高性能虚拟化技术,相比 Windows 的 Hyper-V 或 VMware,性能更好更通用。
|
||||||
|
|
||||||
---
|
---
|
||||||
**Done.**
|
**Done.**
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ bluetoothctl info AA:BB:CC:DD:EE:FF
|
|||||||
|
|
||||||
交互式步骤(在 `bluetoothctl` 提示符下):
|
交互式步骤(在 `bluetoothctl` 提示符下):
|
||||||
|
|
||||||
```text
|
```bash
|
||||||
$ bluetoothctl
|
$ bluetoothctl
|
||||||
[bluetooth]# power on
|
[bluetooth]# power on
|
||||||
[bluetooth]# agent on
|
[bluetooth]# agent on
|
||||||
@@ -357,4 +357,4 @@ pamixer --toggle-mute
|
|||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
**Done.**
|
**Done.**
|
||||||
|
|||||||
1
justfile
1
justfile
@@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env -S just --justfile
|
#!/usr/bin/env -S just --justfile
|
||||||
build:
|
build:
|
||||||
zola build && pagefind --site public --root-selector body
|
zola build && pagefind --site public --root-selector body
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
/* Use full version (not a subset) for unicode icon support */
|
/* Use full version (not a subset) for unicode icon support */
|
||||||
src: url('fonts/hack-regular.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-regular.woff?sha=3114f1256') format('woff');
|
src: url('fonts/hack-regular.woff2') format('woff2'), url('fonts/hack-regular.woff') format('woff');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-bold-subset.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bold-subset.woff?sha=3114f1256') format('woff');
|
src: url('fonts/hack-bold-subset.woff2') format('woff2'), url('fonts/hack-bold-subset.woff') format('woff');
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-italic-subset.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-italic-webfont.woff?sha=3114f1256') format('woff');
|
src: url('fonts/hack-italic-subset.woff2') format('woff2'), url('fonts/hack-italic-webfont.woff') format('woff');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-bolditalic-subset.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bolditalic-subset.woff?sha=3114f1256') format('woff');
|
src: url('fonts/hack-bolditalic-subset.woff2') format('woff2'), url('fonts/hack-bolditalic-subset.woff') format('woff');
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* -------------------------- */
|
* -------------------------- */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-regular.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-regular.woff?sha=3114f1256') format('woff');
|
src: url('fonts/hack-regular.woff2') format('woff2'), url('fonts/hack-regular.woff') format('woff');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-bold.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bold.woff?sha=3114f1256') format('woff');
|
src: url('fonts/hack-bold.woff2') format('woff2'), url('fonts/hack-bold.woff') format('woff');
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-italic.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-italic.woff?sha=3114f1256') format('woff');
|
src: url('fonts/hack-italic.woff2') format('woff2'), url('fonts/hack-italic.woff') format('woff');
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Hack';
|
font-family: 'Hack';
|
||||||
src: url('fonts/hack-bolditalic.woff2?sha=3114f1256') format('woff2'), url('fonts/hack-bolditalic.woff?sha=3114f1256') format('woff');
|
src: url('fonts/hack-bolditalic.woff2') format('woff2'), url('fonts/hack-bolditalic.woff') format('woff');
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ html {
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
line-height: 1.54;
|
line-height: 1.54;
|
||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
@@ -118,7 +118,7 @@ figure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
||||||
font-feature-settings: normal;
|
font-feature-settings: normal;
|
||||||
background: var(--accent-alpha-20);
|
background: var(--accent-alpha-20);
|
||||||
padding: 1px 6px;
|
padding: 1px 6px;
|
||||||
@@ -127,7 +127,7 @@ code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
font-size: .95rem;
|
font-size: .95rem;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
{% if src %}
|
|
||||||
<figure class="{% if position %}{{ position }}{% else -%} center {%- endif %}" >
|
|
||||||
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %}{% if style %} style="{{ style }}"{% endif %} decoding="async" loading="lazy"/>
|
|
||||||
{% if caption %}
|
|
||||||
<figcaption class="{% if caption_position %}{{ caption_position }}{% else -%} center {%- endif %}"{% if caption_style %} style="{{ caption_style | safe }}"{% endif %}>{{ caption | markdown() | safe }}</figcaption>
|
|
||||||
{% endif %}
|
|
||||||
</figure>
|
|
||||||
{% endif %}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{% if src %}
|
|
||||||
{# If the image's URL is internal to the site... #}
|
|
||||||
{% if src is not starting_with("http") %}
|
|
||||||
{# ... then prepend the site's base URL to the image's URL. #}
|
|
||||||
{% set src = config.base_url ~ src %}
|
|
||||||
{% endif %}
|
|
||||||
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %} class="{% if position %}{{ position }}{% else -%} center {%- endif %}" {%- if style %} style="{{ style | safe }}" {%- endif %} decoding="async" loading="lazy"/>
|
|
||||||
{% endif %}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
{% extends "index.html" %}
|
|
||||||
|
|
||||||
{%- block title -%}
|
|
||||||
{{ title_macros::title(page_title="Tags", main_title=config.title) }}
|
|
||||||
{%- endblock -%}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="post">
|
|
||||||
<h1 class="post-title">all tags</h1>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
{% for term in terms %}
|
|
||||||
<li class="tag-list">
|
|
||||||
<a href="{{ term.permalink | safe }}">
|
|
||||||
{{ term.name }} ({{ term.pages | length }} post{{ term.pages | length | pluralize }})
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
{% extends "index.html" %}
|
|
||||||
|
|
||||||
{%- block title -%}
|
|
||||||
{% set title = "Tag: " ~ term.name %}
|
|
||||||
{{ title_macros::title(page_title=title, main_title=config.title) }}
|
|
||||||
{%- endblock -%}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="post">
|
|
||||||
<h1 class="post-title">
|
|
||||||
tag: #{{ term.name }}
|
|
||||||
({{ term.pages | length }} post{{ term.pages | length | pluralize }})
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<a href="{{ config.base_url | safe }}/tags/">
|
|
||||||
Show all tags
|
|
||||||
</a>
|
|
||||||
|
|
||||||
{{ post_macros::list_posts(pages=term.pages) }}
|
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
|
||||||
@@ -10,6 +10,22 @@
|
|||||||
|
|
||||||
{% set section = get_section(path="_index.md") %}
|
{% set section = get_section(path="_index.md") %}
|
||||||
|
|
||||||
{{ post_macros::list_posts(pages=section.pages) }}
|
{% set pages_by_year = section.pages | group_by(attribute="year") %}
|
||||||
|
{%- for year, pages_in_year in pages_by_year %}
|
||||||
|
<h2 class="year-divider">{{ year }}</h2>
|
||||||
|
<ul>
|
||||||
|
{%- for page in pages_in_year %}
|
||||||
|
{%- if page.draft %}
|
||||||
|
{% continue %}
|
||||||
|
{% endif -%}
|
||||||
|
<li class="post-list">
|
||||||
|
<a href="{{ page.permalink | safe }}">
|
||||||
|
<span class="post-date">{{ page.date }}</span>
|
||||||
|
:: <span class="post-list-title">{{ page.title }}</span></a>
|
||||||
|
{{ post_macros::tags(page=page, short=true) }}
|
||||||
|
</li>
|
||||||
|
{%- endfor %}
|
||||||
|
</ul>
|
||||||
|
{%- endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -84,8 +84,9 @@
|
|||||||
</header>
|
</header>
|
||||||
{% endblock header %}
|
{% endblock header %}
|
||||||
|
|
||||||
<div class="content">
|
<main>
|
||||||
{% block content %}
|
<div class="content">
|
||||||
|
{% block content %}
|
||||||
<div class="posts">
|
<div class="posts">
|
||||||
{%- if paginator %}
|
{%- if paginator %}
|
||||||
{%- set show_pages = paginator.pages -%}
|
{%- set show_pages = paginator.pages -%}
|
||||||
@@ -122,10 +123,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
</div>
|
</div>
|
||||||
|
</main>
|
||||||
{% block footer %}
|
|
||||||
<footer class="footer">
|
{% block footer %} <footer class="footer">
|
||||||
<div class="footer__inner">
|
<div class="footer__inner">
|
||||||
{%- if config.extra.copyright_html %}
|
{%- if config.extra.copyright_html %}
|
||||||
<div class="copyright copyright--user">{{ config.extra.copyright_html | safe }}</div>
|
<div class="copyright copyright--user">{{ config.extra.copyright_html | safe }}</div>
|
||||||
|
|||||||
@@ -4,11 +4,6 @@
|
|||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="robots" content="noodp"/>
|
<meta name="robots" content="noodp"/>
|
||||||
<!-- 字体预加载 - 减少布局偏移 CLS -->
|
|
||||||
<link rel="preload" href="{{ get_url(path='fonts/hack-regular.woff2?sha=3114f1256') }}" as="font" type="font/woff2" crossorigin>
|
|
||||||
<link rel="preload" href="{{ get_url(path='fonts/hack-bold.woff2?sha=3114f1256') }}" as="font" type="font/woff2" crossorigin>
|
|
||||||
<link rel="preload" href="{{ get_url(path='fonts/hack-italic.woff2?sha=3114f1256') }}" as="font" type="font/woff2" crossorigin>
|
|
||||||
<link rel="preload" href="{{ get_url(path='fonts/hack-bolditalic.woff2?sha=3114f1256') }}" as="font" type="font/woff2" crossorigin>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{ get_url(path="style.css", trailing_slash=false) | safe }}">
|
<link rel="stylesheet" href="{{ get_url(path="style.css", trailing_slash=false) | safe }}">
|
||||||
|
|
||||||
@@ -24,15 +19,6 @@
|
|||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
{%- if config.extra.use_full_hack_font == "exo2" %}
|
|
||||||
<link rel="stylesheet" href="{{ get_url(path="font-exo2.css", trailing_slash=false) | safe }}">
|
|
||||||
<link rel="stylesheet" href="{{ get_url(path="font-hack.css", trailing_slash=false) | safe }}">
|
|
||||||
{%- elif config.extra.use_full_hack_font %}
|
|
||||||
<link rel="stylesheet" href="{{ get_url(path="font-hack.css", trailing_slash=false) | safe }}">
|
|
||||||
{% else %}
|
|
||||||
<link rel="stylesheet" href="{{ get_url(path="font-hack-subset.css", trailing_slash=false) | safe }}">
|
|
||||||
{% endif -%}
|
|
||||||
|
|
||||||
{% endmacro head %}
|
{% endmacro head %}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
18
theme.toml
18
theme.toml
@@ -4,25 +4,7 @@ license = "MIT"
|
|||||||
homepage = "https://github.com/pawroman/zola-theme-terminimal"
|
homepage = "https://github.com/pawroman/zola-theme-terminimal"
|
||||||
min_version = "0.11.0"
|
min_version = "0.11.0"
|
||||||
|
|
||||||
# An optional live demo URL
|
|
||||||
#demo = "https://pawroman.github.io/zola-theme-terminimal/"
|
|
||||||
|
|
||||||
[author]
|
|
||||||
name = "Dichgrem"
|
|
||||||
homepage = "https://github.com/Dichgrem"
|
|
||||||
|
|
||||||
# The original theme this one's been forked off.
|
|
||||||
[original]
|
|
||||||
author = "Dichgrem"
|
|
||||||
homepage = "https://github.com/Dichgrem"
|
|
||||||
#repo = "https://github.com/panr/hugo-theme-terminal"
|
|
||||||
|
|
||||||
[extra]
|
[extra]
|
||||||
# Author name: when specified, modifies the default
|
|
||||||
# copyright text. Apart from author, it will
|
|
||||||
# contain current year and a link to the theme.
|
|
||||||
author = "Dichgrem"
|
|
||||||
|
|
||||||
# One of: blue, green, orange, pink, red.
|
# One of: blue, green, orange, pink, red.
|
||||||
# Defaults to blue.
|
# Defaults to blue.
|
||||||
# Append -light for light themes, e.g. blue-light
|
# Append -light for light themes, e.g. blue-light
|
||||||
|
|||||||
Reference in New Issue
Block a user