mirror of
https://github.com/Dichgrem/Blog.git
synced 2026-02-05 01:21:57 -05:00
Compare commits
14 Commits
c6e6bf3450
...
202d32c8d6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
202d32c8d6 | ||
|
|
30e48b01c1 | ||
|
|
3331e2f3b1 | ||
|
|
02c5b6722d | ||
|
|
782ff23f87 | ||
|
|
2507f3a381 | ||
|
|
663989a328 | ||
|
|
bd91722e17 | ||
|
|
39ec7848aa | ||
|
|
1f827723c0 | ||
|
|
742abf8a37 | ||
|
|
e055808ffe | ||
|
|
fc411e21d8 | ||
|
|
e6869053fe |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: Install Zola
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: zola
|
||||
tool: zola@0.21.0
|
||||
|
||||
- name: Install Pagefind
|
||||
run: |
|
||||
|
||||
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
|
||||
|
||||
Copyright (c) 2025 Dichgrem
|
||||
Copyright (c) 2026 Dichgrem
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
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
|
||||
{name = "Archive", url = "$BASE_URL/archive"},
|
||||
{name = "Weekly", url = "$BASE_URL/weekly"},
|
||||
|
||||
|
||||
{name = "Tags", url = "$BASE_URL/tags"},
|
||||
{name = "Search", url = "$BASE_URL/search"},
|
||||
|
||||
|
||||
{name = "Links", url = "$BASE_URL/links"},
|
||||
{name = "Rss", url = "$BASE_URL/atom.xml"},
|
||||
|
||||
|
||||
{name = "About me", url = "$BASE_URL/about"},
|
||||
# set newtab to true to make the link open in new tab
|
||||
{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系统用于对外使用;
|
||||
- 研究并总结各大代理技术;
|
||||
- 重构家庭数据中心;
|
||||
- 学习一门新的语言并熟悉一种业务;
|
||||
- 控制体重并研究低成本健身;
|
||||
|
||||
@@ -146,6 +146,60 @@ git gc --aggressive --prune=now
|
||||
# 重新推送到github
|
||||
git push --force --mirror
|
||||
```
|
||||
当然这样还是不够智能,因此现在的方法是写一个GitHub Actions:
|
||||
|
||||
```bash
|
||||
name: Blog CI (Zola)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Zola
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: zola
|
||||
|
||||
- name: Install Pagefind
|
||||
run: |
|
||||
wget https://github.com/Pagefind/pagefind/releases/download/v1.4.0/pagefind-v1.4.0-x86_64-unknown-linux-musl.tar.gz
|
||||
tar xvf pagefind-v1.4.0-x86_64-unknown-linux-musl.tar.gz
|
||||
sudo mv pagefind /usr/local/bin/
|
||||
|
||||
- name: Build Zola
|
||||
run: zola build
|
||||
|
||||
- name: Build Pagefind
|
||||
run: pagefind --site public --root-selector body
|
||||
|
||||
- name: Push public to dist
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./public
|
||||
publish_branch: dist
|
||||
force_orphan: true
|
||||
|
||||
```
|
||||
|
||||
这个action会自动在每次commit之后运行,下载zola并使用zola对仓库进行构建,随后构建出public文件夹在dist分支中,并且dist分支只保留一次commit,这样做的好处有:
|
||||
|
||||
- 自动云端构建,无须本地再安装zola;
|
||||
- 构建Public在dist分支,git仓库大小不会膨胀;
|
||||
- 灵活可修改,支持各种框架包括Hugo/Hexo等等.
|
||||
|
||||
> 注意需要在GitHub的仓库设置中的``Actions-General-Workflow permissions``中打开``Read and write permissions``,否则actions无法对仓库进行读写.
|
||||
|
||||
|
||||
## 🔗
|
||||
|
||||
@@ -50,18 +50,16 @@ Enter file in which to save the key (/home/dich/.ssh/id_rsa): /home/dich/.ssh/Gi
|
||||
|
||||
```bash
|
||||
# GitHub
|
||||
|
||||
Host github
|
||||
Host github github.com
|
||||
HostName github.com
|
||||
User git
|
||||
IdentityFile ~/.ssh/Github
|
||||
IdentityFile ~/.ssh/github
|
||||
|
||||
# Gitee
|
||||
|
||||
Host gitee
|
||||
Host gitee gitee.com
|
||||
HostName gitee.com
|
||||
User git
|
||||
IdentityFile ~/.ssh/Gitee
|
||||
IdentityFile ~/.ssh/gitee
|
||||
```
|
||||
|
||||
> 这边的IdentityFile是你的私钥位置,即为不带pub后缀的文件。如果你不想将私钥放在~/.ssh/下,可以查看我的另一篇[博客](https://blog.dich.bid/network-ssh/)
|
||||
@@ -315,5 +313,23 @@ git reset --soft HEAD~1
|
||||
git reset --hard HEAD~1
|
||||
```
|
||||
|
||||
### 教学复习
|
||||
|
||||
```
|
||||
0. 如何配置Git?
|
||||
|
||||
1. 为什么Git协作的时候往往是fork别人的仓库?能不能直接在原仓库里面修改?
|
||||
|
||||
2. fork完如何修改并提交更改?
|
||||
|
||||
3. git clone 的 http 链接和 git 链接有什么不同?
|
||||
|
||||
4. 如何将修改合并到原仓库?
|
||||
|
||||
5. 如何合并发PR?
|
||||
|
||||
6. 如何查看状态和日志
|
||||
```
|
||||
|
||||
---
|
||||
**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.**
|
||||
@@ -1,95 +1,29 @@
|
||||
+++
|
||||
title = "乱七八糟:常用实用快捷键"
|
||||
title = "乱七八糟:VScode那些事"
|
||||
date = 2024-05-23
|
||||
|
||||
[taxonomies]
|
||||
tags = ["乱七八糟"]
|
||||
+++
|
||||
|
||||
前言 在日常使用浏览器时,掌握一些快捷键和技巧可以节省大量时间,提高工作和学习效率。通过学习和实践,能够更加轻松地应对各种网页浏览场景,让浏览器成为工作和学习的得力助手。
|
||||
前言 VScode 素有世界最强IDE之称,有着丰富的插件系统,优秀的图形界面和极快的响应速度,本文介绍VSCode的一些使用技巧。
|
||||
|
||||
<!-- more -->
|
||||
|
||||
## 浏览器快捷键
|
||||
## AI 插件
|
||||
|
||||
### 常用
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|----------------------|------------------|
|
||||
| Ctrl + A | 全选 |
|
||||
| Ctrl + C | 复制 |
|
||||
| Ctrl + X | 剪切 |
|
||||
| Ctrl + V | 粘贴 |
|
||||
| Ctrl + F | 查找 |
|
||||
| Ctrl + Q | 退出 |
|
||||
| Ctrl + T | 新建标签页 |
|
||||
| Ctrl + W | 关闭标签页 |
|
||||
| Ctrl + N | 新建窗口 |
|
||||
| Ctrl + Shift + P | 新建隐私浏览窗口 |
|
||||
|
||||
### 历史
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|-------------------------|----------------------------|
|
||||
| Ctrl + H | 历史侧栏 |
|
||||
| Ctrl + Shift + H | 我的足迹窗口(历史) |
|
||||
| Ctrl + Shift + Del | 清除最近历史记录 |
|
||||
|
||||
### 书签
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|-------------------------------|------------------------------------|
|
||||
| Ctrl + D | 将此页加为书签 |
|
||||
| Ctrl + I | 页面信息 |
|
||||
| Ctrl + Shift + O | 显示全部书签(我的足迹窗口) |
|
||||
| Ctrl + B / Ctrl + Shift + B | 书签侧栏 / 顶栏 |
|
||||
|
||||
### 下载与插件
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|----------------------|----------------|
|
||||
| Ctrl + Shift + Y | 下载 |
|
||||
| Ctrl + Shift + A | 附加组件 / 插件 |
|
||||
|
||||
### 控制台与开发
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|----------------------|------------------|
|
||||
| Ctrl + Shift + K | Web 控制台 |
|
||||
| Ctrl + Shift + C | 查看器 |
|
||||
| Shift + F7 | 样式编辑器 |
|
||||
| Shift + F5 | 分析器 |
|
||||
| Ctrl + Shift + E | 网络 |
|
||||
| Ctrl + U | 页面源码 |
|
||||
| Ctrl + Shift + J | 浏览器控制台 |
|
||||
|
||||
### 标签页与界面
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|-------------------------------|--------------------------|
|
||||
| Ctrl + S | 界面保存 |
|
||||
| Ctrl + + | 放大 |
|
||||
| Ctrl + - | 缩小 |
|
||||
| Ctrl + 0 | 重置缩放 |
|
||||
| Ctrl + K / J | 搜索 |
|
||||
| Ctrl + Home / End | 到文件头 / 尾 |
|
||||
| Ctrl + Page Up | 切换到左边标签页 |
|
||||
| Ctrl + Page Down | 切换到右边标签页 |
|
||||
| Ctrl + Shift + Page Up | 当前标签页左移 |
|
||||
| Ctrl + Shift + Page Down | 当前标签页右移 |
|
||||
|
||||
### 其他操作
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|--------------------|------------------|
|
||||
| Alt + Space | KDE 搜索栏 |
|
||||
| Alt + → / ← | 前进 / 后退 |
|
||||
| Alt + 数字键 | 选择标签页(1–8)|
|
||||
| Alt + M | 静音 |
|
||||
| End | 到达页尾 |
|
||||
| Home | 到达页首 |
|
||||
| F6 | 地址栏 |
|
||||
| 插件名 | 免费 | 付费 | 单模型 | 多模型 | 说明 |
|
||||
| ---------------------------------------------------------------------------------------- | :-----------: | :--------: | :-: | :-: | ------------------------------------------------------- |
|
||||
| **[GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot)** | ✔️(试用 / 学生优惠) | ✔️ | ❌ | ✔️ | 主流 AI 编码助手,支持代码补全和聊天建议。([Visual Studio Marketplace][1]) |
|
||||
| **[GPT (ChatGPT)](https://open-vsx.org/extension/openai/chatgpt)** | ✔️ | ✔️(API 模型) | ❌ | ✔️ | 基于 OpenAI 的 ChatGPT,可做代码解释/对话生成 |
|
||||
| **[Gemini Code Assist](https://open-vsx.org/extension/Google/geminicodeassist)** | ✔️ | ❌ | ❌ | ✔️ | Google Gemini 驱动的智能编码助手 |
|
||||
| **[Claude Code](https://open-vsx.org/extension/Anthropic/claude-code)** | ❓(账户权限) | ✔️ | ❌ | ✔️ | Anthropic Claude 驱动的编码助手 |
|
||||
| **[Cline (claude-dev)](https://open-vsx.org/extension/saoudrizwan/claude-dev)** | ✔️ | ❌ | ❌ | ✔️ | 社区版 Claude 型 AI 编码插件 |
|
||||
| **[CodeGeeX](https://open-vsx.org/extension/AMiner/codegeex)** | ✔️ | ❌ | ❌ | ✔️ | 开源多模型 AI код助手 |
|
||||
| **[OpenCode](https://open-vsx.org/extension/sst-dev/opencode)** | ✔️ | ❌ | ❌ | ✔️ | 多模型聚合,可接多种后端 |
|
||||
| **[Windsurf (Codeium)](https://open-vsx.org/extension/Codeium/codeium)** | ✔️ | ❌ | ❌ | ✔️ | 轻量级 AI 代码补全助手(Codeium 改名) |
|
||||
|
||||
[1]: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot&utm_source=chatgpt.com "GitHub Copilot"
|
||||
|
||||
|
||||
## VS Code 快捷键
|
||||
@@ -302,5 +236,87 @@ tags = ["乱七八糟"]
|
||||
- **函数提示**:
|
||||
- 在悬停窗口上按下 `cmd`:提示函数的实现
|
||||
|
||||
|
||||
## 浏览器快捷键
|
||||
|
||||
### 常用
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|----------------------|------------------|
|
||||
| Ctrl + A | 全选 |
|
||||
| Ctrl + C | 复制 |
|
||||
| Ctrl + X | 剪切 |
|
||||
| Ctrl + V | 粘贴 |
|
||||
| Ctrl + F | 查找 |
|
||||
| Ctrl + Q | 退出 |
|
||||
| Ctrl + T | 新建标签页 |
|
||||
| Ctrl + W | 关闭标签页 |
|
||||
| Ctrl + N | 新建窗口 |
|
||||
| Ctrl + Shift + P | 新建隐私浏览窗口 |
|
||||
|
||||
### 历史
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|-------------------------|----------------------------|
|
||||
| Ctrl + H | 历史侧栏 |
|
||||
| Ctrl + Shift + H | 我的足迹窗口(历史) |
|
||||
| Ctrl + Shift + Del | 清除最近历史记录 |
|
||||
|
||||
### 书签
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|-------------------------------|------------------------------------|
|
||||
| Ctrl + D | 将此页加为书签 |
|
||||
| Ctrl + I | 页面信息 |
|
||||
| Ctrl + Shift + O | 显示全部书签(我的足迹窗口) |
|
||||
| Ctrl + B / Ctrl + Shift + B | 书签侧栏 / 顶栏 |
|
||||
|
||||
### 下载与插件
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|----------------------|----------------|
|
||||
| Ctrl + Shift + Y | 下载 |
|
||||
| Ctrl + Shift + A | 附加组件 / 插件 |
|
||||
|
||||
### 控制台与开发
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|----------------------|------------------|
|
||||
| Ctrl + Shift + K | Web 控制台 |
|
||||
| Ctrl + Shift + C | 查看器 |
|
||||
| Shift + F7 | 样式编辑器 |
|
||||
| Shift + F5 | 分析器 |
|
||||
| Ctrl + Shift + E | 网络 |
|
||||
| Ctrl + U | 页面源码 |
|
||||
| Ctrl + Shift + J | 浏览器控制台 |
|
||||
|
||||
### 标签页与界面
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|-------------------------------|--------------------------|
|
||||
| Ctrl + S | 界面保存 |
|
||||
| Ctrl + + | 放大 |
|
||||
| Ctrl + - | 缩小 |
|
||||
| Ctrl + 0 | 重置缩放 |
|
||||
| Ctrl + K / J | 搜索 |
|
||||
| Ctrl + Home / End | 到文件头 / 尾 |
|
||||
| Ctrl + Page Up | 切换到左边标签页 |
|
||||
| Ctrl + Page Down | 切换到右边标签页 |
|
||||
| Ctrl + Shift + Page Up | 当前标签页左移 |
|
||||
| Ctrl + Shift + Page Down | 当前标签页右移 |
|
||||
|
||||
### 其他操作
|
||||
|
||||
| 快捷键 | 描述 |
|
||||
|--------------------|------------------|
|
||||
| Alt + Space | KDE 搜索栏 |
|
||||
| Alt + → / ← | 前进 / 后退 |
|
||||
| Alt + 数字键 | 选择标签页(1–8)|
|
||||
| Alt + M | 静音 |
|
||||
| End | 到达页尾 |
|
||||
| Home | 到达页首 |
|
||||
| F6 | 地址栏 |
|
||||
|
||||
|
||||
---
|
||||
**Done.**
|
||||
**Done.**
|
||||
@@ -29,46 +29,40 @@ tags = ["综合工程"]
|
||||
|
||||
## 安装软件
|
||||
|
||||
随后安装常用开源软件(KDE环境省略file和wayland)
|
||||
随后安装常用开源软件,KDE环境和Wayland+WM环境安装的包不同:
|
||||
|
||||
```bash
|
||||
# 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
|
||||
|
||||
# tui
|
||||
|
||||
paru -S neovim yazi lazygit btop zellij termshark
|
||||
|
||||
# cli
|
||||
paru -S alacritty fastfetch onefetch starship atuin bat fzf fd ripgrep eza tree android-tools payload-dumper-go-bin nexttrace-bin syncthing aria2
|
||||
|
||||
paru -S alacritty fish fastfetch tealdeer expac fish-autopair fish-pure-prompt fisher onefetch starship atuin bat fzf fd ripgrep eza tree android-tools payload-dumper-go-bin nexttrace-bin syncthing aria2
|
||||
|
||||
|
||||
# file
|
||||
|
||||
paru -S gvfs gvfs-mtp gvfs-afc gvfs-nfs nemo
|
||||
# fish
|
||||
fish tealdeer expac fish-autopair fish-pure-prompt fisher
|
||||
|
||||
# zip
|
||||
|
||||
paru -S peazip
|
||||
|
||||
# Type
|
||||
|
||||
paru -S fcitx5-configtool fcitx5-chinese-addons fcitx5-skin-material fcitx5-im fcitx5-rime
|
||||
|
||||
# Blog
|
||||
|
||||
paru -S zola npm pnpm just go
|
||||
paru -S fcitx5-configtool fcitx5-skin-material fcitx5-rime fcitx5-gtk
|
||||
|
||||
# ttf
|
||||
|
||||
paru -S ttf-jetbrains-mono-nerd
|
||||
|
||||
# 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 ttf-jetbrains-mono-nerd ttf-sarasa-gothic-sc
|
||||
```
|
||||
|
||||
如果使用Wayland+WM方案,需要额外安装以下这些:
|
||||
```bash
|
||||
# Wayland
|
||||
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
|
||||
|
||||
# file
|
||||
paru -S gvfs gvfs-mtp gvfs-afc gvfs-nfs nemo
|
||||
```
|
||||
|
||||
| 分类 | 软件列表 |
|
||||
| ------------ | ------------------------------------------------ |
|
||||
| **窗口管理器** | hyprland |
|
||||
@@ -198,6 +192,47 @@ menuentry "Windows 11 (Manual)" {
|
||||
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虚拟机
|
||||
|
||||
前面我们已经安装了Qemu高性能虚拟机平台和virt-manager用来管理虚拟机的图形界面,随后配置virt-manager并安装Ubuntu-server:
|
||||
|
||||
@@ -76,7 +76,7 @@ Linux有许多不同的发行版,但大致可以分为几个系:
|
||||
|
||||
因此对于Linux而言,文件系统是这样的:
|
||||
|
||||
```shell
|
||||
```bash
|
||||
/ — 根
|
||||
/home — 用户家目录
|
||||
/root — 超级用户的家
|
||||
@@ -114,7 +114,7 @@ Linux有许多不同的发行版,但大致可以分为几个系:
|
||||
|
||||
在Ubuntu的界面中李华看到了一个名为``终端``的应用,输入``apt install neofetch``,就安装成功...不,暂时还没有成功,再次输入``sudo apt install neofetch``,就成功安装了neofetch这个软件,随后我们输入``neofetch``,可以看到系统的一些信息:
|
||||
|
||||
```shell
|
||||
```bash
|
||||
❯ neofetch
|
||||
.-/+oossssoo+/-. dich@uos
|
||||
`:+ssssssssssssssssss+:` --------
|
||||
@@ -376,4 +376,4 @@ Linux 的内核天然支持 **Cgroups** 和 **Namespaces**,这是 **Docker**
|
||||
* **KVM/QEMU:** 内置的高性能虚拟化技术,相比 Windows 的 Hyper-V 或 VMware,性能更好更通用。
|
||||
|
||||
---
|
||||
**Done.**
|
||||
**Done.**
|
||||
|
||||
@@ -130,7 +130,7 @@ bluetoothctl info AA:BB:CC:DD:EE:FF
|
||||
|
||||
交互式步骤(在 `bluetoothctl` 提示符下):
|
||||
|
||||
```text
|
||||
```bash
|
||||
$ bluetoothctl
|
||||
[bluetooth]# power on
|
||||
[bluetooth]# agent on
|
||||
@@ -357,4 +357,4 @@ pamixer --toggle-mute
|
||||
```
|
||||
|
||||
---
|
||||
**Done.**
|
||||
**Done.**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
+++
|
||||
title = "Windows系列(1):系统安装与设置"
|
||||
title = "Windows系列(0):系统安装与设置"
|
||||
date = 2024-05-24
|
||||
|
||||
[taxonomies]
|
||||
@@ -12,7 +12,7 @@ tags = ["Windows"]
|
||||
|
||||
## 总纲
|
||||
|
||||
安装Windows有两种情况:1.在一台全新的电脑上安装;2.想为现有的系统更换版本。本文主要介绍这两种情况。如果只想对现有的系统进行优化,推荐看下一篇的``"Windows系列(2):常用操作与配置"``.
|
||||
安装Windows有两种情况:1.在一台全新的电脑上安装;2.想为现有的系统更换版本。本文主要介绍这两种情况。如果只想对现有的系统进行优化,推荐看下一篇的``"Windows系列(1):常用操作与配置"``.
|
||||
|
||||
**全新安装**
|
||||
- 获得一个Windows的ISO镜像;
|
||||
@@ -1,5 +1,5 @@
|
||||
+++
|
||||
title = "Windows系列(2):常用操作与配置"
|
||||
title = "Windows系列(1):常用操作与配置"
|
||||
date = 2024-05-25
|
||||
|
||||
[taxonomies]
|
||||
@@ -1,5 +1,5 @@
|
||||
+++
|
||||
title = "Windows系列(3):分类与激活"
|
||||
title = "Windows系列(2):分类与激活"
|
||||
date = 2024-05-26
|
||||
|
||||
[taxonomies]
|
||||
@@ -1,6 +1,6 @@
|
||||
+++
|
||||
title = "Windows系列(4):封装与全自动安装"
|
||||
date = 2024-05-29
|
||||
title = "Windows系列(3):封装与全自动安装"
|
||||
date = 2024-05-27
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Windows"]
|
||||
177
content/windows-4-use.md
Normal file
177
content/windows-4-use.md
Normal file
@@ -0,0 +1,177 @@
|
||||
+++
|
||||
title = "Windows系列(4):高效操作与强化"
|
||||
date = 2024-05-28
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Windows"]
|
||||
+++
|
||||
|
||||
前言 本文记载windows下的常用快捷键与PowerShell强化配置.
|
||||
<!-- more -->
|
||||
|
||||
## 快捷键
|
||||
|
||||
高效使用 Windows 的第一步,就是**减少鼠标依赖**。
|
||||
Windows 自身已经内置了大量非常实用的快捷键,只是很多人并没有系统地使用过。
|
||||
|
||||
- **Alt + Tab**
|
||||
在**已打开的窗口之间切换**(经典快捷键)
|
||||
|
||||
- **Win + Tab**
|
||||
打开**任务视图**,可查看所有窗口与虚拟桌面
|
||||
|
||||
- **Alt + F4**
|
||||
关闭当前窗口
|
||||
|
||||
> 在桌面下使用时可弹出关机 / 重启菜单
|
||||
|
||||
- **Win + D**
|
||||
显示桌面 / 恢复窗口
|
||||
|
||||
- **Win + ↑ / ↓ / ← / →**
|
||||
窗口最大化 / 最小化 / 左右分屏
|
||||
|
||||
- **Win + Shift + ← / →**
|
||||
将当前窗口移动到另一个显示器
|
||||
|
||||
---
|
||||
|
||||
### 虚拟桌面
|
||||
|
||||
- **Win + Ctrl + D**
|
||||
新建虚拟桌面
|
||||
|
||||
- **Win + Ctrl + ← / →**
|
||||
在虚拟桌面之间切换
|
||||
|
||||
- **Win + Ctrl + F4**
|
||||
关闭当前虚拟桌面
|
||||
|
||||
---
|
||||
|
||||
### 应用启动与系统
|
||||
|
||||
- **Win**
|
||||
打开开始菜单,直接输入搜索应用
|
||||
|
||||
- **Win + R**
|
||||
打开“运行”窗口
|
||||
|
||||
- **Win + E**
|
||||
打开资源管理器
|
||||
|
||||
- **Win + I**
|
||||
打开系统设置
|
||||
|
||||
- **Win + L**
|
||||
锁屏
|
||||
|
||||
---
|
||||
|
||||
### 截图与录屏
|
||||
|
||||
- **Win + Shift + S**
|
||||
截图(区域 / 窗口 / 全屏)
|
||||
|
||||
- **Win + PrtSc**
|
||||
全屏截图并自动保存
|
||||
|
||||
- **Win + G**
|
||||
打开 Xbox Game Bar,可用于屏幕录制
|
||||
|
||||
---
|
||||
|
||||
### 常用编辑操作
|
||||
|
||||
- **Ctrl + C / V / X**
|
||||
复制 / 粘贴 / 剪切
|
||||
|
||||
- **Ctrl + Z / Y**
|
||||
撤销 / 重做
|
||||
|
||||
- **Ctrl + A**
|
||||
全选
|
||||
|
||||
- **Ctrl + S**
|
||||
保存
|
||||
|
||||
- **Ctrl + F**
|
||||
查找
|
||||
|
||||
- **Ctrl + Shift + Esc**
|
||||
直接打开任务管理器
|
||||
|
||||
|
||||
## 启动器
|
||||
|
||||
有了窗口切换和关闭,还需要打开,这里推荐这两个:
|
||||
- [Flow.Launcher](https://github.com/Flow-Launcher/Flow.Launcher)
|
||||
- [ZeroLaunch-rs](https://github.com/ghost-him/ZeroLaunch-rs)
|
||||
|
||||
现在我们就可以使用``Win+Tab``切换窗口,使用``Alt+F4``关闭窗口,使用``Alt+Space``启动软件.
|
||||
|
||||
## Powershell强化
|
||||
|
||||
要达到类似Linux下``oh-myzsh+atuin+fzf+zoxide+starship``的效果,可以使用以下方法增强:
|
||||
|
||||
- 安装模块
|
||||
```bash
|
||||
winget install junegunn.fzf
|
||||
fzf --version
|
||||
winget install JanDeDobbeleer.OhMyPosh
|
||||
oh-my-posh version
|
||||
winget install ajeetdsouza.zoxide
|
||||
zoxide --version
|
||||
```
|
||||
|
||||
- 导入模块
|
||||
```bash
|
||||
Install-Module PSReadLine -Scope CurrentUser -Force
|
||||
Install-Module posh-git -Scope CurrentUser -Force
|
||||
Install-Module PSFzf -Scope CurrentUser -Force
|
||||
```
|
||||
|
||||
- 写入配置
|
||||
|
||||
首先执行这个命令:
|
||||
```bash
|
||||
notepad $PROFILE
|
||||
```
|
||||
|
||||
在打开的窗口中写入:
|
||||
|
||||
```bash
|
||||
# ---------- PSReadLine ----------
|
||||
Import-Module PSReadLine
|
||||
Set-PSReadLineOption -PredictionSource History
|
||||
Set-PSReadLineOption -PredictionViewStyle InlineView
|
||||
|
||||
# ---------- Git ----------
|
||||
Import-Module posh-git
|
||||
|
||||
# ---------- fzf ----------
|
||||
Import-Module PSFzf
|
||||
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
|
||||
|
||||
# ---------- zoxide ----------
|
||||
Invoke-Expression (& { (zoxide init powershell | Out-String) })
|
||||
|
||||
# ---------- oh-my-posh ----------
|
||||
|
||||
oh-my-posh init pwsh | Invoke-Expression
|
||||
|
||||
# ---------- Bash-style line editing ----------
|
||||
|
||||
# Ctrl+A → 行首
|
||||
Set-PSReadLineKeyHandler -Key Ctrl+a -Function BeginningOfLine
|
||||
# Ctrl+E → 行尾
|
||||
Set-PSReadLineKeyHandler -Key Ctrl+e -Function EndOfLine
|
||||
# Ctrl+U → 删除从光标到行首
|
||||
Set-PSReadLineKeyHandler -Key Ctrl+u -Function BackwardDeleteLine
|
||||
# Ctrl+K → 删除从光标到行尾
|
||||
Set-PSReadLineKeyHandler -Key Ctrl+k -Function ForwardDeleteLine
|
||||
```
|
||||
随后新开启一个PowerShell,可以看到有Git提示,ctrl+R唤起历史,右方向键透明补全的效果.
|
||||
|
||||
---
|
||||
**Done.**
|
||||
@@ -1,6 +1,6 @@
|
||||
+++
|
||||
title = "Windows系列(5):Python开发配置"
|
||||
date = 2024-05-31
|
||||
date = 2024-05-30
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Windows"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
+++
|
||||
title = "Windows系列(6):C/C++开发配置"
|
||||
date = 2024-05-30
|
||||
date = 2024-05-31
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Windows"]
|
||||
|
||||
1
justfile
1
justfile
@@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env -S just --justfile
|
||||
build:
|
||||
zola build && pagefind --site public --root-selector body
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
@font-face {
|
||||
font-family: 'Hack';
|
||||
/* 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-style: normal;
|
||||
font-display: swap;
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
@font-face {
|
||||
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-style: normal;
|
||||
font-display: swap;
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
@font-face {
|
||||
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-style: italic;
|
||||
font-display: swap;
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
@font-face {
|
||||
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-style: italic;
|
||||
font-display: swap;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* -------------------------- */
|
||||
@font-face {
|
||||
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-style: normal;
|
||||
font-display: swap;
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
@font-face {
|
||||
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-style: normal;
|
||||
font-display: swap;
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
@font-face {
|
||||
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-style: italic;
|
||||
font-display: swap;
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
@font-face {
|
||||
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-style: italic;
|
||||
font-display: swap;
|
||||
|
||||
@@ -13,7 +13,7 @@ html {
|
||||
body {
|
||||
margin: 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;
|
||||
line-height: 1.54;
|
||||
background-color: var(--background);
|
||||
@@ -118,7 +118,7 @@ figure {
|
||||
}
|
||||
|
||||
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;
|
||||
background: var(--accent-alpha-20);
|
||||
padding: 1px 6px;
|
||||
@@ -127,7 +127,7 @@ code {
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
||||
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
|
||||
padding: 20px;
|
||||
font-size: .95rem;
|
||||
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") %}
|
||||
|
||||
{{ 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>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -84,8 +84,9 @@
|
||||
</header>
|
||||
{% endblock header %}
|
||||
|
||||
<div class="content">
|
||||
{% block content %}
|
||||
<main>
|
||||
<div class="content">
|
||||
{% block content %}
|
||||
<div class="posts">
|
||||
{%- if paginator %}
|
||||
{%- set show_pages = paginator.pages -%}
|
||||
@@ -122,10 +123,10 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
</div>
|
||||
|
||||
{% block footer %}
|
||||
<footer class="footer">
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% block footer %} <footer class="footer">
|
||||
<div class="footer__inner">
|
||||
{%- if config.extra.copyright_html %}
|
||||
<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 name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<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 }}">
|
||||
|
||||
@@ -24,15 +19,6 @@
|
||||
{% 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 %}
|
||||
|
||||
|
||||
|
||||
18
theme.toml
18
theme.toml
@@ -4,25 +4,7 @@ license = "MIT"
|
||||
homepage = "https://github.com/pawroman/zola-theme-terminimal"
|
||||
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]
|
||||
# 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.
|
||||
# Defaults to blue.
|
||||
# Append -light for light themes, e.g. blue-light
|
||||
|
||||
Reference in New Issue
Block a user