Compare commits

..

10 Commits

Author SHA1 Message Date
dichgrem
c6e6bf3450 update:win_0 2026-01-17 14:09:59 +08:00
dichgrem
4749aacb0f update:openwrt 2026-01-17 13:55:00 +08:00
dichgrem
aea50b44ca feat:copy_button 2026-01-17 13:00:03 +08:00
dichgrem
07d1060183 feat:toc 2026-01-17 12:10:00 +08:00
dichgrem
382e05ea76 update:blog 2026-01-17 12:10:00 +08:00
dichgrem
3d6d0a45f3 feat:improve_performance 2026-01-17 12:10:00 +08:00
dichgrem
707ca3ab64 feat:main_location_markers 2026-01-17 12:10:00 +08:00
dichgrem
f163f4b97f chore:misc 2026-01-17 12:10:00 +08:00
dichgrem
d7ada4842b feat:sort_by_year 2026-01-17 12:10:00 +08:00
dichgrem
8d959b9c1b style:highlight 2026-01-17 12:09:55 +08:00
9 changed files with 221 additions and 1 deletions

View File

@@ -22,6 +22,22 @@ taxonomies = [
[markdown] [markdown]
highlight_code = true highlight_code = true
highlight_theme = "boron" highlight_theme = "boron"
render_emoji = false
external_links_target_blank = true
external_links_no_follow = true
external_links_no_referrer = true
smart_punctuation = false
bottom_footnotes = true
table_of_contents = { start_level = 2, end_level = 4 }
[markdown.highlight_themes]
light = "boron"
dark = "dracula"
[slugify]
paths = "on"
taxonomies = "on"
anchors = "on"
[extra] [extra]

View File

@@ -578,6 +578,17 @@ nft list table ip mangle
- 关闭防火墙的禁止转发规则,全部允许; - 关闭防火墙的禁止转发规则,全部允许;
- 将X86主路由的网线插到AP的任意一个LAN口。 - 将X86主路由的网线插到AP的任意一个LAN口。
## 更新所有包
```
opkg update
opkg list-upgradable \
| awk '{print $1}' \
| grep -vE '^(base-files|busybox|libc|libgcc|libstdc\+\+|procd|netifd|ubus|uci|kernel|kmod-|fstools|mtd|fwtool)$' \
| xargs -r opkg upgrade
```
## 🔗 ## 🔗
- [Openwrt wiki](https://openwrt.org/zh/docs/start) - [Openwrt wiki](https://openwrt.org/zh/docs/start)

View File

@@ -178,7 +178,7 @@ tags = ["Windows"]
- **抓包**: [Wireshark](https://www.wireshark.org/download.html) - **抓包**: [Wireshark](https://www.wireshark.org/download.html)
- **启动器**: [Flow.Launcher](https://github.com/Flow-Launcher/Flow.Launcher) - **启动器**: [Flow.Launcher](https://github.com/Flow-Launcher/Flow.Launcher)
- **输入法**: [Rime](https://rime.im/download/) - **输入法**: [Rime](https://rime.im/download/)
- **浏览器**: [Floorp](https://github.com/Floorp-Projects/Floorp) / [Chrome](https://www.google.com/chrome/) - **浏览器**: [Floorp](https://github.com/Floorp-Projects/Floorp) / [Chrome](https://dl.google.com/tag/s/installdataindex/update2/installers/ChromeStandaloneSetup64.exe)
- **编辑器**: [VSCodium](https://github.com/VSCodium/vscodium) - **编辑器**: [VSCodium](https://github.com/VSCodium/vscodium)
- **虚拟机**: HyperV - **虚拟机**: HyperV
- **科学上网**: [GFS](https://github.com/GUI-for-Cores/GUI.for.SingBox) - **科学上网**: [GFS](https://github.com/GUI-for-Cores/GUI.for.SingBox)

32
sass/copy.scss Normal file
View File

@@ -0,0 +1,32 @@
.copy-button {
position: absolute;
top: 8px;
right: 8px;
padding: 4px 10px;
font-size: 0.8rem;
font-family: DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
background: var(--accent);
color: var(--background);
border: none;
border-radius: 3px;
cursor: pointer;
opacity: 0;
transition: opacity 0.2s ease;
z-index: 1;
&:hover {
opacity: 1;
}
&.copied {
background: #4caf50;
}
}
pre:hover .copy-button {
opacity: 0.8;
}
pre:hover .copy-button:hover {
opacity: 1;
}

View File

@@ -133,6 +133,7 @@ pre {
overflow: auto; overflow: auto;
border-top: 1px solid rgba(255, 255, 255, .1); border-top: 1px solid rgba(255, 255, 255, .1);
border-bottom: 1px solid rgba(255, 255, 255, .1); border-bottom: 1px solid rgba(255, 255, 255, .1);
position: relative;
@media (max-width: $phone-max-width) { @media (max-width: $phone-max-width) {
white-space: pre-wrap; white-space: pre-wrap;

View File

@@ -4,5 +4,7 @@
@import 'logo'; @import 'logo';
@import 'main'; @import 'main';
@import 'post'; @import 'post';
@import 'toc';
@import 'copy';
@import 'pagination'; @import 'pagination';
@import 'footer'; @import 'footer';

88
sass/toc.scss Normal file
View File

@@ -0,0 +1,88 @@
html {
scroll-behavior: smooth;
}
.toc-container {
position: fixed;
right: 150px;
top: 180px;
width: 250px;
max-height: calc(100vh - 200px);
overflow-y: auto;
z-index: 10;
display: none;
@media (min-width: 1400px) {
display: block;
}
}
.toc {
padding: 15px 0;
&-title {
font-weight: bold;
font-size: 1.1rem;
margin-bottom: 12px;
color: var(--color);
}
ul {
list-style: none;
padding-left: 0;
margin: 0;
}
li {
margin: 4px 0;
}
ul ul {
padding-left: 20px;
margin-top: 4px;
}
a {
display: block;
text-decoration: none;
color: var(--color);
font-size: 0.9rem;
padding: 2px 0;
transition: color 0.2s ease;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&:hover {
color: var(--accent);
}
&:target {
color: var(--accent);
font-weight: bold;
}
}
.toc-level-1 {
font-size: 0.95rem;
font-weight: 600;
}
.toc-level-2 {
font-size: 0.9rem;
}
.toc-level-3 {
font-size: 0.85rem;
}
.toc-level-4,
.toc-level-5,
.toc-level-6 {
font-size: 0.8rem;
}
}
.post-content {
scroll-margin-top: 80px;
}

34
static/copy.js Normal file
View File

@@ -0,0 +1,34 @@
(function() {
document.querySelectorAll('pre code').forEach((codeBlock) => {
const pre = codeBlock.parentElement;
if (pre.querySelector('.copy-button')) {
return;
}
const copyButton = document.createElement('button');
copyButton.className = 'copy-button';
copyButton.textContent = '复制';
copyButton.setAttribute('aria-label', '复制代码');
copyButton.setAttribute('type', 'button');
copyButton.addEventListener('click', () => {
navigator.clipboard.writeText(codeBlock.textContent.trimEnd()).then(() => {
copyButton.textContent = '已复制!';
copyButton.classList.add('copied');
setTimeout(() => {
copyButton.textContent = '复制';
copyButton.classList.remove('copied');
}, 2000);
}).catch((err) => {
copyButton.textContent = '失败';
setTimeout(() => {
copyButton.textContent = '复制';
}, 2000);
});
});
pre.appendChild(copyButton);
});
})();

View File

@@ -10,5 +10,41 @@
{{ post_macros::content(page=page, summary=false, show_only_description=false) }} {{ post_macros::content(page=page, summary=false, show_only_description=false) }}
{{ post_macros::earlier_later(page=page) }} {{ post_macros::earlier_later(page=page) }}
</div> </div>
{% if page.toc %}
<div class="toc-container">
<div class="toc">
<div class="toc-title">目录</div>
<ul>
{% for h in page.toc %}
<li class="toc-level-{{ h.level }}">
<a href="#{{ h.id | safe }}">{{ h.title }}</a>
{% if h.children %}
<ul>
{% for h2 in h.children %}
<li class="toc-level-{{ h2.level }}">
<a href="#{{ h2.id | safe }}">{{ h2.title }}</a>
{% if h2.children %}
<ul>
{% for h3 in h2.children %}
<li class="toc-level-{{ h3.level }}">
<a href="#{{ h3.id | safe }}">{{ h3.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% endblock content %} {% endblock content %}
{% block extra_body %}
<script src="{{ get_url(path='copy.js', trailing_slash=false) | safe }}"></script>
{% endblock extra_body %}