mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 23:04:05 -06:00
目标:中文斜体改楷体
This commit is contained in:
parent
f4364025db
commit
a11891b8ee
@ -77,6 +77,7 @@ const config: QuartzConfig = {
|
|||||||
// *caption text*
|
// *caption text*
|
||||||
// ```
|
// ```
|
||||||
Plugin.FigureCaptions(),
|
Plugin.FigureCaptions(),
|
||||||
|
Plugin.ChineseItalic(),
|
||||||
// Adds image lightbox support
|
// Adds image lightbox support
|
||||||
//Plugin.Lightbox(),
|
//Plugin.Lightbox(),
|
||||||
],
|
],
|
||||||
|
|||||||
37
quartz/plugins/transformers/chinese-italic.ts
Normal file
37
quartz/plugins/transformers/chinese-italic.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { QuartzTransformerPlugin } from "../types"
|
||||||
|
|
||||||
|
export const ChineseItalic: QuartzTransformerPlugin = () => {
|
||||||
|
return {
|
||||||
|
name: "ChineseItalic",
|
||||||
|
externalResources() {
|
||||||
|
return {
|
||||||
|
css: [
|
||||||
|
{
|
||||||
|
// 内联 CSS 直接注入到页面
|
||||||
|
content: `
|
||||||
|
@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;
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -13,3 +13,4 @@ export { HardLineBreaks } from "./linebreaks"
|
|||||||
export { RoamFlavoredMarkdown } from "./roam"
|
export { RoamFlavoredMarkdown } from "./roam"
|
||||||
export { FigureCaptions } from "./figcaptions"
|
export { FigureCaptions } from "./figcaptions"
|
||||||
export { Lightbox } from "./lightbox"
|
export { Lightbox } from "./lightbox"
|
||||||
|
export { ChineseItalic } from "./chinese-italic"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user