mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 14:54:05 -06:00
Merge branch 'v4' into dev/chinese-italic
This commit is contained in:
commit
5c62251be2
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 时廻者 LOOPERS 短评
|
||||
draft: false
|
||||
publish: true
|
||||
tags:
|
||||
- 游戏
|
||||
- Galgame
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Nginx proxy manager关于获取ip-ranges.json时卡住的解决方案
|
||||
draft: false
|
||||
publish: true
|
||||
date: 2025-01-23
|
||||
tags:
|
||||
- 运维
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 486 KiB |
@ -1,5 +1,5 @@
|
||||
---
|
||||
draft: false
|
||||
publish: true
|
||||
tags:
|
||||
- 随笔
|
||||
date: 2023-03-10
|
||||
|
||||
@ -4,7 +4,7 @@ date: 2025-01-30
|
||||
tags:
|
||||
- 运维
|
||||
comments: true
|
||||
draft: false
|
||||
publish: true
|
||||
---
|
||||
# 背景和需求
|
||||
目前主力的组网工具Tailscale使用了100.64.0.0/10的网段作为虚拟网段,并通过Cloudflare将我的主要域名*arenadruid.top*和它的子域名 *\*.arenadruid.top* 解析为我的NAS的Tailscale地址。
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
---
|
||||
title: Obsidian 中文斜体楷体优化插件
|
||||
draft: false
|
||||
publish: true
|
||||
tags:
|
||||
- obsidian
|
||||
date: 2025-02-04
|
||||
comments: true
|
||||
---
|
||||
|
||||
📝 让 Obsidian 的中文斜体优雅显示为楷体,同时保持英文原生斜体效果
|
||||
>[!abstract] 简介
|
||||
>让 Obsidian 的中文斜体优雅显示为楷体,同时保持英文原生斜体效果
|
||||
|
||||
---
|
||||
|
||||
## 🎯 需求对比:为什么你需要这个 CSS?
|
||||
|
||||
| 场景 | 原生 Obsidian / 普通方案 | 本 CSS 方案 | 解决的问题 |
|
||||
| --------------- | ------------------ | ----------------------- | --------------------- |
|
||||
| **中文斜体显示** | 伪斜体(字体拉伸变形) | 真实楷体字形 | 避免中文字符强制拉伸导致的模糊 |
|
||||
| **中英文混排** | 英文被中文字体覆盖 | 英文保持系统原生斜体 | 提升西文可读性,符合排版规范 |
|
||||
| **多平台兼容** | 依赖系统特定字体名称 | 自动检测 Win/macOS/Linux 楷体 | 跨平台开箱即用 |
|
||||
| **代码块保护** | 可能影响代码区字体 | 通过 `unicode-range` 精准控制 | 编程代码不受任何影响 |
|
||||
| **主题兼容性** | 与某些主题冲突 | 独立字体族 + CSS 变量支持 | 适配 90% 以上 Obsidian 主题 |
|
||||
| 场景 | 原生 Obsidian | 本 CSS 方案 | 解决的问题 |
|
||||
| ---------- | ------------ | ----------------------- | --------------------- |
|
||||
| **中文斜体显示** | 伪斜体(字体拉伸变形) | 真实楷体字形 | 避免中文字符强制拉伸导致的模糊 |
|
||||
| **中英文混排** | 英文被中文字体覆盖 | 英文保持系统原生斜体 | 提升西文可读性,符合排版规范 |
|
||||
| **多平台兼容** | 依赖系统特定字体名称 | 自动检测 Win/macOS/Linux 楷体 | 跨平台开箱即用 |
|
||||
| **代码块保护** | 可能影响代码区字体 | 通过 `unicode-range` 精准控制 | 编程代码不受任何影响 |
|
||||
| **主题兼容性** | 与某些主题冲突 | 独立字体族 + CSS 变量支持 | 适配 90% 以上 Obsidian 主题 |
|
||||
|
||||
---
|
||||
|
||||
@ -41,47 +41,17 @@ comments: true
|
||||
|
||||
## 🛠️ 安装指南
|
||||
|
||||
### 方法一:快速安装(推荐)
|
||||
1. 下载 <a href="/attachments/chinese-italic-kaiti.css" class="internal" data-slug="attachments/chinese-italic-kaiti.css" download="chinese-italic-kaiti.css">chinese-italic-kaiti.css</a>
|
||||
1. 前往[Github仓库](https://github.com/ArenaDruid/chinese-italic-kaiti)下载[chinese-italic-kaiti.css](https://github.com/ArenaDruid/chinese-italic-kaiti/blob/main/chinese-italic-kaiti.css)
|
||||
2. 放入 Obsidian 库的 `.obsidian/snippets/` 目录
|
||||
3. 启用:设置 → 外观 → CSS 代码片段 → 开启
|
||||
|
||||
### 方法二:手动创建
|
||||
```bash
|
||||
# 在 Obsidian 库中执行
|
||||
mkdir -p .obsidian/snippets
|
||||
cat > .obsidian/snippets/chinese-italic-kaiti.css << 'EOF'
|
||||
/* 定义中文斜体专用字体 */
|
||||
@font-face {
|
||||
font-family: 'ChineseItalic';
|
||||
font-style: italic;
|
||||
src: local('楷体'),
|
||||
local('Kaiti SC'),
|
||||
local('STKaiti');
|
||||
unicode-range: U+4E00-9FFF; /* 中文字符范围 */
|
||||
}
|
||||
|
||||
/* 智能应用规则 */
|
||||
em, .cm-em, i {
|
||||
font-family:
|
||||
-apple-system, /* 西文字体栈 */
|
||||
BlinkMacSystemFont,
|
||||
'Segoe UI',
|
||||
Roboto,
|
||||
'ChineseItalic', /* 中文斜体触发 */
|
||||
sans-serif;
|
||||
|
||||
font-style: italic; /* 必须保持斜体状态 */
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🌈 效果预览
|
||||
|
||||
![[Pic_20250204.png]]
|
||||
|
||||
![[Pic_20250204.png]]
|
||||
*上图为开启插件前,下图为开启插件后*
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ 高级配置
|
||||
@ -99,13 +69,6 @@ src: local('您的自定义楷体名称'),
|
||||
unicode-range: U+4E00-9FFF, U+3000-303F, U+31C0-31EF;
|
||||
```
|
||||
|
||||
### 禁用阅读模式
|
||||
```css
|
||||
.markdown-preview-view em {
|
||||
font-family: inherit !important;
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ❓ 常见问题
|
||||
@ -122,4 +85,4 @@ A:完全兼容 iOS/Android 版 Obsidian
|
||||
---
|
||||
|
||||
## 📜 协议许可
|
||||
[](https://creativecommons.org/licenses/by/4.0/)
|
||||
[](https://creativecommons.org/licenses/by/4.0/)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 阿瑞纳与阿巴拉契亚的博客
|
||||
draft: false
|
||||
publish: true
|
||||
tags:
|
||||
date: 2025-01-22
|
||||
comments: false
|
||||
|
||||
41
package-lock.json
generated
41
package-lock.json
generated
@ -66,7 +66,6 @@
|
||||
"to-vfile": "^8.0.0",
|
||||
"toml": "^3.0.0",
|
||||
"unified": "^11.0.5",
|
||||
"unist-util-visit": "^5.0.0",
|
||||
"vfile": "^6.0.3",
|
||||
"workerpool": "^9.2.0",
|
||||
"ws": "^8.18.0",
|
||||
@ -2102,11 +2101,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fill-range": "^7.0.1"
|
||||
"fill-range": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
@ -2407,9 +2407,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
@ -3209,9 +3210,10 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
@ -3958,6 +3960,7 @@
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
@ -4057,9 +4060,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/katex": {
|
||||
"version": "0.16.11",
|
||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.11.tgz",
|
||||
"integrity": "sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==",
|
||||
"version": "0.16.21",
|
||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.21.tgz",
|
||||
"integrity": "sha512-XvqR7FgOHtWupfMiigNzmh+MgUVmDGU2kXZm899ZkPfcuoPuFxyHmXsgATDpFZDAXCI8tvinaVcDo8PIIJSo4A==",
|
||||
"funding": [
|
||||
"https://opencollective.com/katex",
|
||||
"https://github.com/sponsors/katex"
|
||||
@ -5303,11 +5306,12 @@
|
||||
]
|
||||
},
|
||||
"node_modules/micromatch": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"braces": "^3.0.2",
|
||||
"braces": "^3.0.3",
|
||||
"picomatch": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
@ -7082,6 +7086,7 @@
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-number": "^7.0.0"
|
||||
},
|
||||
|
||||
@ -92,7 +92,6 @@
|
||||
"to-vfile": "^8.0.0",
|
||||
"toml": "^3.0.0",
|
||||
"unified": "^11.0.5",
|
||||
"unist-util-visit": "^5.0.0",
|
||||
"vfile": "^6.0.3",
|
||||
"workerpool": "^9.2.0",
|
||||
"ws": "^8.18.0",
|
||||
|
||||
@ -16,14 +16,17 @@ const config: QuartzConfig = {
|
||||
locale: "zh-CN",
|
||||
baseUrl: "www.arenadruid.top",
|
||||
ignorePatterns: ["private", "templates", ".obsidian"],
|
||||
defaultDateType: "created",
|
||||
generateSocialImages: false,
|
||||
defaultDateType: "modified",
|
||||
generateSocialImages: {
|
||||
colorScheme: "darkMode",
|
||||
//image: "cover.png",
|
||||
},
|
||||
theme: {
|
||||
fontOrigin: "googleFonts",
|
||||
cdnCaching: true,
|
||||
typography: {
|
||||
header: "Schibsted Grotesk",
|
||||
body: "Source Sans Pro",
|
||||
header: "Noto Sans SC",
|
||||
body: "Noto Sans SC",
|
||||
code: "IBM Plex Mono",
|
||||
},
|
||||
colors: {
|
||||
@ -72,16 +75,16 @@ const config: QuartzConfig = {
|
||||
Plugin.Description(),
|
||||
Plugin.Latex({ renderEngine: "katex" }),
|
||||
// Adds image caption support. Syntax:
|
||||
// ```md
|
||||
// 
|
||||
// *caption text*
|
||||
// ```
|
||||
Plugin.FigureCaptions(),
|
||||
// 启动中文斜体转楷体插件
|
||||
Plugin.ChineseItalic(),
|
||||
// Adds image lightbox support
|
||||
//Plugin.Lightbox(),
|
||||
],
|
||||
filters: [Plugin.RemoveDrafts()],
|
||||
filters: [
|
||||
//Plugin.RemoveDrafts(),
|
||||
Plugin.ExplicitPublish(),
|
||||
],
|
||||
emitters: [
|
||||
Plugin.AliasRedirects(),
|
||||
Plugin.ComponentResources(),
|
||||
|
||||
@ -49,7 +49,7 @@ export const defaultContentPageLayout: PageLayout = {
|
||||
//Component.RecentNotes(),
|
||||
],
|
||||
right: [
|
||||
//Component.Graph(),
|
||||
Component.DesktopOnly(Component.Graph()),
|
||||
Component.DesktopOnly(Component.TableOfContents()),
|
||||
Component.Backlinks(),
|
||||
//Component.RecentNotes(),
|
||||
|
||||
@ -12,5 +12,4 @@ export { TableOfContents } from "./toc"
|
||||
export { HardLineBreaks } from "./linebreaks"
|
||||
export { RoamFlavoredMarkdown } from "./roam"
|
||||
export { FigureCaptions } from "./figcaptions"
|
||||
export { Lightbox } from "./lightbox"
|
||||
export { ChineseItalic } from "./chinese-italic"
|
||||
|
||||
@ -1,75 +0,0 @@
|
||||
import { QuartzTransformerPlugin } from "../types"
|
||||
import { visit } from "unist-util-visit"
|
||||
import { Root } from "hast"
|
||||
|
||||
// Options supported here should be in sync with what GLightbox supports:
|
||||
// https://github.com/biati-digital/glightbox
|
||||
interface Options {
|
||||
/** Name of the effect on lightbox open. */
|
||||
openEffect: "zoom" | "fade" | "none"
|
||||
/** Name of the effect on lightbox close. */
|
||||
closeEffect: "zoom" | "fade" | "none"
|
||||
/** Name of the effect on slide change. */
|
||||
slideEffect: "slide" | "zoom" | "fade" | "none"
|
||||
/** Show or hide the close button. */
|
||||
closeButton: boolean
|
||||
}
|
||||
|
||||
const defaultOptions: Options = {
|
||||
openEffect: "zoom",
|
||||
closeEffect: "zoom",
|
||||
slideEffect: "slide",
|
||||
closeButton: true,
|
||||
}
|
||||
|
||||
export const Lightbox: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => {
|
||||
const opts = { ...defaultOptions, ...userOpts }
|
||||
return {
|
||||
name: "Lightbox",
|
||||
htmlPlugins(ctx) {
|
||||
return [
|
||||
() => {
|
||||
return (tree: Root, file) => {
|
||||
visit(tree, "element", (node, _index, _parent) => {
|
||||
if (
|
||||
node.tagName === "img" &&
|
||||
node.properties &&
|
||||
typeof node.properties.src === "string"
|
||||
) {
|
||||
// Add Image Lightbox support
|
||||
const classes = (node.properties.className ?? []) as string[]
|
||||
classes.push("glightbox")
|
||||
|
||||
node.properties.className = classes
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
]
|
||||
},
|
||||
externalResources() {
|
||||
return {
|
||||
css: ["https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.3.0/css/glightbox.min.css"],
|
||||
js: [
|
||||
{
|
||||
src: "https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.3.0/js/glightbox.min.js",
|
||||
loadTime: "afterDOMReady",
|
||||
contentType: "external",
|
||||
},
|
||||
{
|
||||
contentType: "inline",
|
||||
loadTime: "afterDOMReady",
|
||||
// GLightbox needs to be reloaded whenever there's a page content change
|
||||
// to make sure it loads all the images in the new page content.
|
||||
// Ref: https://quartz.jzhao.xyz/advanced/creating-components#scripts-and-interactivity
|
||||
script: `
|
||||
document.addEventListener("nav", () => {
|
||||
const lightbox = GLightbox(${JSON.stringify(opts)});
|
||||
});
|
||||
`.trim(),
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
BIN
quartz/static/cover.png
Normal file
BIN
quartz/static/cover.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 738 KiB |
Loading…
Reference in New Issue
Block a user