Simplify config

This commit is contained in:
Soitora 2023-08-31 16:04:42 +02:00
parent ea29dac3f8
commit c8f80a8ba0
No known key found for this signature in database
GPG Key ID: A6D711EB4F2CCD97
16 changed files with 122 additions and 221 deletions

View File

@ -1,76 +0,0 @@
name: Deploy
on:
workflow_dispatch: {}
push:
branches:
- v3-vitepress
env:
VITE_BASE: /kodo/
VITE_HOSTNAME: https://xhenos.github.io
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "website"
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
package_json_file: "website/package-lock.json"
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Configure pages
uses: actions/configure-pages@v2
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: website/src/.vitepress/dist
- name: Deploy
id: deployment
uses: actions/deploy-pages@v1

View File

@ -39,9 +39,9 @@
"@mdit/plugin-img-mark": "^0.4.8",
"@mdit/plugin-img-size": "^0.4.8",
"@mdit/plugin-include": "^0.4.8",
"@mdit/plugin-tab": "^0.4.8",
"@types/lodash.groupby": "^4.6.7",
"@types/markdown-it": "^13.0.1",
"@types/node": "^20.5.7",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.48.0",
@ -49,7 +49,6 @@
"eslint-plugin-vue": "^9.17.0",
"feed": "^4.2.2",
"lint-staged": "^14.0.1",
"markdown-it-mdi": "^0.1.0",
"markdownlint": "^0.30.0",
"markdownlint-cli": "^0.35.0",
"prettier": "^3.0.3",
@ -71,7 +70,7 @@
"*.{html,json}": "prettier --write"
},
"dependencies": {
"@mdi/js": "^7.2.96",
"@iconify-prerendered/vue-mdi": "^0.23.1689058119",
"@tanstack/vue-query": "^4.34.0",
"axios": "^1.5.0",
"element-plus": "^2.3.12",

View File

@ -1,9 +1,13 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
'@mdi/js':
specifier: ^7.2.96
version: 7.2.96
'@iconify-prerendered/vue-mdi':
specifier: ^0.23.1689058119
version: 0.23.1689058119(vue@3.3.4)
'@tanstack/vue-query':
specifier: ^4.34.0
version: 4.34.0(vue@3.3.4)
@ -45,15 +49,15 @@ devDependencies:
'@mdit/plugin-include':
specifier: ^0.4.8
version: 0.4.8
'@mdit/plugin-tab':
specifier: ^0.4.8
version: 0.4.8
'@types/lodash.groupby':
specifier: ^4.6.7
version: 4.6.7
'@types/markdown-it':
specifier: ^13.0.1
version: 13.0.1
'@types/node':
specifier: ^20.5.7
version: 20.5.7
'@typescript-eslint/eslint-plugin':
specifier: ^6.5.0
version: 6.5.0(@typescript-eslint/parser@6.5.0)(eslint@8.48.0)(typescript@5.2.2)
@ -75,9 +79,6 @@ devDependencies:
lint-staged:
specifier: ^14.0.1
version: 14.0.1
markdown-it-mdi:
specifier: ^0.1.0
version: 0.1.0
markdownlint:
specifier: ^0.30.0
version: 0.30.0
@ -104,7 +105,7 @@ devDependencies:
version: 1.8.1(eslint@8.48.0)(vite@4.4.9)
vitepress:
specifier: 1.0.0-rc.10
version: 1.0.0-rc.10(@algolia/client-search@4.19.1)(axios@1.5.0)(search-insights@2.7.0)(stylus@0.60.0)
version: 1.0.0-rc.10(@algolia/client-search@4.19.1)(@types/node@20.5.7)(axios@1.5.0)(search-insights@2.7.0)(stylus@0.60.0)
vitepress-plugin-tabs:
specifier: ^0.3.0
version: 0.3.0(vitepress@1.0.0-rc.10)(vue@3.3.4)
@ -662,6 +663,14 @@ packages:
resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
dev: true
/@iconify-prerendered/vue-mdi@0.23.1689058119(vue@3.3.4):
resolution: {integrity: sha512-5Q0YZ0yez6YwAvrSCZPn3HfGeo/qbYI/QCr5hdAyivDRB/tLtubdUT2IV/JSCxBsHivSHiV1Dmbd/W0boeWC4A==}
peerDependencies:
vue: ^3.0.0
dependencies:
vue: 3.3.4
dev: false
/@isaacs/cliui@8.0.2:
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
engines: {node: '>=12'}
@ -677,10 +686,6 @@ packages:
/@jridgewell/sourcemap-codec@1.4.15:
resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
/@mdi/js@7.2.96:
resolution: {integrity: sha512-paR9M9ZT7rKbh2boksNUynuSZMHhqRYnEZOm/KrZTjQ4/FzyhjLHuvw/8XYzP+E7fS4+/Ms/82EN1pl/OFsiIA==}
dev: false
/@mdit/plugin-attrs@0.4.8:
resolution: {integrity: sha512-SB2yTHRNG8j5shh1TtJAPuPFWaMeQp6P/9ieLVPFdXLU6RPobEwf1GAX39YDaIKaWXEmkEJJdKFClOKmyWd9BQ==}
engines: {node: '>= 14'}
@ -729,13 +734,6 @@ packages:
upath: 2.0.1
dev: true
/@mdit/plugin-tab@0.4.8:
resolution: {integrity: sha512-/YUI4KQAtHUE6AkJUfIEIKjnK8LEAkcBMe2z8SYmzeEs9U0vHvQNawUd6ANHOXrpeqyPrgQnhWqGkF4yMqfAjg==}
dependencies:
'@types/markdown-it': 12.2.3
markdown-it: 13.0.1
dev: true
/@nodelib/fs.scandir@2.1.5:
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
@ -863,6 +861,10 @@ packages:
resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}
dev: true
/@types/node@20.5.7:
resolution: {integrity: sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==}
dev: true
/@types/normalize-package-data@2.4.1:
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
dev: true
@ -2902,16 +2904,6 @@ packages:
resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==}
dev: true
/markdown-it-mdi@0.1.0:
resolution: {integrity: sha512-2AUhSc/SuuqZLiF4zbGd5MhyR1eyX7fSaOydMzOqmLtSMziCP9LY+JlJm6VSjrz3vg55BD5U5fy9GjoKoUUxUg==}
dependencies:
markdown-it-regexp: 0.4.0
dev: true
/markdown-it-regexp@0.4.0:
resolution: {integrity: sha512-0XQmr46K/rMKnI93Y3CLXsHj4jIioRETTAiVnJnjrZCEkGaDOmUxTbZj/aZ17G5NlRcVpWBYjqpwSlQ9lj+Kxw==}
dev: true
/markdown-it@13.0.1:
resolution: {integrity: sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==}
hasBin: true
@ -4064,10 +4056,10 @@ packages:
'@types/eslint': 8.44.2
eslint: 8.48.0
rollup: 2.79.1
vite: 4.4.9(stylus@0.60.0)
vite: 4.4.9(@types/node@20.5.7)(stylus@0.60.0)
dev: true
/vite@4.4.9(stylus@0.60.0):
/vite@4.4.9(@types/node@20.5.7)(stylus@0.60.0):
resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
@ -4095,6 +4087,7 @@ packages:
terser:
optional: true
dependencies:
'@types/node': 20.5.7
esbuild: 0.18.20
postcss: 8.4.29
rollup: 3.28.1
@ -4114,11 +4107,11 @@ packages:
vitepress: ^1.0.0-beta.2
vue: ^3.3.4
dependencies:
vitepress: 1.0.0-rc.10(@algolia/client-search@4.19.1)(axios@1.5.0)(search-insights@2.7.0)(stylus@0.60.0)
vitepress: 1.0.0-rc.10(@algolia/client-search@4.19.1)(@types/node@20.5.7)(axios@1.5.0)(search-insights@2.7.0)(stylus@0.60.0)
vue: 3.3.4
dev: true
/vitepress@1.0.0-rc.10(@algolia/client-search@4.19.1)(axios@1.5.0)(search-insights@2.7.0)(stylus@0.60.0):
/vitepress@1.0.0-rc.10(@algolia/client-search@4.19.1)(@types/node@20.5.7)(axios@1.5.0)(search-insights@2.7.0)(stylus@0.60.0):
resolution: {integrity: sha512-+MsahIWqq5WUEmj6MR4obcKYbT7im07jZPCQPdNJExkeOSbOAJ4xypSLx88x7rvtzWHhHc5aXbOhCRvGEGjFrw==}
hasBin: true
dependencies:
@ -4131,7 +4124,7 @@ packages:
mark.js: 8.11.1
minisearch: 6.1.0
shiki: 0.14.3
vite: 4.4.9(stylus@0.60.0)
vite: 4.4.9(@types/node@20.5.7)(stylus@0.60.0)
vue: 3.3.4
transitivePeerDependencies:
- '@algolia/client-search'
@ -4320,7 +4313,3 @@ packages:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
dev: true
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false

View File

@ -0,0 +1,29 @@
import { defineConfig } from "vitepress";
import markdownConfig from "./config/markdownConfig"; // For use with loading Markdown plugins
import themeConfig from "./config/themeConfig"; // Theme related config
import headConfig from "./config/headConfig"; // Provides how to generate Meta head tags
import generateMeta from "./config/hooks/generateMeta"; // Enhanced meta generation
import generateFeed from "./config/hooks/generateFeed"; // Allows generation of RSS feed
const title = "Tachiyomi";
const description = "Read your favorite manga, webtoons, comics, and more easier than ever on your Android.";
const hostname: string = "https://kodo.moe";
export default defineConfig({
lastUpdated: true,
cleanUrls: true,
title: title,
description: description,
sitemap: {
hostname: hostname,
},
headConfig,
markdownConfig,
themeConfig: themeConfig,
transformHead: async (context) => generateMeta(context, hostname),
buildEnd: async (context) => {
generateFeed(context, hostname);
},
});

View File

@ -1,6 +1,6 @@
import type { HeadConfig } from "vitepress";
const head: HeadConfig[] = [
const headConfig: HeadConfig[] = [
["meta", { name: "theme-color", content: "#818CF8" }],
["meta", { name: "msapplication-TileColor", content: "#818CF8" }],
@ -54,4 +54,4 @@ const head: HeadConfig[] = [
["meta", { property: "og:type", content: "website" }],
];
export default head;
export default headConfig;

View File

@ -1,9 +0,0 @@
import { mdiBarcode } from "@mdi/js";
export default {
setup() {
return {
mdiBarcode,
};
},
};

View File

@ -1,39 +0,0 @@
import { defineConfig, loadEnv } from "vitepress";
import markdown from "./markdown";
import themeConfig from "./theme";
import head from "./head";
import "./icons";
import generateMeta from "./hooks/generateMeta";
import generateFeed from "./hooks/generateFeed";
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
const baseUrl = process.env.VITE_HOSTNAME || "https://kodo.moe";
const basePath = process.env.VITE_BASE || "/";
const hostname: string = baseUrl + basePath.replace(/\/$/, "");
return defineConfig({
appearance: "dark",
lastUpdated: true,
cleanUrls: true,
base: process.env.VITE_BASE || "/",
lang: "en-US",
title: "Tachiyomi",
description: "Read your favorite manga, webtoons, comics, and more easier than ever on your Android.",
sitemap: {
hostname: hostname,
},
head,
markdown,
themeConfig: themeConfig,
transformHead: async (context) => generateMeta(context, hostname),
buildEnd: async (context) => {
generateFeed(context, hostname);
},
});
};

View File

@ -7,9 +7,8 @@ import { imgMark } from "@mdit/plugin-img-mark";
import { imgSize } from "@mdit/plugin-img-size";
import { include } from "@mdit/plugin-include";
import { tabsMarkdownPlugin } from "vitepress-plugin-tabs";
import mdi from "markdown-it-mdi";
const markdown: MarkdownOptions = {
const markdownConfig: MarkdownOptions = {
config: (md) => {
md.use(attrs),
md.use(figure),
@ -19,9 +18,8 @@ const markdown: MarkdownOptions = {
md.use(include, {
currentPath: (env) => env.filePath,
}),
md.use(tabsMarkdownPlugin),
md.use(mdi);
md.use(tabsMarkdownPlugin);
},
};
export default markdown;
export default markdownConfig;

View File

@ -64,12 +64,14 @@ const downloadInformation = computed(() => ({
</template>
<style lang="stylus">
.buttons-wrapper
.buttons-wrapper {
display: flex
gap: 2rem
& > a
& > a {
display: flex
flex-direction: column
align-items: center
}
}
</style>

View File

@ -41,12 +41,14 @@ const whatsNew = computed(() => {
</template>
<style lang="stylus">
.buttons-wrapper
.buttons-wrapper {
display: flex
gap: 2rem
& > a
& > a {
display: flex
flex-direction: column
align-items: center
}
}
</style>

View File

@ -1,26 +1,27 @@
// https://vitepress.dev/guide/custom-theme
import { h } from "vue";
import Theme from "vitepress/theme";
import DefaultTheme from "vitepress/theme";
// Import Stylus files
import "./styles/base.styl";
// Import Global plugins
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import "element-plus/theme-chalk/dark/css-vars.css";
import { VueQueryPlugin } from "@tanstack/vue-query"
import { VueQueryPlugin } from "@tanstack/vue-query";
import { enhanceAppWithTabs } from "vitepress-plugin-tabs/client";
// Import Icon components
import { IconDownload } from "@iconify-prerendered/vue-mdi";
export default {
extends: Theme,
Layout: () => {
return h(Theme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
});
},
enhanceApp({ app, router, siteData }) {
...DefaultTheme,
enhanceApp({ app }) {
app.use(ElementPlus);
app.use(VueQueryPlugin);
enhanceAppWithTabs(app);
app.component("IconDownload", IconDownload);
},
};

View File

@ -5,34 +5,33 @@ import { GITHUB_EXTENSION_JSON } from "../../config/constants";
export type ReleaseType = "stable" | "preview";
export interface Extension {
name: string
pkg: string
apk: string
lang: string
code: number
version: string
nsfw: number
hasReadme: number
hasChangelog: number
sources: Source[]
name: string;
pkg: string;
apk: string;
lang: string;
code: number;
version: string;
nsfw: number;
hasReadme: number;
hasChangelog: number;
sources: Source[];
}
export interface Source {
name: string
lang: string
id: string
baseUrl: string
versionId: number
hasCloudflare: string
name: string;
lang: string;
id: string;
baseUrl: string;
versionId: number;
hasCloudflare: string;
}
export interface GitHubAsset {
name: string
content_type: string
browser_download_url: string
name: string;
content_type: string;
browser_download_url: string;
}
export default function useExtensionsRepositoryQuery() {
return useQuery({
queryKey: ["extensions"],
@ -43,5 +42,5 @@ export default function useExtensionsRepositoryQuery() {
},
initialData: () => [],
refetchOnWindowFocus: false,
})
});
}

View File

@ -1,22 +1,22 @@
import { useQuery } from "@tanstack/vue-query";
import axios from "axios";
import { GITHUB_STABLE_API, GITHUB_PREVIEW_API } from "../../config/constants";
import { unref, type Ref } from 'vue';
import { unref, type Ref } from "vue";
export type ReleaseType = "stable" | "preview";
export interface GitHubRelease {
body: string
tag_name: string
name: string
assets: GitHubAsset[]
published_at: string
body: string;
tag_name: string;
name: string;
assets: GitHubAsset[];
published_at: string;
}
export interface GitHubAsset {
name: string
content_type: string
browser_download_url: string
name: string;
content_type: string;
browser_download_url: string;
}
const apiUrls: Record<ReleaseType, string> = {
@ -35,5 +35,5 @@ export default function useReleaseQuery(type: ReleaseType | Ref<ReleaseType>) {
},
initialData: () => null,
refetchOnWindowFocus: false,
})
});
}

5
website/src/.vitepress/vue-shim.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
declare module "*.vue" {
import { Component } from "vue";
const _default: Component;
export default _default;
}

View File

@ -1,6 +1,7 @@
---
title: Download
description: Download page that allows users to access and install the latest version of the app.
aside: false
---
<script setup>
@ -9,9 +10,9 @@ import ReleaseDate from "../.vitepress/theme/components/ReleaseDate.vue";
import WhatsNew from "../.vitepress/theme/components/WhatsNew.vue"
</script>
# Download
# Download <IconDownload/>
Download the latest stable version of **Tachiyomi** that released <ReleaseDate type="stable" /> or the preview version that released <ReleaseDate type="preview" />.
Download the latest stable version of **Tachiyomi** that released **<ReleaseDate type="stable" />** or the preview version that released **<ReleaseDate type="preview" />**.
<DownloadButtons />