diff --git a/.github/replace.py b/.github/replace.py index f614bdfcd..a76d3461c 100644 --- a/.github/replace.py +++ b/.github/replace.py @@ -6,7 +6,7 @@ def replaces_for_beginners_guide(text): text = re.sub('\[TOC\]\n', '', text, flags=re.MULTILINE) text = re.sub('\*\*Table of Contents\*\*\n\[TOC2\]\n', '', text, flags=re.MULTILINE) text = re.sub('# -> \*\*\*Beginners Guide to Piracy\*\*\* <-\n', '', text, flags=re.MULTILINE) - text = re.sub(r"!!!note\s(.+?)\n", r":::tip\n\1\n:::\n", text, flags=re.MULTILINE) + text = re.sub(r"!!!note\s(.+?)\n", r":::info\n\1\n:::\n", text, flags=re.MULTILINE) text = re.sub(r"!!!info\s(.+?)\n", r":::info\n\1\n:::\n", text, flags=re.MULTILINE) text = re.sub(r"!!!warning\s(.+?)\n", r":::warning\n\1\n:::\n", text, flags=re.MULTILINE) text = re.sub(r">\s(.+?)\n", r"> \1\n\n", text, flags=re.MULTILINE) diff --git a/.github/script.sh b/.github/script.sh index 42010a010..4ba9d3f9f 100644 --- a/.github/script.sh +++ b/.github/script.sh @@ -1,5 +1,6 @@ +python .github/add-headers.py + for file in *; do [[ -f "$file" ]] && mv "$file" "${file,,}" 2>/dev/null done python .github/replace.py -# python .github/add-headers.py diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 1587c0341..752df6f79 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -10,7 +10,7 @@ export default withPwa( defineConfig({ title: "FMHY", description: meta.description, - titleTemplate: ":title | FreeMediaHeckYeah", + titleTemplate: ":title • freemediaheckyeah", lang: "en-US", lastUpdated: true, cleanUrls: true, @@ -21,27 +21,37 @@ export default withPwa( hostname: meta.hostname, }, head: [ - ["meta", { name: "theme-color", content: "#7bc5e4" }], ["meta", { name: "og:type", content: "website" }], ["meta", { name: "og:locale", content: "en" }], - ["meta", { property: "og:type", content: "website" }], - ["meta", { property: "og:title", content: meta.name }], - ["link", { rel: "icon", href: "/fmhy.ico", sizes: "any" }], + ["link", { rel: "icon", href: "/test.png" }], + // PWA ["link", { rel: "icon", href: "/test.png", type: "image/svg+xml" }], - ["link", { rel: "mask-icon", href: "/test.png", color: "#7bc5e4" }], - // pwa ["link", { rel: "alternate icon", href: "/test.png" }], - ["link", { rel: "apple-touch-icon", href: "/fmhy.png", sizes: "192x192" }], - ["meta", { name: "apple-mobile-web-app-status-bar-style", content: "black-translucent" }], + ["link", { rel: "mask-icon", href: "/test.png", color: "#7bc5e4" }], + // prettier-ignore ["meta", { name: "keywords", content: meta.keywords.join(" ") }], - ["meta", { name: "twitter:description", content: meta.description }], - ["meta", { name: "twitter:title", content: meta.name }], - ["meta", { name: "twitter:card", content: "summary_large_image" }], - ["meta", { name: "twitter:site", content: meta.hostname }], + ["link", { rel: "apple-touch-icon", href: "/test.png", sizes: "192x192" }], + + // ["meta", { name: "theme-color", content: "#7bc5e4" }], + // ["meta", { name: "og:type", content: "website" }], + // ["meta", { name: "og:locale", content: "en" }], + // ["meta", { property: "og:type", content: "website" }], + // ["meta", { property: "og:title", content: meta.name }], + // ["link", { rel: "icon", href: "/fmhy.ico", sizes: "any" }], + // ["link", { rel: "icon", href: "/test.png", type: "image/svg+xml" }], + // ["link", { rel: "mask-icon", href: "/test.png", color: "#7bc5e4" }], + // // pwa + // ["link", { rel: "alternate icon", href: "/test.png" }], + // ["link", { rel: "apple-touch-icon", href: "/fmhy.png", sizes: "192x192" }], + // ["meta", { name: "apple-mobile-web-app-status-bar-style", content: "black-translucent" }], + // ["meta", { name: "keywords", content: meta.keywords.join(" ") }], + // ["meta", { name: "twitter:description", content: meta.description }], + // ["meta", { name: "twitter:title", content: meta.name }], + // ["meta", { name: "twitter:card", content: "summary_large_image" }], + // ["meta", { name: "twitter:site", content: meta.hostname }], ], transformHead: async (context) => generateMeta(context, meta.hostname), - vite: { plugins: [ UnoCSS({ diff --git a/.vitepress/hooks/meta.ts b/.vitepress/hooks/meta.ts index 9e911d224..ba9f593e6 100644 --- a/.vitepress/hooks/meta.ts +++ b/.vitepress/hooks/meta.ts @@ -10,13 +10,9 @@ export function generateMeta(context: TransformContext, hostname: string) { head.push(["meta", { property: "og:url", content: url }]); head.push(["meta", { name: "twitter:url", content: url }]); head.push(["meta", { name: "twitter:card", content: "summary_large_image" }]); + head.push(["meta", { name: "theme-color", content: "#7bc5e4" }]); + head.push(["meta", { property: "og:type", content: "website" }]); - if (pageData.frontmatter.theme) { - head.push(["meta", { name: "theme-color", content: pageData.frontmatter.theme }]); - } - if (pageData.frontmatter.type) { - head.push(["meta", { property: "og:type", content: pageData.frontmatter.type }]); - } if (pageData.frontmatter.description) { head.push([ "meta", @@ -52,18 +48,7 @@ export function generateMeta(context: TransformContext, hostname: string) { }, ]); } - if (pageData.frontmatter.tag) { - head.push(["meta", { property: "article:tag", content: pageData.frontmatter.tag }]); - } - if (pageData.frontmatter.date) { - head.push([ - "meta", - { - property: "article:published_time", - content: pageData.frontmatter.date, - }, - ]); - } + if (pageData.lastUpdated && pageData.frontmatter.lastUpdated !== false) { head.push([ "meta", diff --git a/.vitepress/loaders/guides.data.ts b/.vitepress/loaders/guides.data.ts index f532b9b0d..0c60e45e4 100644 --- a/.vitepress/loaders/guides.data.ts +++ b/.vitepress/loaders/guides.data.ts @@ -40,7 +40,7 @@ export default defineLoader({ const obj = Object.fromEntries( [...guides.entries()].map((entry, index) => [index.toString(), entry]), ); - await writeFile("./guides.json",JSON.stringify(obj, null, 4), "") - return await readFile("./guides.json", { encoding: "utf-8"}) + await writeFile("./guides.json", JSON.stringify(obj, null, 4), "utf-8"); + return JSON.parse(await readFile("./guides.json", { encoding: "utf-8" })) as Data; }, }); diff --git a/.vitepress/pwa.ts b/.vitepress/pwa.ts index fe0c0bcd7..fe786ea65 100644 --- a/.vitepress/pwa.ts +++ b/.vitepress/pwa.ts @@ -64,7 +64,6 @@ export const pwa = { globPatterns: ["**/*.{css,js,html,svg,png,ico,txt,woff2,json}"], globIgnores: ["**/404.html"], navigateFallback: null, - runtimeCaching: [ { urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i, diff --git a/guides.md b/guides.md index 58baeac6d..ab82d188c 100644 --- a/guides.md +++ b/guides.md @@ -1,13 +1,13 @@ --- title: Guides --- - - - + + + + + + + + + +