-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
320 lines (261 loc) · 34.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!DOCTYPE html><html lang="zh-CN" data-theme="dark"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Aj002Th的奇思乱想</title><meta name="author" content="Aj002Th"><meta name="copyright" content="Aj002Th"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#0d0d0d"><meta name="description" content="此间的博文大抵有两类,一种是水的,另一种仍是水的罢。 —— 鲁迅">
<meta property="og:type" content="website">
<meta property="og:title" content="Aj002Th的奇思乱想">
<meta property="og:url" content="https://aj002th.github.io/">
<meta property="og:site_name" content="Aj002Th的奇思乱想">
<meta property="og:description" content="此间的博文大抵有两类,一种是水的,另一种仍是水的罢。 —— 鲁迅">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://aj002th.github.io/config/img/avatar.png">
<meta property="article:author" content="Aj002Th">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://aj002th.github.io/config/img/avatar.png"><link rel="shortcut icon" href="/config/img/favicon.png"><link rel="canonical" href="https://aj002th.github.io/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: {"path":"/search.xml","preload":false,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"找不到您查询的内容:${query}","hits_stats":"共找到 ${hits} 篇文章"}},
translate: undefined,
noticeOutdate: {"limitDay":500,"position":"top","messagePrev":"It has been","messageNext":"days since the last update, the content of the article may be outdated."},
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
copy: {
success: '复制成功',
error: '复制错误',
noSupport: '浏览器不支持'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '',
dateSuffix: {
just: '刚刚',
min: '分钟前',
hour: '小时前',
day: '天前',
month: '个月前'
},
copyright: undefined,
lightbox: 'fancybox',
Snackbar: undefined,
infinitegrid: {
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
buttonText: '加载更多'
},
isPhotoFigcaption: false,
islazyload: false,
isAnchor: false,
percent: {
toc: true,
rightside: false,
},
autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'Aj002Th的奇思乱想',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2024-08-27 20:42:08'
}</script><script>(win=>{
win.saveToLocal = {
set: (key, value, ttl) => {
if (ttl === 0) return
const now = Date.now()
const expiry = now + ttl * 86400000
const item = {
value,
expiry
}
localStorage.setItem(key, JSON.stringify(item))
},
get: key => {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = Date.now()
if (now > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}
Object.keys(attr).forEach(key => {
script.setAttribute(key, attr[key])
})
document.head.appendChild(script)
})
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = url
if (id) link.id = id
link.onerror = reject
link.onload = link.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
link.onload = link.onreadystatechange = null
resolve()
}
document.head.appendChild(link)
})
win.activateDarkMode = () => {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
win.activateLightMode = () => {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
const t = saveToLocal.get('theme')
if (t === 'dark') activateDarkMode()
else if (t === 'light') activateLightMode()
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
if (asideStatus === 'hide') {
document.documentElement.classList.add('hide-aside')
} else {
document.documentElement.classList.remove('hide-aside')
}
}
const detectApple = () => {
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
document.documentElement.classList.add('apple')
}
}
detectApple()
})(window)</script><link rel="stylesheet" href="/config/css/my.css"><meta name="generator" content="Hexo 7.2.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/config/img/avatar.png" onerror="onerror=null;src='/config/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">11</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">14</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page fixed" id="page-header" style="background-image: url('/config/img/index_img.png')"><nav id="nav"><span id="blog-info"><a href="/" title="Aj002Th的奇思乱想"><span class="site-name">Aj002Th的奇思乱想</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">Aj002Th的奇思乱想</h1><div id="site-subtitle"><span id="subtitle"></span></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/vscode-debugger-launch/" title="vscode中的debug配置">vscode中的debug配置</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-08-27T08:20:00.000Z" title="发表于 2024-08-27 16:20:00">2024-08-27</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AE%9E%E8%B7%B5%E8%AE%B0%E5%BD%95/">实践记录</a></span></div><div class="content">vscode 是可定制化程度非常高的编辑器,可玩性很高的同时也带来了一定的门槛
本文以 Go 语言程序为例子介绍实现想要实现如下的功能要如何配置 launch.json
需要带命令行参数进行调试
需要控制台持续输入进行调试
需要同时调试多个进程
vscode 需要带命令行参数进行调试配置 args 参数,数组中的每个元素会以此放在启动命令后
1234567891011121314151617{ "version": "0.2.0", "configurations": [ { "name": "Launch Package", "type": "go", "request": "launch", "mode& ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/git-revoke-all-in-one/" title="git 中的各种撤销操作">git 中的各种撤销操作</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-07-09T08:57:00.000Z" title="发表于 2024-07-09 16:57:00">2024-07-09</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%80%9A%E7%94%A8%E7%9F%A5%E8%AF%86/">通用知识</a></span></div><div class="content">工作区回滚:文件修改错误使用 git checkout 命令
1234# 查看指定文件的历史版本$ git log <filename># 回滚到指定commitID$ git checkout <commitID> <filename>
暂存区回滚:git add 添加了多余文件这样的错误是由于直接 go add . 一把梭,把当前目录所有文件都暂存了,不小心就会提交其他文件
撤销操作
12345678# 先看一下add 中的文件git status # 如果后面什么都不跟的话 就是上一次add 里面的全部撤销了 ,HEAD 可以不写,直接git resetgit reset HEAD# 就是对某个文件进行撤销了,HEAD 可以不写,直接git reset XX文件git reset HEAD XXX/XXX/XXX.java
本地仓库回滚:git commit 了错误文件如果不小心 弄错了 git add后 , 又 git commit 了,但还没push到远程。
先使用 git log 查看 commit 节点的信息,关 ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/git-basic-cheatsheet/" title="Git Basic CheatSheet">Git Basic CheatSheet</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-07-09T08:02:00.000Z" title="发表于 2024-07-09 16:02:00">2024-07-09</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%80%9A%E7%94%A8%E7%9F%A5%E8%AF%86/">通用知识</a></span></div><div class="content">01 Git configurationSet the name that will be attached to your commits and tags.
1git config --global user.name "Your Name"
Set the e-mail address that will be attached to your commits and tags.
1git config --global user.email "you@example.com"
Enable some colorization of Git output.
1git config --global color.ui auto
02 Starting a projectCreate a new local repository in the current directory. If [project name] is provided, Git will create a new directory named [proj ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/bash-basic-cheatsheet/" title="Bash Basic CheatSheet">Bash Basic CheatSheet</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-06-16T17:15:00.000Z" title="发表于 2024-06-17 01:15:00">2024-06-17</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%80%9A%E7%94%A8%E7%9F%A5%E8%AF%86/">通用知识</a></span></div><div class="content">BashShebangSpecial comment, specifies that the file is a script and calls a certain interpreter (i.e., bash, sh, python)
1234567#!/bin/bash#!/bin/sh#!/usr/bin/env python#!/usr/bin/python
CommentsUse a pound/sharp/hashtag without a ! to write comments
1# This is a comment
Variablesshell variables
Whitespace matters!
Use $VAR to output the value of variable VAR
Display text with echo
12NAME="value"echo "$NAME"
Types? What types?
Bash variables are untyped
Opera ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/docker-basic-cheatsheet/" title="Docker Basic CheatSheet">Docker Basic CheatSheet</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-06-16T16:20:00.000Z" title="发表于 2024-06-17 00:20:00">2024-06-17</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%80%9A%E7%94%A8%E7%9F%A5%E8%AF%86/">通用知识</a></span></div><div class="content">Basic Commands:Container Lifecycle:docker run: Create and start a container.
1$ docker run -d -name my_container nginx
docker start/stop/restart: Start, stop, or restart a container.
123$ docker stop my_container$ docker start my_container$ docker restart my_container
docker ps: List running containers.
1$ docker ps
docker ps -a: List all containers (including stopped ones).
1$ docker ps -a
Image Management:docker pull: Fetch an image from a registry.
1$ docker pull ubuntu
do ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/sync-mutex/" title="sync.Mutex:标准库的互斥锁实现">sync.Mutex:标准库的互斥锁实现</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2023-12-15T15:30:00.000Z" title="发表于 2023-12-15 23:30:00">2023-12-15</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%BA%90%E7%A0%81%E5%AD%A6%E4%B9%A0/">源码学习</a></span></div><div class="content">是什么sync.Mutex 是 go 原生提供的互斥锁实现,也是最基本的同步原语了
合理利用锁即可避免并发编程中由于竞争引发的一些逻辑错误
Quick Startsync.Mutex 对外暴露的接口有三个
sync.Mutex.Lock 请求锁,如果锁忙,则阻塞。
sync.Mutex.TryLock 请求锁,如果锁忙则,则返回 false。这是非阻塞的获取锁的方式。
sync.Mutex.Unlock 释放锁
一个简单的例子:
123456789101112131415161718192021package mainimport ( "sync" "time")func main() { var m sync.Mutex cnt := 0 for i := 0; i < 10; i++ { go func() { m.Lock() cnt++ m.Unlock() }() } time.Sleep(time.Second) // 保证所有协程执行完 fmt.Print ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/sync-once/" title="sync.Once: 执行且仅仅执行一次动作">sync.Once: 执行且仅仅执行一次动作</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2023-12-12T10:35:00.000Z" title="发表于 2023-12-12 18:35:00">2023-12-12</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%BA%90%E7%A0%81%E5%AD%A6%E4%B9%A0/">源码学习</a></span></div><div class="content">是什么sync.Once 是 Go 语言中的一种同步原语,用于确保某个操作或函数在并发环境下只被执行一次。
它只有一个导出的方法,即 Do,该方法接收一个函数参数。在 Do 方法被调用后,该函数将被执行,而且只会执行一次,即使在多个协程同时调用的情况下也是如此。
解决了什么问题对于同一个 sync.Once 实例,可以确保通过调用 Do 执行传入 Do 中的方法,执行且仅执行一次
主要用于以下场景
单例模式:确保全局只有一个实例对象,避免重复创建资源
延迟初始化:在程序运行过程中需要用到某个资源时,通过 sync.Once 动态地初始化该资源
只执行一次的操作:例如只需要执行一次的配置加载、数据清理等操作
Quick Start创建和使用
12345678910once := sync.Once{}for i := 0; i < 10; i++ { go func() { once.Do(func(){ fmt.Println("hello") }) }()}time. ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/lumberjack/" title="lumberjack: 滚动日志源码走读">lumberjack: 滚动日志源码走读</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2023-12-12T01:39:00.000Z" title="发表于 2023-12-12 09:39:00">2023-12-12</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%BA%90%E7%A0%81%E5%AD%A6%E4%B9%A0/">源码学习</a></span></div><div class="content">是什么Lumberjack 是一个用于将日志写入滚动文件的 Go 包,旨在成为日志系统基础设施的一部分。它不是一个一体化的解决方案,而是日志记录堆栈底部的一个可插入组件,仅控制写入日志的文件。
解决了什么问题
无侵入式的日志切割
关注点分离:只关注日志的文件管理
Quick Start1234567log.SetOutput(&lumberjack.Logger{ Filename: "/var/log/myapp/foo.log", MaxSize: 500, // megabytes MaxBackups: 3, MaxAge: 28, //days Compress: true, // disabled by default})
只需使用 *lumberjack.Looger 结构作为 io.WriteCloser 的实现替代例如 os.File 结构等,传入各类日志 logger 的配置中作为输出目标,即可将日志写入滚动文件
日志文件分割:日志文件大小超过限制,将日志归档 ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/ants/" title="ants: 协程池源码学习">ants: 协程池源码学习</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2023-12-08T05:07:00.000Z" title="发表于 2023-12-08 13:07:00">2023-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%BA%90%E7%A0%81%E5%AD%A6%E4%B9%A0/">源码学习</a></span></div><div class="content">是什么ants是一个高性能的 goroutine 池,实现了对大规模 goroutine 的调度管理、goroutine 复用,允许使用者在开发并发程序的时候限制 goroutine 数量,复用资源,达到更高效执行任务的效果。
解决了什么问题
提升性能:主要面向一类场景,大批量轻量级并发任务,任务执行成本与协程创建/销毁成本量级接近
并发资源控制:研发能够明确系统全局并发度以及各个模块的并发度上限
协程生命周期控制:实时查看当前全局并发的协程数量;有一个统一的紧急入口释放全局协程
带来的价值:
限制并发的 goroutine 数量
复用 goroutine,减轻 runtime 调度压力,提升程序性能
规避过多的 goroutine 侵占系统资源(CPU&内存)
Quick Start创建 goroutine 池
1pool, _ := ants.NewPool(100)
提交任务
123ants.Submit(func(){ // do something})
动态调整容量
12pool.Tune(1000) // Tune its ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/build-blog-hugo/" title="hugo + github pages: 零成本自建技术博客">hugo + github pages: 零成本自建技术博客</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2023-12-08T03:56:00.000Z" title="发表于 2023-12-08 11:56:00">2023-12-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AE%9E%E8%B7%B5%E8%AE%B0%E5%BD%95/">实践记录</a></span></div><div class="content">方案选择github pages 提供博客站点 + hugo 提供博客模板 + github actions 自动构建和发布
part 1 : Github Pages官网:GitHub Pages
选择 github pages 的优点就是 github 使用频率高,并且作为全球最大的代码托管平台,也很稳定,即使是免费提供使用也不用担心跑路的问题,缺点当然就是对于国内的网络访问不算友好
步骤如下:
新建 Repositories 用于存储博客内容,注意:名称格式为:<用户名>.github.io
将博客网页代码上传至仓库中
访问博客,博客站点访问地址为:**https://<用户名>.github.io/**
part 2 : hugo官网:The world’s fastest framework for building websites | Hugo (gohugo.io)
hugo 是使用 go 语言实现的静态博客网站生成器,可将 md 文章内容转换为美观的博客网站代码
步骤如下:
安装 git 用于将博客网页上传 Github, 安装 hugo ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/config/img/avatar.png" onerror="this.onerror=null;this.src='/config/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Aj002Th</div><div class="author-info__description">此间的博文大抵有两类,一种是水的,另一种仍是水的罢。 —— 鲁迅</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">11</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">14</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/Aj002Th"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog~</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/vscode-debugger-launch/" title="vscode中的debug配置">vscode中的debug配置</a><time datetime="2024-08-27T08:20:00.000Z" title="发表于 2024-08-27 16:20:00">2024-08-27</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/git-revoke-all-in-one/" title="git 中的各种撤销操作">git 中的各种撤销操作</a><time datetime="2024-07-09T08:57:00.000Z" title="发表于 2024-07-09 16:57:00">2024-07-09</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/git-basic-cheatsheet/" title="Git Basic CheatSheet">Git Basic CheatSheet</a><time datetime="2024-07-09T08:02:00.000Z" title="发表于 2024-07-09 16:02:00">2024-07-09</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/bash-basic-cheatsheet/" title="Bash Basic CheatSheet">Bash Basic CheatSheet</a><time datetime="2024-06-16T17:15:00.000Z" title="发表于 2024-06-17 01:15:00">2024-06-17</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/docker-basic-cheatsheet/" title="Docker Basic CheatSheet">Docker Basic CheatSheet</a><time datetime="2024-06-16T16:20:00.000Z" title="发表于 2024-06-17 00:20:00">2024-06-17</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>分类</span>
</div>
<ul class="card-category-list" id="aside-cat-list">
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%AE%9E%E8%B7%B5%E8%AE%B0%E5%BD%95/"><span class="card-category-list-name">实践记录</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%BA%90%E7%A0%81%E5%AD%A6%E4%B9%A0/"><span class="card-category-list-name">源码学习</span><span class="card-category-list-count">4</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%8E%9F%E7%90%86/"><span class="card-category-list-name">计算机原理</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E9%80%9A%E7%94%A8%E7%9F%A5%E8%AF%86/"><span class="card-category-list-name">通用知识</span><span class="card-category-list-count">4</span></a></li>
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/hugo/" style="font-size: 1.1em; color: #999">hugo</a> <a href="/tags/Docker/" style="font-size: 1.1em; color: #999">Docker</a> <a href="/tags/blog/" style="font-size: 1.1em; color: #999">blog</a> <a href="/tags/vscode/" style="font-size: 1.1em; color: #999">vscode</a> <a href="/tags/bash/" style="font-size: 1.1em; color: #999">bash</a> <a href="/tags/SSL/" style="font-size: 1.1em; color: #999">SSL</a> <a href="/tags/%E7%BD%91%E7%BB%9C/" style="font-size: 1.1em; color: #999">网络</a> <a href="/tags/go/" style="font-size: 1.5em; color: #99a9bf">go</a> <a href="/tags/shell/" style="font-size: 1.1em; color: #999">shell</a> <a href="/tags/%E6%97%A5%E5%BF%97/" style="font-size: 1.1em; color: #999">日志</a> <a href="/tags/git/" style="font-size: 1.23em; color: #999ea6">git</a> <a href="/tags/%E5%B9%B6%E5%8F%91/" style="font-size: 1.37em; color: #99a4b2">并发</a> <a href="/tags/%E5%B7%A5%E5%85%B7/" style="font-size: 1.5em; color: #99a9bf">工具</a> <a href="/tags/CheatSheet/" style="font-size: 1.37em; color: #99a4b2">CheatSheet</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/08/"><span class="card-archive-list-date">八月 2024</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/07/"><span class="card-archive-list-date">七月 2024</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/06/"><span class="card-archive-list-date">六月 2024</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/12/"><span class="card-archive-list-date">十二月 2023</span><span class="card-archive-list-count">5</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/05/"><span class="card-archive-list-date">五月 2023</span><span class="card-archive-list-count">1</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">11</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2024-08-27T12:42:08.785Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">©2020 - 2024 By Aj002Th</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral" target="_blank" rel="noopener nofollow"><img style="position:relative;top:-2.5px;" src="https://cdn.jsdelivr.net/gh/caibhh/CDN/img/blog/%E5%8F%88%E6%8B%8D%E4%BA%91_logo5.webp" align="absmiddle" width="60px" height="30px">提供加速服务</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"><script>window.typedJSFn = {
init: (str) => {
window.typed = new Typed('#subtitle', Object.assign({
strings: str,
startDelay: 300,
typeSpeed: 150,
loop: true,
backSpeed: 50,
}, "loop"))
},
run: (subtitleType) => {
if (true) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('https://cdn.jsdelivr.net/npm/typed.js/dist/typed.umd.min.js').then(subtitleType)
}
} else {
subtitleType()
}
}
}
</script><script>function subtitleType () {
if (true) {
typedJSFn.init(["找点好玩的去~","搞点好吃的去~","遇事不决,埋头就睡。","Hey! 你在看什么?"])
} else {
document.getElementById("subtitle").textContent = "找点好玩的去~"
}
}
typedJSFn.run(subtitleType)</script></div><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="false" data-click="true"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div></body></html>