diff --git a/astro.config.mjs b/astro.config.mjs index ef9c992..c668d8e 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -4,9 +4,11 @@ import rehypeAutolinkHeadings from "rehype-autolink-headings"; import remarkMath from "remark-math"; import rehypeKatex from "rehype-katex"; import remarkFlexibleContainers from "remark-flexible-containers"; +import rehypeRaw from "rehype-raw"; import { defineConfig } from "astro/config"; import { unified } from "@astrojs/markdown-remark"; import { h } from "hastscript"; +import { visit } from "unist-util-visit"; import sitemap from "@astrojs/sitemap"; const rehypeTrimTrailingDashes = () => (tree) => { @@ -24,6 +26,17 @@ const rehypeTrimTrailingDashes = () => (tree) => { walk(tree); }; +function rehypeLazyImages() { + return (tree) => { + visit(tree, "element", (node) => { + if (node.tagName === "img") { + node.properties.loading = "lazy"; + node.properties.decoding = "async"; + } + }); + }; +} + // https://astro.build/config export default defineConfig({ site: "https://andromeda.zenfyr.dev", @@ -32,6 +45,8 @@ export default defineConfig({ processor: unified({ remarkPlugins: [remarkMath, remarkFlexibleContainers], rehypePlugins: [ + rehypeRaw, + rehypeLazyImages, rehypeKatex, rehypeSlug, rehypeTrimTrailingDashes, diff --git a/package-lock.json b/package-lock.json index bf2ab77..81e61ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "prettier-plugin-astro": "^0.14.1", "rehype-autolink-headings": "^7.1.0", "rehype-katex": "^7.0.1", + "rehype-raw": "^7.0.0", "rehype-slug": "^6.0.0", "remark-flexible-containers": "^1.5.5", "remark-math": "^6.0.0", diff --git a/package.json b/package.json index f492977..8336cb7 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "prettier-plugin-astro": "^0.14.1", "rehype-autolink-headings": "^7.1.0", "rehype-katex": "^7.0.1", + "rehype-raw": "^7.0.0", "rehype-slug": "^6.0.0", "remark-flexible-containers": "^1.5.5", "remark-math": "^6.0.0", diff --git a/src/content/docs/en-us/1.13.x/blocks.md b/src/content/docs/en-us/1.13.x/blocks.md index 9f7602e..4e77064 100644 --- a/src/content/docs/en-us/1.13.x/blocks.md +++ b/src/content/docs/en-us/1.13.x/blocks.md @@ -94,7 +94,7 @@ The commands are executed as an entity. So, in the case of `/say hi!` all player Fully grown, hanging propagules will fall after some time. @@ -123,7 +123,7 @@ Tighten the string of your bow in the fletching table for improved accuracy. A joke tweak making beds explode in the overworld. @@ -132,7 +132,7 @@ A joke tweak making beds explode in the overworld. :) diff --git a/src/content/docs/en-us/1.13.x/entities.md b/src/content/docs/en-us/1.13.x/entities.md index d560cbb..ce8cc8a 100644 --- a/src/content/docs/en-us/1.13.x/entities.md +++ b/src/content/docs/en-us/1.13.x/entities.md @@ -77,12 +77,12 @@ Small slime related tweaks. Each option can be turned on or off. When a bee pollinates a flower, the flower has a chance to spread, much like grass.
diff --git a/src/content/docs/en-us/1.13.x/gui.md b/src/content/docs/en-us/1.13.x/gui.md index d6b488a..7f813c1 100644 --- a/src/content/docs/en-us/1.13.x/gui.md +++ b/src/content/docs/en-us/1.13.x/gui.md @@ -30,6 +30,6 @@ Remove "Adventure Mode" from the gamemode switcher Display an in-world tooltip when you look at item frames. diff --git a/src/content/docs/en-us/1.13.x/items.md b/src/content/docs/en-us/1.13.x/items.md index a7d52f5..faf2a6e 100644 --- a/src/content/docs/en-us/1.13.x/items.md +++ b/src/content/docs/en-us/1.13.x/items.md @@ -105,6 +105,6 @@ Allows you to "pick up" blocks using minecarts. All contents and some properties For the sake of balance, you can configure whether players can "pick up" spawners. diff --git a/src/content/docs/en-us/1.13.x/world.md b/src/content/docs/en-us/1.13.x/world.md index 080f3b5..aa3f3fb 100644 --- a/src/content/docs/en-us/1.13.x/world.md +++ b/src/content/docs/en-us/1.13.x/world.md @@ -28,7 +28,7 @@ Based on [TinyTweaks](https://www.curseforge.com/minecraft/mc-mods/tinytweaks) b Randomly, bee nests will fall from their trees, making the bees inside homeless & if a player is nearby, very angry. @@ -37,7 +37,7 @@ In my tests, it usually takes 0-2 days for a nest to fall. Arrows also work! diff --git a/src/content/docs/en-us/2.1.x/blocks.md b/src/content/docs/en-us/2.1.x/blocks.md index 2ca95a2..2d92247 100644 --- a/src/content/docs/en-us/2.1.x/blocks.md +++ b/src/content/docs/en-us/2.1.x/blocks.md @@ -10,7 +10,7 @@ description: Block related tweaks Fully grown, hanging propagules will fall after some time. @@ -39,7 +39,7 @@ Tighten the string of your bow in the fletching table for improved accuracy. A joke tweak making beds explode in the overworld. @@ -48,7 +48,7 @@ A joke tweak making beds explode in the overworld. :) diff --git a/src/content/docs/en-us/2.1.x/entities.md b/src/content/docs/en-us/2.1.x/entities.md index aa3a65c..037e5e5 100644 --- a/src/content/docs/en-us/2.1.x/entities.md +++ b/src/content/docs/en-us/2.1.x/entities.md @@ -79,12 +79,12 @@ Small slime related tweaks. Each option can be turned on or off. When a bee pollinates a flower, the flower has a chance to spread, much like grass.
diff --git a/src/content/docs/en-us/2.1.x/gui.md b/src/content/docs/en-us/2.1.x/gui.md index d6b488a..7f813c1 100644 --- a/src/content/docs/en-us/2.1.x/gui.md +++ b/src/content/docs/en-us/2.1.x/gui.md @@ -30,6 +30,6 @@ Remove "Adventure Mode" from the gamemode switcher Display an in-world tooltip when you look at item frames. diff --git a/src/content/docs/en-us/2.1.x/items.md b/src/content/docs/en-us/2.1.x/items.md index 5da0a25..b8974de 100644 --- a/src/content/docs/en-us/2.1.x/items.md +++ b/src/content/docs/en-us/2.1.x/items.md @@ -105,6 +105,6 @@ Allows you to "pick up" blocks using minecarts. All contents and some properties For the sake of balance, you can configure whether players can "pick up" spawners. diff --git a/src/content/docs/en-us/2.1.x/world.md b/src/content/docs/en-us/2.1.x/world.md index 3d47083..f52ea28 100644 --- a/src/content/docs/en-us/2.1.x/world.md +++ b/src/content/docs/en-us/2.1.x/world.md @@ -28,7 +28,7 @@ Based on [TinyTweaks](https://www.curseforge.com/minecraft/mc-mods/tinytweaks) b Randomly, bee nests will fall from their trees, making the bees inside homeless & if a player is nearby, very angry. @@ -37,7 +37,7 @@ In my tests, it usually takes 0-2 days for a nest to fall. Arrows also work! diff --git a/src/content/docs/zh-cn/1.13.x/blocks.md b/src/content/docs/zh-cn/1.13.x/blocks.md index cbbf02f..b4eb540 100644 --- a/src/content/docs/zh-cn/1.13.x/blocks.md +++ b/src/content/docs/zh-cn/1.13.x/blocks.md @@ -94,7 +94,7 @@ description: 方块相关调整 成熟后,悬挂的红树胎生苗会掉下来。 @@ -123,7 +123,7 @@ description: 方块相关调整 一个玩笑式的,让主世界的床也能爆炸的设计。 @@ -132,7 +132,7 @@ description: 方块相关调整 :) diff --git a/src/content/docs/zh-cn/1.13.x/entities.md b/src/content/docs/zh-cn/1.13.x/entities.md index dfa9a35..4ace538 100644 --- a/src/content/docs/zh-cn/1.13.x/entities.md +++ b/src/content/docs/zh-cn/1.13.x/entities.md @@ -77,12 +77,12 @@ description: 实体相关调整 蜜蜂为花朵授粉时,可能像用骨粉催生草那样催生花丛。
diff --git a/src/content/docs/zh-cn/1.13.x/gui.md b/src/content/docs/zh-cn/1.13.x/gui.md index 45e96ac..3d08d4e 100644 --- a/src/content/docs/zh-cn/1.13.x/gui.md +++ b/src/content/docs/zh-cn/1.13.x/gui.md @@ -30,6 +30,6 @@ description: GUI 和屏幕显示的相关调整 游戏内,为物品展示框添加物品提示。 diff --git a/src/content/docs/zh-cn/1.13.x/items.md b/src/content/docs/zh-cn/1.13.x/items.md index 948ca30..c4222a6 100644 --- a/src/content/docs/zh-cn/1.13.x/items.md +++ b/src/content/docs/zh-cn/1.13.x/items.md @@ -105,6 +105,6 @@ N 代表下界合金块,D 代表钻石块。 考虑到平衡性,你可以配置玩家是否能“采集”刷怪笼。 diff --git a/src/content/docs/zh-cn/1.13.x/world.md b/src/content/docs/zh-cn/1.13.x/world.md index bfbcb09..666ff6a 100644 --- a/src/content/docs/zh-cn/1.13.x/world.md +++ b/src/content/docs/zh-cn/1.13.x/world.md @@ -28,7 +28,7 @@ description: 世界相关调整 蜂巢会随机地从树上掉下来,其中的蜜蜂则会无家可归,并将怒火宣泄到靠近的玩家身上。 @@ -37,7 +37,7 @@ description: 世界相关调整 朝蜂巢射箭也能使之掉落! diff --git a/src/content/docs/zh-cn/2.1.x/blocks.md b/src/content/docs/zh-cn/2.1.x/blocks.md index 12bd23d..370cf37 100644 --- a/src/content/docs/zh-cn/2.1.x/blocks.md +++ b/src/content/docs/zh-cn/2.1.x/blocks.md @@ -10,7 +10,7 @@ description: 方块相关调整 成熟后,悬挂的红树胎生苗会掉下来。 @@ -39,7 +39,7 @@ description: 方块相关调整 一个玩笑式的,让主世界的床也能爆炸的设计。 @@ -48,7 +48,7 @@ description: 方块相关调整 :) diff --git a/src/content/docs/zh-cn/2.1.x/entities.md b/src/content/docs/zh-cn/2.1.x/entities.md index 76ef5a5..d0092f6 100644 --- a/src/content/docs/zh-cn/2.1.x/entities.md +++ b/src/content/docs/zh-cn/2.1.x/entities.md @@ -77,12 +77,12 @@ description: 实体相关调整 蜜蜂为花朵授粉时,可能像用骨粉催生草那样催生花丛。
diff --git a/src/content/docs/zh-cn/2.1.x/gui.md b/src/content/docs/zh-cn/2.1.x/gui.md index 45e96ac..3d08d4e 100644 --- a/src/content/docs/zh-cn/2.1.x/gui.md +++ b/src/content/docs/zh-cn/2.1.x/gui.md @@ -30,6 +30,6 @@ description: GUI 和屏幕显示的相关调整 游戏内,为物品展示框添加物品提示。 diff --git a/src/content/docs/zh-cn/2.1.x/items.md b/src/content/docs/zh-cn/2.1.x/items.md index 84b803f..1bfcea5 100644 --- a/src/content/docs/zh-cn/2.1.x/items.md +++ b/src/content/docs/zh-cn/2.1.x/items.md @@ -105,6 +105,6 @@ N 代表下界合金块,D 代表钻石块。 考虑到平衡性,你可以配置玩家是否能“采集”刷怪笼。 diff --git a/src/content/docs/zh-cn/2.1.x/world.md b/src/content/docs/zh-cn/2.1.x/world.md index 912ffca..70331de 100644 --- a/src/content/docs/zh-cn/2.1.x/world.md +++ b/src/content/docs/zh-cn/2.1.x/world.md @@ -28,7 +28,7 @@ description: 世界相关调整 蜂巢会随机地从树上掉下来,其中的蜜蜂则会无家可归,并将怒火宣泄到靠近的玩家身上。 @@ -37,7 +37,7 @@ description: 世界相关调整 朝蜂巢射箭也能使之掉落!