refactor: simplify link to bv

This commit is contained in:
YunYouJun
2022-06-05 18:30:49 +08:00
parent 8d7021bcfd
commit 34eb9b34e0
8 changed files with 1316 additions and 1169 deletions

View File

@@ -15,51 +15,51 @@
"typecheck": "vue-tsc --noEmit"
},
"dependencies": {
"@gtm-support/vue-gtm": "^1.4.0",
"@vueuse/core": "^8.4.2",
"@gtm-support/vue-gtm": "^1.6.0",
"@vueuse/core": "^8.6.0",
"@vueuse/head": "^0.7.6",
"nprogress": "^0.2.0",
"pinia": "^2.0.14",
"prism-theme-vars": "^0.2.2",
"vue": "^3.2.33",
"prism-theme-vars": "^0.2.3",
"vue": "^3.2.36",
"vue-about-me": "^1.2.7",
"vue-demi": "^0.12.5",
"vue-demi": "^0.13.1",
"vue-router": "^4.0.15"
},
"devDependencies": {
"@antfu/eslint-config": "^0.23.0",
"@antfu/eslint-config": "^0.25.1",
"@iconify-json/fe": "^1.1.1",
"@iconify-json/gg": "^1.1.1",
"@iconify-json/ic": "^1.1.3",
"@iconify-json/mdi": "^1.1.12",
"@iconify-json/ri": "^1.1.1",
"@iconify-json/ic": "^1.1.4",
"@iconify-json/mdi": "^1.1.19",
"@iconify-json/ri": "^1.1.2",
"@types/markdown-it-link-attributes": "^3.0.1",
"@types/nprogress": "^0.2.0",
"@vitejs/plugin-vue": "^2.3.3",
"consola": "^2.15.3",
"critters": "^0.0.16",
"cross-env": "^7.0.3",
"eslint": "^8.15.0",
"eslint": "^8.17.0",
"esno": "^0.14.1",
"https-localhost": "^4.7.1",
"markdown-it-link-attributes": "^4.0.0",
"markdown-it-prism": "^2.2.4",
"pnpm": "^7.0.1",
"sass": "^1.51.0",
"pnpm": "^7.1.8",
"sass": "^1.52.2",
"star-markdown-css": "^0.3.3",
"typescript": "^4.6.4",
"unocss": "^0.33.2",
"typescript": "^4.7.3",
"unocss": "^0.37.4",
"unplugin-auto-import": "^0.7.1",
"unplugin-vue-components": "^0.19.5",
"unplugin-vue-components": "^0.19.6",
"vite": "^2.9.9",
"vite-plugin-inspect": "^0.5.0",
"vite-plugin-md": "^0.13.1",
"vite-plugin-pages": "^0.23.0",
"vite-plugin-pwa": "^0.12.0",
"vite-plugin-vue-layouts": "^0.6.0",
"vite-ssg": "^0.20.0",
"vite-ssg-sitemap": "^0.2.6",
"vite-ssg": "0.20.1",
"vite-ssg-sitemap": "^0.2.7",
"vue-toastification": "^2.0.0-rc.5",
"vue-tsc": "^0.34.12"
"vue-tsc": "^0.36.1"
}
}

1216
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@ function run() {
const csvData = fs.readFileSync(recipeCsvFile, 'utf-8')
const lines = csvData.split(/\r?\n/)
const headers = 'name,stuff,link,difficulty,tags,methods,tools,'
const headers = 'name,stuff,bv,difficulty,tags,methods,tools,'
if (lines[0].trim() !== headers) {
consola.warn(`Headers Changed: ${lines[0]}`)
return
@@ -29,7 +29,9 @@ function run() {
name: attrs[0].trim(),
stuff,
emojis: generateEmojisFromStuff(stuff),
link: attrs[2].trim(),
// link: attrs[2].trim(),
// bv id
bv: attrs[2].trim().replace('https://www.bilibili.com/video/', ''),
difficulty: attrs[3] && attrs[3].trim() as RecipeItem['difficulty'],
tags: attrs[4] ? attrs[4].trim().split(sep) : [],
methods: attrs[5] ? (attrs[5].trim().split(sep)) as RecipeItem['methods'] : [],

View File

@@ -133,6 +133,7 @@ declare global {
const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
const useDraggable: typeof import('@vueuse/core')['useDraggable']
const useDropZone: typeof import('@vueuse/core')['useDropZone']
const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
const useElementHover: typeof import('@vueuse/core')['useElementHover']

View File

@@ -24,7 +24,7 @@ const triggerGtm = (val: string) => {
<template>
<a
:href="dish.link" target="_blank" class="tag rounded" p="x-2"
:href="dish.link || `https://www.bilibili.com/video/${dish.bv}`" target="_blank" class="tag rounded" p="x-2"
border="~ blue-200 dark:blue-800"
bg="blue-300 opacity-20"
@click="triggerGtm(dish.name)"

View File

@@ -133,6 +133,10 @@ export const meat: StuffItem[] = [
name: '骨头',
emoji: '🦴',
},
{
name: '鱼Todo',
emoji: '🐟',
},
]
/**

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,11 @@ export interface RecipeItem {
/**
* 链接
*/
link: string
link?: string
/**
* BiliBili video id
*/
bv?: string
/**
* 材料
*/