diff --git a/components/content/Ref.vue b/components/content/Ref.vue index 3f1c7acc6aa48f4aaf756a8a2c5ba55180467bad..7f7ad49220bfce1abf9b9cd8669b357baa5fca4d 100644 --- a/components/content/Ref.vue +++ b/components/content/Ref.vue @@ -3,15 +3,18 @@ export interface Props { doi: string; } const props = withDefaults(defineProps<Props>(), {}); -const { article } = useFetchArticle(props.doi); +const dois = computed(() => { + return props.doi.split(',').map((d) => d.trim()).filter(d => d !== "") +}) + + + </script> <template> - <v-chip - v-if="article" - variant="text" - :href="`#ref-${props.doi}`" - class="pa-0 text-caption font-italic" - >({{ article?.author[0]?.family ?? "test" }} et al, - {{ article?.year }})</v-chip - > + ( + <template v-for="doi, index in dois" :key="doi"> + <RefArticle :doi="doi"></RefArticle> + <span v-if="index < dois.length - 1">, </span> + </template> + ) </template> \ No newline at end of file diff --git a/components/content/RefArticle.vue b/components/content/RefArticle.vue new file mode 100644 index 0000000000000000000000000000000000000000..fd998940d9c88def1dd19f125a74f2afa4e1f8f2 --- /dev/null +++ b/components/content/RefArticle.vue @@ -0,0 +1,13 @@ +<script setup lang="ts"> +export interface Props { + doi: string; +} +const props = withDefaults(defineProps<Props>(), {}); + +const { article } = useFetchArticle(props.doi); +</script> +<template> + <v-chip v-if="article" variant="text" :href="`#ref-${props.doi}`" class="pa-0 text-caption font-italic">{{ + article?.author[0]?.family ?? "test" }} et al, + {{ article?.year }}</v-chip> +</template> \ No newline at end of file diff --git a/components/content/References.vue b/components/content/References.vue index 8f8644216223aa9c01cf26973d058e74b5e39601..043faaeac24742ce80b1c6830ad78e59c3e389b9 100644 --- a/components/content/References.vue +++ b/components/content/References.vue @@ -2,8 +2,6 @@ import ProseH2 from '~/components/content/ProseH2' const { page } = useContent(); const computedDois = computed(() => { - // console.log(page.value) - // console.log(page.value?.references) if (page.value?.references?.length > 0) { return page.value.references; } else { diff --git a/composables/useFetchArticle.ts b/composables/useFetchArticle.ts index 8e607bdfb9067637065af8b20f3fc42be01e10b2..a89adcac5d2ed8b0308989bb020bb0122d7f4ce1 100644 --- a/composables/useFetchArticle.ts +++ b/composables/useFetchArticle.ts @@ -2,6 +2,8 @@ import { useArticlesStore, type CslJson } from '../stores/articles' import { ref, computed, watchEffect, toValue } from "vue" // import { useFetch } from '#app'; // import { useFetch } from "nuxt" +import { useFetch } from '#imports' + export interface ArticleMessage { DOI: string; @@ -110,11 +112,11 @@ export function useFetchArticle(doi: string) { useFetch<RawArticle>(toValue(url), { lazy: true, server: false, }).then(({ data, pending: pendingUseFetch }) => { - if (data.value?.message) { - srcArticle.value = data.value.message - } - pending.value = pendingUseFetch.value - }) + if (data.value?.message) { + srcArticle.value = data.value.message + } + pending.value = pendingUseFetch.value + }) } diff --git a/package-lock.json b/package-lock.json index fdcc13667b9d413e4caa426454bfc3721e1e931c..764ea4a8d4bfe1cef05aa6de9922d892e105ed45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -522,7 +522,7 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.6", + "version": "0.19.7", "cpu": [ "x64" ], @@ -1429,26 +1429,26 @@ } }, "node_modules/@nuxt/kit": { - "version": "3.8.1", + "version": "3.8.2", "license": "MIT", "dependencies": { - "@nuxt/schema": "3.8.1", + "@nuxt/schema": "3.8.2", "c12": "^1.5.1", "consola": "^3.2.3", "defu": "^6.1.3", - "globby": "^13.2.2", + "globby": "^14.0.0", "hash-sum": "^2.0.0", - "ignore": "^5.2.4", + "ignore": "^5.3.0", "jiti": "^1.21.0", "knitwork": "^1.0.0", "mlly": "^1.4.2", "pathe": "^1.1.1", "pkg-types": "^1.0.3", - "scule": "^1.0.0", + "scule": "^1.1.0", "semver": "^7.5.4", - "ufo": "^1.3.1", + "ufo": "^1.3.2", "unctx": "^2.3.1", - "unimport": "^3.4.0", + "unimport": "^3.5.0", "untyped": "^1.4.0" }, "engines": { @@ -1456,7 +1456,7 @@ } }, "node_modules/@nuxt/schema": { - "version": "3.8.1", + "version": "3.8.2", "license": "MIT", "dependencies": { "@nuxt/ui-templates": "^1.3.1", @@ -1465,9 +1465,10 @@ "hookable": "^5.5.3", "pathe": "^1.1.1", "pkg-types": "^1.0.3", - "std-env": "^3.4.3", - "ufo": "^1.3.1", - "unimport": "^3.4.0", + "scule": "^1.1.0", + "std-env": "^3.5.0", + "ufo": "^1.3.2", + "unimport": "^3.5.0", "untyped": "^1.4.0" }, "engines": { @@ -1520,26 +1521,26 @@ "license": "CC-BY-ND-4.0" }, "node_modules/@nuxt/vite-builder": { - "version": "3.8.1", + "version": "3.8.2", "dev": true, "license": "MIT", "dependencies": { - "@nuxt/kit": "3.8.1", + "@nuxt/kit": "3.8.2", "@rollup/plugin-replace": "^5.0.5", - "@vitejs/plugin-vue": "^4.4.0", - "@vitejs/plugin-vue-jsx": "^3.0.2", + "@vitejs/plugin-vue": "^4.5.0", + "@vitejs/plugin-vue-jsx": "^3.1.0", "autoprefixer": "^10.4.16", "clear": "^0.1.0", "consola": "^3.2.3", "cssnano": "^6.0.1", "defu": "^6.1.3", - "esbuild": "^0.19.5", + "esbuild": "^0.19.6", "escape-string-regexp": "^5.0.0", "estree-walker": "^3.0.3", "externality": "^1.0.2", "fs-extra": "^11.1.1", "get-port-please": "^3.1.1", - "h3": "^1.8.2", + "h3": "^1.9.0", "knitwork": "^1.0.0", "magic-string": "^0.30.5", "mlly": "^1.4.2", @@ -1549,10 +1550,10 @@ "pkg-types": "^1.0.3", "postcss": "^8.4.31", "rollup-plugin-visualizer": "^5.9.2", - "std-env": "^3.4.3", + "std-env": "^3.5.0", "strip-literal": "^1.3.0", - "ufo": "^1.3.1", - "unplugin": "^1.5.0", + "ufo": "^1.3.2", + "unplugin": "^1.5.1", "vite": "^4.5.0", "vite-node": "^0.33.0", "vite-plugin-checker": "^0.6.2", @@ -1574,7 +1575,7 @@ } }, "node_modules/@nuxtjs/mdc": { - "version": "0.2.6", + "version": "0.2.7", "dev": true, "license": "MIT", "dependencies": { @@ -1602,7 +1603,7 @@ "remark-mdc": "^2.1.0", "remark-parse": "^10.0.2", "remark-rehype": "^10.1.0", - "scule": "^1.0.0", + "scule": "^1.1.0", "shikiji": "^0.6.10", "ufo": "^1.3.1", "unified": "^11.0.3", @@ -1762,6 +1763,17 @@ } } }, + "node_modules/@rollup/plugin-alias/node_modules/slash": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@rollup/plugin-commonjs": { "version": "25.0.7", "dev": true, @@ -1930,6 +1942,30 @@ } } }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.5.0", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.5.0", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@sigstore/bundle": { "version": "2.1.0", "dev": true, @@ -1975,16 +2011,26 @@ } }, "node_modules/@sindresorhus/is": { - "version": "6.1.0", + "version": "4.6.0", "dev": true, "license": "MIT", "engines": { - "node": ">=16" + "node": ">=10" }, "funding": { "url": "https://github.com/sindresorhus/is?sponsor=1" } }, + "node_modules/@sindresorhus/merge-streams": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@socket.io/component-emitter": { "version": "3.1.0", "dev": true, @@ -2040,7 +2086,7 @@ } }, "node_modules/@types/d3-scale-chromatic": { - "version": "3.0.2", + "version": "3.0.3", "license": "MIT" }, "node_modules/@types/d3-time": { @@ -2087,7 +2133,7 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "18.18.10", + "version": "18.18.11", "dev": true, "license": "MIT", "dependencies": { @@ -2120,19 +2166,19 @@ "license": "ISC" }, "node_modules/@unhead/dom": { - "version": "1.8.4", + "version": "1.8.5", "dev": true, "license": "MIT", "dependencies": { - "@unhead/schema": "1.8.4", - "@unhead/shared": "1.8.4" + "@unhead/schema": "1.8.5", + "@unhead/shared": "1.8.5" }, "funding": { "url": "https://github.com/sponsors/harlan-zw" } }, "node_modules/@unhead/schema": { - "version": "1.8.4", + "version": "1.8.5", "dev": true, "license": "MIT", "dependencies": { @@ -2144,37 +2190,37 @@ } }, "node_modules/@unhead/shared": { - "version": "1.8.4", + "version": "1.8.5", "dev": true, "license": "MIT", "dependencies": { - "@unhead/schema": "1.8.4" + "@unhead/schema": "1.8.5" }, "funding": { "url": "https://github.com/sponsors/harlan-zw" } }, "node_modules/@unhead/ssr": { - "version": "1.8.4", + "version": "1.8.5", "dev": true, "license": "MIT", "dependencies": { - "@unhead/schema": "1.8.4", - "@unhead/shared": "1.8.4" + "@unhead/schema": "1.8.5", + "@unhead/shared": "1.8.5" }, "funding": { "url": "https://github.com/sponsors/harlan-zw" } }, "node_modules/@unhead/vue": { - "version": "1.8.4", + "version": "1.8.5", "dev": true, "license": "MIT", "dependencies": { - "@unhead/schema": "1.8.4", - "@unhead/shared": "1.8.4", + "@unhead/schema": "1.8.5", + "@unhead/shared": "1.8.5", "hookable": "^5.5.3", - "unhead": "1.8.4" + "unhead": "1.8.5" }, "funding": { "url": "https://github.com/sponsors/harlan-zw" @@ -3179,7 +3225,7 @@ } }, "node_modules/citty": { - "version": "0.1.4", + "version": "0.1.5", "dev": true, "license": "MIT", "dependencies": { @@ -4248,16 +4294,6 @@ "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/dom-serializer": { "version": "2.0.0", "dev": true, @@ -4353,7 +4389,7 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.4.588", + "version": "1.4.589", "license": "ISC" }, "node_modules/elkjs": { @@ -4480,7 +4516,7 @@ } }, "node_modules/esbuild": { - "version": "0.19.6", + "version": "0.19.7", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -4491,28 +4527,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.19.6", - "@esbuild/android-arm64": "0.19.6", - "@esbuild/android-x64": "0.19.6", - "@esbuild/darwin-arm64": "0.19.6", - "@esbuild/darwin-x64": "0.19.6", - "@esbuild/freebsd-arm64": "0.19.6", - "@esbuild/freebsd-x64": "0.19.6", - "@esbuild/linux-arm": "0.19.6", - "@esbuild/linux-arm64": "0.19.6", - "@esbuild/linux-ia32": "0.19.6", - "@esbuild/linux-loong64": "0.19.6", - "@esbuild/linux-mips64el": "0.19.6", - "@esbuild/linux-ppc64": "0.19.6", - "@esbuild/linux-riscv64": "0.19.6", - "@esbuild/linux-s390x": "0.19.6", - "@esbuild/linux-x64": "0.19.6", - "@esbuild/netbsd-x64": "0.19.6", - "@esbuild/openbsd-x64": "0.19.6", - "@esbuild/sunos-x64": "0.19.6", - "@esbuild/win32-arm64": "0.19.6", - "@esbuild/win32-ia32": "0.19.6", - "@esbuild/win32-x64": "0.19.6" + "@esbuild/android-arm": "0.19.7", + "@esbuild/android-arm64": "0.19.7", + "@esbuild/android-x64": "0.19.7", + "@esbuild/darwin-arm64": "0.19.7", + "@esbuild/darwin-x64": "0.19.7", + "@esbuild/freebsd-arm64": "0.19.7", + "@esbuild/freebsd-x64": "0.19.7", + "@esbuild/linux-arm": "0.19.7", + "@esbuild/linux-arm64": "0.19.7", + "@esbuild/linux-ia32": "0.19.7", + "@esbuild/linux-loong64": "0.19.7", + "@esbuild/linux-mips64el": "0.19.7", + "@esbuild/linux-ppc64": "0.19.7", + "@esbuild/linux-riscv64": "0.19.7", + "@esbuild/linux-s390x": "0.19.7", + "@esbuild/linux-x64": "0.19.7", + "@esbuild/netbsd-x64": "0.19.7", + "@esbuild/openbsd-x64": "0.19.7", + "@esbuild/sunos-x64": "0.19.7", + "@esbuild/win32-arm64": "0.19.7", + "@esbuild/win32-ia32": "0.19.7", + "@esbuild/win32-x64": "0.19.7" } }, "node_modules/escalade": { @@ -4906,17 +4942,18 @@ } }, "node_modules/globby": { - "version": "13.2.2", + "version": "14.0.0", "license": "MIT", "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", + "@sindresorhus/merge-streams": "^1.0.0", + "fast-glob": "^3.3.2", "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -7180,7 +7217,7 @@ "license": "MIT" }, "node_modules/meilisearch": { - "version": "0.35.0", + "version": "0.35.1", "license": "MIT", "dependencies": { "cross-fetch": "^3.1.6" @@ -8927,44 +8964,44 @@ } }, "node_modules/nitropack": { - "version": "2.7.2", + "version": "2.8.0", "dev": true, "license": "MIT", "dependencies": { "@cloudflare/kv-asset-handler": "^0.3.0", - "@netlify/functions": "^2.3.0", + "@netlify/functions": "^2.4.0", "@rollup/plugin-alias": "^5.0.1", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-inject": "^5.0.5", "@rollup/plugin-json": "^6.0.1", "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-replace": "^5.0.4", + "@rollup/plugin-replace": "^5.0.5", "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-wasm": "^6.2.2", "@rollup/pluginutils": "^5.0.5", - "@types/http-proxy": "^1.17.13", + "@types/http-proxy": "^1.17.14", "@vercel/nft": "^0.24.3", "archiver": "^6.0.1", "c12": "^1.5.1", "chalk": "^5.3.0", "chokidar": "^3.5.3", - "citty": "^0.1.4", + "citty": "^0.1.5", "consola": "^3.2.3", "cookie-es": "^1.0.0", "defu": "^6.1.3", "destr": "^2.0.2", "dot-prop": "^8.0.2", - "esbuild": "^0.19.5", + "esbuild": "^0.19.6", "escape-string-regexp": "^5.0.0", "etag": "^1.8.1", "fs-extra": "^11.1.1", - "globby": "^13.2.2", + "globby": "^14.0.0", "gzip-size": "^7.0.0", - "h3": "^1.8.2", + "h3": "^1.9.0", "hookable": "^5.5.3", "httpxy": "^0.1.5", "is-primitive": "^3.0.1", - "jiti": "^1.20.0", + "jiti": "^1.21.0", "klona": "^2.0.6", "knitwork": "^1.0.0", "listhen": "^1.5.5", @@ -8975,25 +9012,25 @@ "node-fetch-native": "^1.4.1", "ofetch": "^1.3.3", "ohash": "^1.1.3", - "openapi-typescript": "^6.7.0", + "openapi-typescript": "^6.7.1", "pathe": "^1.1.1", "perfect-debounce": "^1.0.0", "pkg-types": "^1.0.3", "pretty-bytes": "^6.1.1", "radix3": "^1.1.0", - "rollup": "^3.29.4", + "rollup": "^4.5.0", "rollup-plugin-visualizer": "^5.9.2", - "scule": "^1.0.0", + "scule": "^1.1.0", "semver": "^7.5.4", "serve-placeholder": "^2.0.1", "serve-static": "^1.15.0", - "std-env": "^3.4.3", - "ufo": "^1.3.1", + "std-env": "^3.5.0", + "ufo": "^1.3.2", "uncrypto": "^0.1.3", "unctx": "^2.3.1", "unenv": "^1.7.4", - "unimport": "^3.4.0", - "unstorage": "^1.9.0" + "unimport": "^3.5.0", + "unstorage": "^1.10.1" }, "bin": { "nitro": "dist/cli/index.mjs", @@ -9022,17 +9059,44 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/nitropack/node_modules/rollup": { + "version": "4.5.0", + "dev": true, + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.5.0", + "@rollup/rollup-android-arm64": "4.5.0", + "@rollup/rollup-darwin-arm64": "4.5.0", + "@rollup/rollup-darwin-x64": "4.5.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.5.0", + "@rollup/rollup-linux-arm64-gnu": "4.5.0", + "@rollup/rollup-linux-arm64-musl": "4.5.0", + "@rollup/rollup-linux-x64-gnu": "4.5.0", + "@rollup/rollup-linux-x64-musl": "4.5.0", + "@rollup/rollup-win32-arm64-msvc": "4.5.0", + "@rollup/rollup-win32-ia32-msvc": "4.5.0", + "@rollup/rollup-win32-x64-msvc": "4.5.0", + "fsevents": "~2.3.2" + } + }, "node_modules/node-addon-api": { "version": "7.0.0", "dev": true, "license": "MIT" }, "node_modules/node-emoji": { - "version": "2.1.1", + "version": "2.1.3", "dev": true, "license": "MIT", "dependencies": { - "@sindresorhus/is": "^6.0.0", + "@sindresorhus/is": "^4.6.0", "char-regex": "^1.0.2", "emojilib": "^2.4.0", "skin-tone": "^2.0.0" @@ -9354,7 +9418,7 @@ } }, "node_modules/nuxi": { - "version": "3.9.1", + "version": "3.10.0", "dev": true, "license": "MIT", "bin": { @@ -9371,20 +9435,20 @@ } }, "node_modules/nuxt": { - "version": "3.8.1", + "version": "3.8.2", "dev": true, "license": "MIT", "dependencies": { "@nuxt/devalue": "^2.0.2", - "@nuxt/devtools": "^1.0.0", - "@nuxt/kit": "3.8.1", - "@nuxt/schema": "3.8.1", + "@nuxt/devtools": "^1.0.3", + "@nuxt/kit": "3.8.2", + "@nuxt/schema": "3.8.2", "@nuxt/telemetry": "^2.5.2", "@nuxt/ui-templates": "^1.3.1", - "@nuxt/vite-builder": "3.8.1", - "@unhead/dom": "^1.8.3", - "@unhead/ssr": "^1.8.3", - "@unhead/vue": "^1.8.3", + "@nuxt/vite-builder": "3.8.2", + "@unhead/dom": "^1.8.4", + "@unhead/ssr": "^1.8.4", + "@unhead/vue": "^1.8.4", "@vue/shared": "^3.3.8", "acorn": "8.11.2", "c12": "^1.5.1", @@ -9393,20 +9457,20 @@ "defu": "^6.1.3", "destr": "^2.0.2", "devalue": "^4.3.2", - "esbuild": "^0.19.5", + "esbuild": "^0.19.6", "escape-string-regexp": "^5.0.0", "estree-walker": "^3.0.3", "fs-extra": "^11.1.1", - "globby": "^13.2.2", - "h3": "^1.8.2", + "globby": "^14.0.0", + "h3": "^1.9.0", "hookable": "^5.5.3", "jiti": "^1.21.0", "klona": "^2.0.6", "knitwork": "^1.0.0", "magic-string": "^0.30.5", "mlly": "^1.4.2", - "nitropack": "^2.7.2", - "nuxi": "^3.9.1", + "nitropack": "^2.8.0", + "nuxi": "^3.10.0", "nypm": "^0.3.3", "ofetch": "^1.3.3", "ohash": "^1.1.3", @@ -9414,16 +9478,16 @@ "perfect-debounce": "^1.0.0", "pkg-types": "^1.0.3", "radix3": "^1.1.0", - "scule": "^1.0.0", - "std-env": "^3.4.3", + "scule": "^1.1.0", + "std-env": "^3.5.0", "strip-literal": "^1.3.0", - "ufo": "^1.3.1", + "ufo": "^1.3.2", "ultrahtml": "^1.5.2", "uncrypto": "^0.1.3", "unctx": "^2.3.1", "unenv": "^1.7.4", - "unimport": "^3.4.0", - "unplugin": "^1.5.0", + "unimport": "^3.5.0", + "unplugin": "^1.5.1", "unplugin-vue-router": "^0.7.0", "untyped": "^1.4.0", "vue": "^3.3.8", @@ -9903,10 +9967,13 @@ } }, "node_modules/path-type": { - "version": "4.0.0", + "version": "5.0.0", "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/pathe": { @@ -11644,10 +11711,10 @@ } }, "node_modules/slash": { - "version": "4.0.0", + "version": "5.1.0", "license": "MIT", "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -12252,13 +12319,13 @@ } }, "node_modules/unhead": { - "version": "1.8.4", + "version": "1.8.5", "dev": true, "license": "MIT", "dependencies": { - "@unhead/dom": "1.8.4", - "@unhead/schema": "1.8.4", - "@unhead/shared": "1.8.4", + "@unhead/dom": "1.8.5", + "@unhead/schema": "1.8.5", + "@unhead/shared": "1.8.5", "hookable": "^5.5.3" }, "funding": { @@ -12273,6 +12340,16 @@ "node": ">=4" } }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/unified": { "version": "11.0.4", "dev": true, diff --git a/server/plugins/content.ts b/server/plugins/content.ts index 0de47c44fee74d361d7c9b3976d673ba3fc78580..9c3e162b9c30b1e06544f0754c4715f143618812 100644 --- a/server/plugins/content.ts +++ b/server/plugins/content.ts @@ -48,9 +48,12 @@ export default defineNitroPlugin((nitroApp) => { }) const refTags = new Set( refNodes - .map(({ props }) => props?.doi ?? null) + .flatMap(({ props }) => { + return props?.doi ? props.doi.split(',').map(d => d.trim()) : null + }) .filter(doi => doi !== null) ) + console.log(refTags) if (refTags.size > 0) file.references = Array.from(refTags).map(doi => ({ doi })) // Update the TOC // if relevant abstract available