Commit 64e2c278c3

64e2c278c310d2b3302bea17d71a0ca96b367e1b

parent: 295ddd20bf

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-07-10 09:08 UTC

init

Layout: unified · split

docs/.vitepress/configs/hooks/opengraph.ts +30 −19
@@ -49,7 +49,7 @@ await renderer.loadFonts(fonts)
4949
5050const resourceCache = new Map<string, ArrayBuffer>()
5151const persistentImageByUrl = new Map<string, string>()
52const defaultImage = 'https://i.wotaku.wiki/f/default.png'
52const defaultImage = '/embed/default.png'
5353
5454export async function generateImages(config: SiteConfig) {
5555 const pages = await createContentLoader('**/*.md', {
@@ -61,7 +61,7 @@ export async function generateImages(config: SiteConfig) {
6161
6262 const filteredPages = pages.filter((p) => p.frontmatter.image === undefined)
6363
64 await loadPersistentImages(filteredPages)
64 await loadPersistentImages(filteredPages, config)
6565
6666 for (const page of filteredPages) {
6767 await generateImage({
@@ -110,32 +110,43 @@ async function generateImage({
110110 return await writeFile(outputFile, png)
111111}
112112
113async function loadPersistentImages(pages: ContentData[]) {
114 const imageUrls = [...new Set(pages.map(getImage))]
115 .filter((url) => /^https?:\/\//.test(url))
116 .filter((url) => !persistentImageByUrl.has(url))
113async function loadPersistentImages(pages: ContentData[], config: SiteConfig) {
114 const imageUrls = [...new Set(pages.map(getImage))].filter(
115 (url) => !persistentImageByUrl.has(url)
116 )
117117 const offset = persistentImageByUrl.size
118118
119119 await Promise.all(
120 imageUrls.map(async (url, index) => {
120 imageUrls.map(async (image, index) => {
121121 const src = `og-background-${offset + index}`
122 const response = await fetch(url, {
123 signal: AbortSignal.timeout(5000)
124 })
125
126 if (!response.ok) {
127 throw new Error(
128 `Failed to fetch OpenGraph image ${url}: ${response.status} ${response.statusText}`
129 )
130 }
131
132 const data = await response.arrayBuffer()
122 const data = await loadImageData(image, config)
133123 await renderer.putPersistentImage({ src, data })
134 persistentImageByUrl.set(url, src)
124 persistentImageByUrl.set(image, src)
135125 })
136126 )
137127}
138128
129async function loadImageData(image: string, config: SiteConfig): Promise<ArrayBuffer> {
130 if (/^https?:\/\//.test(image)) {
131 const response = await fetch(image, {
132 signal: AbortSignal.timeout(5000)
133 })
134
135 if (!response.ok) {
136 throw new Error(
137 `Failed to fetch OpenGraph image ${image}: ${response.status} ${response.statusText}`
138 )
139 }
140
141 return response.arrayBuffer()
142 }
143
144 // Root-relative path into /public, e.g. `/f/default.png`
145 const filePath = resolve(config.srcDir, 'public', image.replace(/^\//, ''))
146 const buffer = await readFile(filePath)
147 return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength) as ArrayBuffer
148}
149
139150function getImage(page: ContentData) {
140151 return String(page.frontmatter.og?.image ?? defaultImage)
141152}
docs/art.md +1 −1
@@ -4,7 +4,7 @@ description: Everything Art
44customDescription: Art-based sites, software, scripts and extensions
55outline: 2
66og:
7 image: https://i.wotaku.wiki/f/art.png
7 image: /embed/art.png
88
99---
1010
docs/ext/index.md +1 −1
@@ -2,7 +2,7 @@
22title: Extensions
33description: Extension repos for various apps
44og:
5 image: https://i.wotaku.wiki/f/extension.png
5 image: /embed/extension.png
66---
77
88<script setup>
docs/ext/ios.md +1 −1
@@ -2,7 +2,7 @@
22title: iOS Apps Extension Repos
33customDescription: Extension Repos & Guides for Aidoku, Sora & Suwatte
44og:
5 image: https://i.wotaku.wiki/f/ios.png
5 image: /embed/ios.png
66---
77# iOS
88
docs/ext/mangayomi.md +1 −1
@@ -3,7 +3,7 @@ title: Mangayomi, AnymeX & Dartotsu Extension Repos
33customDescription: Extension Repos & Guides for Mangayomi, AnymeX & Dartotsu.
44outline: [2,3]
55og:
6 image: https://i.wotaku.wiki/f/extension.png
6 image: /embed/extension.png
77---
88# Mangayomi
99
docs/ext/mihon.md +1 −1
@@ -3,7 +3,7 @@ title: Mihon, Aniyomi & Dantotsu Extension Repos
33customDescription: Extension Repos & Guides for Mihon, Aniyomi & Dantotsu
44outline: [2,3]
55og:
6 image: https://i.wotaku.wiki/f/extension.png
6 image: /embed/extension.png
77---
88
99# Mihon & Aniyomi
docs/ext/misc.md +1 −1
@@ -3,7 +3,7 @@ title: Extension Repos for Miscellaneous Software
33customDescription: Miscellaneous Extension Repos & Guides
44outline: 2
55og:
6 image: https://i.wotaku.wiki/f/extension.png
6 image: /embed/extension.png
77---
88# Miscellaneous
99
docs/faq.md +1 −1
@@ -3,7 +3,7 @@ title: Frequently Asked Questions
33customDescription: Answers to some of the most commonly asked questions about manga and anime we've seen in the otaku community.
44outline: 1
55og:
6 image: https://i.wotaku.wiki/f/faq.png
6 image: /embed/faq.png
77
88---
99
docs/games.md +1 −1
@@ -4,7 +4,7 @@ description: Wotaku Games Megathread!
44customDescription: Wotaku Games Megathread! Everything Game-related in one page.
55outline: 2
66og:
7 image: https://i.wotaku.wiki/f/game.png
7 image: /embed/game.png
88---
99
1010::: tip Quick Tip
docs/glossary/anime.md +1 −1
@@ -2,7 +2,7 @@
22title: Anime Glossary
33customDescription: Discover the anime related terms you should know!
44og:
5 image: https://i.wotaku.wiki/f/glossary.png
5 image: /embed/glossary.png
66---
77
88## Basic Terms
docs/glossary/audio.md +1 −1
@@ -3,7 +3,7 @@ title: Audio Glossary
33customDescription: Audio terms that you need to know!
44outline: [1,2]
55og:
6 image: https://i.wotaku.wiki/f/glossary.png
6 image: /embed/glossary.png
77---
88
99<Authors page="audiog" />
docs/glossary/general.md +1 −1
@@ -2,7 +2,7 @@
22title: General Glossary
33customDescription: Weeb terms that you will see everywhere!
44og:
5 image: https://i.wotaku.wiki/f/glossary.png
5 image: /embed/glossary.png
66---
77
88## Region
docs/glossary/index.md +1 −1
@@ -2,7 +2,7 @@
22title: Glossary
33description: Essential otaku and tech-related terminology
44og:
5 image: https://i.wotaku.wiki/f/glossary.png
5 image: /embed/glossary.png
66---
77
88<script setup>
docs/glossary/manga.md +1 −1
@@ -3,7 +3,7 @@ title: Manga Glossary
33customDescription: Manga related terms that you have to know!
44outline: [2,3]
55og:
6 image: https://i.wotaku.wiki/f/glossary.png
6 image: /embed/glossary.png
77---
88
99## Basic Terms
docs/glossary/nsfw.md +1 −1
@@ -2,7 +2,7 @@
22title: NSFW Glossary
33customDescription: Why not learn some words while reading or watching? Can help while searching.
44og:
5 image: https://i.wotaku.wiki/f/glossary.png
5 image: /embed/glossary.png
66---
77
88| Term | Meaning |
docs/guides/anime/discrip.md +1 −1
@@ -2,7 +2,7 @@
22title: Disc Ripping
33customDescription: Guide on how to rip DVD, Blu-ray, and UHD Discs conversions to MKV and ISO formats.
44og:
5 image: https://i.wotaku.wiki/f/guide.png
5 image: /embed/guide.png
66---
77
88This guide covers the essentials of converting DVDs, BDs, and UHDs into digital formats (MKVs and ISOs.) While setup may be a bit intricate, the workflow becomes straightforward once established.
docs/guides/index.md +1 −1
@@ -2,7 +2,7 @@
22title: Guides
33description: Various helpful Tutorials & Guides
44og:
5 image: https://i.wotaku.wiki/f/guide.png
5 image: /embed/guide.png
66---
77
88<script setup>
docs/guides/manga/comicinfo.md +1 −1
@@ -3,7 +3,7 @@ title: Digital Comic Info
33customDescription: "Information about digital comic publishers on resolution"
44outline: [2,3]
55og:
6 image: https://i.wotaku.wiki/f/guide.png
6 image: /embed/guide.png
77---
88
99Information about various types of publishers for manga and manhwa. Image quality (resolution, compression & codec) varies by publisher and by platform. Convenience of platform apps varies, consider testing them if you plan to read without removing DRM.
docs/guides/manga/cubari.md +1 −1
@@ -2,7 +2,7 @@
22title: Cubari guide
33customDescription: Guide on how to proxy comic through Cubari.moe
44og:
5 image: https://i.wotaku.wiki/f/cubari.png
5 image: /embed/cubari.png
66---
77
88This guide explains how to publish your comic using [**Cubari**](https://cubari.moe/). Cubari does not host any files directly; instead, it reads a JSON file containing image links and other metadata. To host the images, we’ll use [**Image Chest**](https://imgchest.com/), and to generate the JSON file, we’ll use the [**Kaguya script**](https://github.com/wotakumoe/kaguya).
docs/guides/manga/imagedit.md +1 −1
@@ -3,7 +3,7 @@ title: Manga Image Editing
33customDescription: Image Magick guide for Grayscaling, Leveling, and Optimizing
44outline: [2,3]
55og:
6 image: https://i.wotaku.wiki/f/guide.png
6 image: /embed/guide.png
77---
88
99A simple to understand guide covering the most important page edits.
docs/guides/manga/jxl.md +1 −1
@@ -4,7 +4,7 @@ description: Manga readers with JPEG XL / JXL support for Android, iOS & PC
44customDescription: Manga readers with JPEG XL / JXL support for Android, iOS & PC
55outline: [2,3]
66og:
7 image: https://i.wotaku.wiki/f/guide.png
7 image: /embed/guide.png
88---
99
1010## Readers
docs/guides/manga/madokami.md +1 −1
@@ -3,7 +3,7 @@ title: Madokami Guide
33customDescription: The Joining guide for Madokami through IRC. Also how to download stuff from Madokami.
44outline: [2,3]
55og:
6 image: https://i.wotaku.wiki/f/mado.png
6 image: /embed/mado.png
77---
88
99# Madokami Guide
docs/guides/manga/mdl.md +1 −1
@@ -2,7 +2,7 @@
22title: Downloading manga
33customDescription: Guide on how to download manga in pc.
44og:
5 image: https://i.wotaku.wiki/f/guide.png
5 image: /embed/guide.png
66---
77
88This guide is for PC (specifically Windows) using [FMD 2](https://github.com/dazedcat19/FMD2/). For Android, Mihon and Mihon forks should be sufficient (save as CBZ). For, iOS.... cope.
docs/guides/manga/opds.md +1 −1
@@ -2,7 +2,7 @@
22title: OPDS to your e-ink reader
33customDescription: Guide on how to self-host your library to your Kindle
44og:
5 image: https://i.wotaku.wiki/f/guide.png
5 image: /embed/guide.png
66---
77
88OPDS (Open Publication Distribution System) is a open standardized distribution system that allows you to deliver books, articles, mangas, etc. Think of it like RSS but for books and articles.
docs/guides/music/transcoding.md +1 −1
@@ -3,7 +3,7 @@ title: Transcoding Audio
33description: Basic guide for transcoding audio file
44outline: [2,3]
55og:
6 image: https://i.wotaku.wiki/f/guide.png
6 image: /embed/guide.png
77---
88
99Transcoding means converting/encoding audio files from one format to another. In this guide, we will discuss the basics and procedures of transcoding audio files. For the transcoding, we will use [**foobar2000**](https://www.foobar2000.org/) and [**fre:ac**](https://www.freac.org/), but the process should be similar in other programs also.
docs/guides/tech/adblock.md +1 −1
@@ -2,7 +2,7 @@
22title: Ad-blocking & Privacy
33customDescription: Adblocking Solutions for every device & VPN listing
44og:
5 image: https://i.wotaku.wiki/f/guide.png
5 image: /embed/guide.png
66---
77
88## Browser
docs/guides/tech/jdl.md +1 −1
@@ -2,7 +2,7 @@
22title: JDownloader2 Ad-Removal
33customDescription: Remove banner & Pop-up ads from JDownloader2
44og:
5 image: https://i.wotaku.wiki/f/guide.png
5 image: /embed/guide.png
66---
77
88JDownloader is a free download manager, but it comes with banner ads and other annoyances. In this guide you will learn how to remove them.
docs/japan/culture.md +1 −1
@@ -4,7 +4,7 @@ description: Learn all about Japanese Culture, History & Customs!
44customDescription: Learn all about Japanese Culture, History & Customs!
55outline: 2
66og:
7 image: https://i.wotaku.wiki/f/jp.png
7 image: /embed/jp.png
88---
99
1010## Culture & History
docs/japan/immersion.md +1 −1
@@ -4,7 +4,7 @@ description: Media to help you learn japanese
44customDescription: Media to help you learn japanese
55outline: [2,3]
66og:
7 image: https://i.wotaku.wiki/f/jp.png
7 image: /embed/jp.png
88---
99
1010## Recommendation
docs/japan/index.md +1 −1
@@ -2,7 +2,7 @@
22title: Japan
33description: Everything Japan on one page!
44og:
5 image: https://i.wotaku.wiki/f/jp.png
5 image: /embed/jp.png
66---
77
88<script setup>
docs/japan/language.md +1 −1
@@ -4,7 +4,7 @@ description: Japanese language learning resources
44customDescription: Japanese language learning resources
55outline: [2,3]
66og:
7 image: https://i.wotaku.wiki/f/jp.png
7 image: /embed/jp.png
88---
99
1010## Starter Guide
docs/japan/software.md +1 −1
@@ -4,7 +4,7 @@ description: Software to help you learn japanese
44customDescription: Software to help you learn japanese
55outline: 2
66og:
7 image: https://i.wotaku.wiki/f/jp.png
7 image: /embed/jp.png
88---
99
1010## Anki
docs/merch.md +1 −1
@@ -4,7 +4,7 @@ description: Everything merch related!
44customDescription: Get information & guides on figurines, plushes, books, CDs, and more.
55outline: 2
66og:
7 image: https://i.wotaku.wiki/f/merch.png
7 image: /embed/merch.png
88---
99
1010<Collapsible title="Delivery Types">
docs/music.md +1 −1
@@ -4,7 +4,7 @@ description: Wotaku Music Megathread!
44customDescription: Wotaku Music Megathread! Everything Music-related in one page.
55outline: 2
66og:
7 image: https://i.wotaku.wiki/f/music.png
7 image: /embed/music.png
88---
99
1010::: info Audio glossary
docs/nonen.md +1 −1
@@ -4,7 +4,7 @@ description: Otaku resources for other regions
44customDescription: Discover anime, manga, and other related content for all the languages.
55outline: 2
66og:
7 image: https://i.wotaku.wiki/f/nonen.png
7 image: /embed/nonen.png
88---
99
1010## Multi Language
docs/nsfw.md +1 −1
@@ -4,7 +4,7 @@ description: huh... ahem...
44customDescription: Explore a wide range of NSFW websites, manga, manhwa, illustrations, and software.
55outline: 2
66og:
7 image: https://i.wotaku.wiki/f/nsfw.png
7 image: /embed/nsfw.png
88---
99
1010## Websites
docs/public/embed/art.png added

Binary file not shown.

docs/public/embed/cubari.png added

Binary file not shown.

docs/public/embed/default.png added

Binary file not shown.

docs/public/embed/extension.png added

Binary file not shown.

docs/public/embed/faq.png added

Binary file not shown.

docs/public/embed/game.png added

Binary file not shown.

docs/public/embed/glossary.png added

Binary file not shown.

docs/public/embed/guide.png added

Binary file not shown.

docs/public/embed/ios.png added

Binary file not shown.

docs/public/embed/jp.png added

Binary file not shown.

docs/public/embed/mado.png added

Binary file not shown.

docs/public/embed/merch.png added

Binary file not shown.

docs/public/embed/music.png added

Binary file not shown.

docs/public/embed/nonen.png added

Binary file not shown.

docs/public/embed/nsfw.png added

Binary file not shown.

docs/public/embed/soft.png added

Binary file not shown.

docs/public/embed/tools.png added

Binary file not shown.

docs/public/embed/tor.png added

Binary file not shown.

docs/public/embed/vtuber.png added

Binary file not shown.

docs/software.md +1 −1
@@ -4,7 +4,7 @@ description: Enjoy anime, manga and novels on all your devices, no matter the OS
44customDescription: Enjoy anime, manga and novels on all your devices, no matter the OS!
55outline: [1,2]
66og:
7 image: https://i.wotaku.wiki/f/soft.png
7 image: /embed/soft.png
88
99---
1010
docs/tools.md +1 −1
@@ -4,7 +4,7 @@ description: Software to make life easier
44customDescription: Various tools to enhance your experience; not all of them are necessarily weeb-related, but they can be genuinely helpful.
55outline: 2
66og:
7 image: https://i.wotaku.wiki/f/tools.png
7 image: /embed/tools.png
88
99---
1010
docs/torrenting/faq.md +1 −1
@@ -2,7 +2,7 @@
22title: FAQs
33customDescription: Common questions about torrenting
44og:
5 image: https://i.wotaku.wiki/f/tor.png
5 image: /embed/tor.png
66---
77
88<Collapsible title="What does X term mean?">
docs/torrenting/glossary.md +1 −1
@@ -2,7 +2,7 @@
22title: Torrent Glossary
33customDescription: All the basic torrent related terms
44og:
5 image: https://i.wotaku.wiki/f/tor.png
5 image: /embed/tor.png
66---
77
88## Basic
docs/torrenting/index.md +1 −1
@@ -2,7 +2,7 @@
22title: Torrenting
33description: Torrenting Basics & Tutorials
44og:
5 image: https://i.wotaku.wiki/f/tor.png
5 image: /embed/tor.png
66---
77
88<script setup>
docs/torrenting/nyaa.md +1 −1
@@ -3,7 +3,7 @@ title: nyaa
33customDescription: A tutorial for navigating nyaa
44outline: [2,3]
55og:
6 image: https://i.wotaku.wiki/f/tor.png
6 image: /embed/tor.png
77---
88
99
docs/torrenting/qbit.md +1 −1
@@ -2,7 +2,7 @@
22title: qBittorrent
33customDescription: Various how-tos for qBittorrent
44og:
5 image: https://i.wotaku.wiki/f/tor.png
5 image: /embed/tor.png
66---
77
88## RSS Feed
docs/torrenting/start.md +1 −1
@@ -2,7 +2,7 @@
22title: Getting Started
33customDescription: Basic how-to torrent guide to get you started
44og:
5 image: https://i.wotaku.wiki/f/tor.png
5 image: /embed/tor.png
66---
77
88## Intro
docs/torrenting/trackers.md +1 −1
@@ -3,7 +3,7 @@ title: Trackers
33customDescription: List of public and private trackers
44outline: [2, 3]
55og:
6 image: https://i.wotaku.wiki/f/tor.png
6 image: /embed/tor.png
77---
88
99## English
docs/vtuber.md +1 −1
@@ -2,7 +2,7 @@
22title: VTuber
33description: Sui-chan wa~
44og:
5 image: https://i.wotaku.wiki/f/vtuber.png
5 image: /embed/vtuber.png
66
77---
88