feat: lychee, new og template

This commit is contained in:
taskylizard 2024-11-07 13:20:48 +00:00
parent 264ac09cab
commit 261ed64024
No known key found for this signature in database
GPG Key ID: 1820131ED1A24120
7 changed files with 495 additions and 332 deletions

37
.github/workflows/lychee.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Check Markdown links
on:
workflow_dispatch:
schedule:
- cron: '00 18 * * *' # Run once daily at 18:00 UTC
jobs:
check-links:
runs-on: ubuntu-latest
permissions:
issues: write # required for peter-evans/create-issue-from-file
steps:
- uses: actions/checkout@v4
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: --base . --verbose --no-progress './docs/**.md'
token: ${{ secrets.CUSTOM_TOKEN }}
fail: false
- name: Create Issue From File
if: env.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: lychee

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ node_modules
logos
package-lock.json
docs/.vitepress/.temp
.lycheecache

View File

@ -3,21 +3,25 @@ defineProps<{ title: string; description?: string }>()
</script>
<template>
<span
style="
background-image: radial-gradient(
100% 100% at 50% 100%,
#1fd8a4 0%,
rgba(58, 221, 198, 0.75) 25%,
rgba(78, 227, 226, 0.5) 50%,
rgba(190, 227, 248, 0) 100%
);
"
tw="w-full h-full bg-black flex-col"
>
<span
tw="p-10 w-full min-h-0 grow flex flex-col items-center justify-between"
>
<span tw="w-full h-full flex-col bg-[#111111]">
<svg tw="absolute right-0 top-0" width="629" height="593" viewBox="0 0 629 593" fill="none"
xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_f_199_94966)">
<path
d="M628.5 -578L639.334 -94.4223L806.598 -548.281L659.827 -87.387L965.396 -462.344L676.925 -74.0787L1087.69 -329.501L688.776 -55.9396L1160.22 -164.149L694.095 -34.9354L1175.13 15.7948L692.306 -13.3422L1130.8 190.83L683.602 6.50012L1032.04 341.989L668.927 22.4412L889.557 452.891L649.872 32.7537L718.78 511.519L628.5 36.32L538.22 511.519L607.128 32.7537L367.443 452.891L588.073 22.4412L224.955 341.989L573.398 6.50012L126.198 190.83L564.694 -13.3422L81.8734 15.7948L562.905 -34.9354L96.7839 -164.149L568.224 -55.9396L169.314 -329.501L580.075 -74.0787L291.604 -462.344L597.173 -87.387L450.402 -548.281L617.666 -94.4223L628.5 -578Z"
fill="#58D5BA" />
</g>
<defs>
<filter id="filter0_f_199_94966" x="0.873535" y="-659" width="1255.25" height="1251.52"
filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feGaussianBlur stdDeviation="40.5" result="effect1_foregroundBlur_199_94966" />
</filter>
</defs>
</svg>
<span tw="p-10 w-full min-h-0 grow flex flex-col items-center justify-between">
<span tw="w-full flex justify-between items-center text-5xl font-medium">
<span tw="flex items-center">
<img tw="h-22 w-22" src="https://megathread.pages.dev/logo.png" />
@ -29,11 +33,7 @@ defineProps<{ title: string; description?: string }>()
</span>
<span tw="w-full pr-56 flex flex-col items-start justify-end">
<span tw="text-6xl text-gray-200 font-bold" v-html="title" />
<span
v-if="description"
tw="mt-2 text-gray-200 text-4xl"
v-html="description"
/>
<span v-if="description" tw="mt-2 text-gray-200 text-4xl" v-html="description" />
</span>
</span>
</span>

View File

@ -41,7 +41,7 @@ export const sharedConfig = defineConfig({
appearance: 'dark',
titleTemplate: ':title • Wiki',
head: [
['meta', { name: 'theme-color', content: '#ADF0DD' }],
['meta', { name: 'theme-color', content: '#58D5BA' }],
['meta', { name: 'og:type', content: 'website' }],
['meta', { name: 'og:locale', content: 'en' }],
['link', { rel: 'icon', href: '/favicon.svg' }]

42
lychee.toml Normal file
View File

@ -0,0 +1,42 @@
cache = true
max_cache_age = "2d"
skip_missing = true
# Stealth
user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0"
# Prevent 'Too Many Open Files'
max_concurrency = 32
# Check links inside `<code>` and `<pre>` blocks and Markdown code blocks
include_verbatim = true
# Check fragments in links
include_fragments = true
# Don't check emails, it's problematic
include_mail = false
# Add 'Too many requests'
accept = ["100..=103", "200..=299", "429"]
# Be benevolent
max_retries = 5
timeout = 30
# Exclude
exclude = [
# Fuck corporations.
"reddit.com",
"youtube.com",
"google.com",
"redd.it",
# Has strong anti-bot measures.
"cs.rin.ru",
"freedownloadmanager.org",
"predb.org",
"steamdb.info",
"rentry.co",
"rentry.org",
"luckypatchers.com",
]

View File

@ -19,21 +19,21 @@
"@coloradix/unocss": "^2.3.2",
"@iconify-json/logos": "^1.2.3",
"@lunariajs/core": "^0.1.1",
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.6.0",
"@nolebase/vitepress-plugin-git-changelog": "^2.6.0",
"@nolebase/vitepress-plugin-page-properties": "^2.6.0",
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.8.1",
"@nolebase/vitepress-plugin-git-changelog": "^2.8.1",
"@nolebase/vitepress-plugin-page-properties": "^2.8.1",
"@radix-ui/colors": "^3.0.0",
"@resvg/resvg-js": "^2.6.2",
"@types/node": "^22.7.5",
"@types/node": "^22.9.0",
"@types/nprogress": "^0.2.3",
"nprogress": "^0.2.0",
"prettier": "^3.3.3",
"sass": "^1.79.4",
"unocss": "^0.63.4",
"vitepress": "^1.4.2",
"sass": "^1.80.6",
"unocss": "^0.63.6",
"vitepress": "^1.5.0",
"x-satori": "^0.2.0"
},
"dependencies": {
"vue": "^3.5.11"
"vue": "^3.5.12"
}
}

File diff suppressed because it is too large Load Diff