🐛 docs: 添加发布插件表单

This commit is contained in:
远野千束 2024-09-22 01:48:53 +08:00
parent fbb9ed82ee
commit 0c859957b4

View File

@ -7,10 +7,7 @@ import {RepoUrl} from "./scripts/statsApi";
import resourcesJson from "../public/resources.json" import resourcesJson from "../public/resources.json"
import {useData} from "vitepress"; import {useData} from "vitepress";
// formLang // formLan
const lang = computed(
() => formatLang(useData().lang.value)
)
// public/assets/resources.json // public/assets/resources.json
let filteredItems = computed(() => { let filteredItems = computed(() => {
@ -43,15 +40,15 @@ function closePublishWindow() {
isPublishWindowOpen.value = false isPublishWindowOpen.value = false
} }
let submitLang = ""
if (formatLang(useData().site.value.lang) === "zh") {
submitLang = "zh"
} else {
submitLang = "en"
}
function submitForm() { function submitForm() {
const title = encodeURI(`Resource: ${newRes.value.name}`) const title = encodeURI(`Resource: ${newRes.value.name}`)
let submitLang = ""
if (lang.value === "zh") {
submitLang = "zh"
} else {
submitLang = "en"
}
const issueURL = `${RepoUrl}/issues/new?assignees=&labels=Resource&template=resource_publish_${submitLang}.yml&title=${title}` const issueURL = `${RepoUrl}/issues/new?assignees=&labels=Resource&template=resource_publish_${submitLang}.yml&title=${title}`
console.log(issueURL) console.log(issueURL)
window.open(issueURL, '_blank') window.open(issueURL, '_blank')