🐛 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 {useData} from "vitepress";
// formLang
const lang = computed(
() => formatLang(useData().lang.value)
)
// formLan
// public/assets/resources.json
let filteredItems = computed(() => {
@ -43,15 +40,15 @@ function closePublishWindow() {
isPublishWindowOpen.value = false
}
let submitLang = ""
if (formatLang(useData().site.value.lang) === "zh") {
submitLang = "zh"
} else {
submitLang = "en"
}
function submitForm() {
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}`
console.log(issueURL)
window.open(issueURL, '_blank')