博客美化:代码块美化示例
  1. 默认(可自定义) 什么也不传:
text
declare a=1 echo "$a" exit

传入标题、语言等

layouts/_default/render-codeblock.html
declare a=1 echo "$a" exit

黑暗模式:需要传递 mode = “dark”

rust demo
declare a=1 echo "$a" exit

不加背景模式:需要传递 nobackground = “true”

rust demo
declare a=1 echo "$a" exit
rust demo
declare a=1 echo "$a" exit

自定义代码块边距(仅在有背景条件下生效,默认64 建议:16/32/64)

rust demo
declare a=1 echo "$a" exit
rust demo
declare a=1 echo "$a" exit
  1. 更换主题

1. ice

layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }

2. breeze

layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }

3.Sand

layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }

4.forest

layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }

5.mono

layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }

6.midnight

layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }

7.raindrop

layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
layouts/_default/render-codeblock.html
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }

8.meadow

Untitled
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
Untitled
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }

9.falcon

Untitled
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
Untitled
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }

10.crimson

Untitled
import { Detail } from "@raycast/api"; export default function Command() { return <Detail markdown="Hello World" />; }
回到顶部