From 47205e40d696f0fd5ec02822afa827c5b408b546 Mon Sep 17 00:00:00 2001 From: Taron Chatoyan Date: Thu, 6 Jun 2024 14:20:01 +0400 Subject: [PATCH 1/3] replaced the markdown with vue component --- components/layout/PluginContainer.vue | 347 ++++++++++++++++++++++++++ nuxt.config.ts | 14 +- package-lock.json | 28 ++- package.json | 5 +- pages/plugins/[...slug].vue | 2 +- server/api/plugins.js | 91 ++++++- 6 files changed, 462 insertions(+), 25 deletions(-) create mode 100644 components/layout/PluginContainer.vue diff --git a/components/layout/PluginContainer.vue b/components/layout/PluginContainer.vue new file mode 100644 index 0000000000..3f838aec2a --- /dev/null +++ b/components/layout/PluginContainer.vue @@ -0,0 +1,347 @@ + + + + \ No newline at end of file diff --git a/nuxt.config.ts b/nuxt.config.ts index 1f18250b59..8f5af4fec3 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -8,8 +8,14 @@ export default defineNuxtConfig({ 'nuxt-gtag', 'nuxt-multi-cache', 'vue3-carousel-nuxt', - 'nuxt-lazy-hydrate' + 'nuxt-lazy-hydrate', + '@nuxtjs/mdc' ], + mdc: { + components: { + prose: false, // Disable predefined prose components + }, + }, sitemap: { sitemaps: { default: { @@ -73,9 +79,6 @@ export default defineNuxtConfig({ 'remark-flexible-markers': { markerClassName: 'type-mark', }, - 'remark-code-import': { - rootDir: process.cwd() - }, } }, }, @@ -206,8 +209,9 @@ export default defineNuxtConfig({ }, devtools: { + enabled: true, timeline: { enabled: true } } -}) +}) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 402cab1d31..5d3baedd4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "@nuxt/content": "^2.12.1", "@nuxt/devtools": "^1.3.2", "@nuxt/image": "^1.7.0", - "@nuxtjs/mdc": "npm:@nuxtjs/mdc-edge@0.7.2-28597777.7f98bca", + "@nuxtjs/mdc": "npm:@nuxtjs/mdc-edge@0.6.2-28517347.0c8167c", "@nuxtjs/sitemap": "^5.2.0", "@types/node": "^20.12.12", "nuxt": "^3.11.2", @@ -52,9 +52,13 @@ "remark-flexible-markers": "^1.2.1", "rss": "^1.2.2", "sass": "^1.77.2", + "shiki": "^1.1.7", "wrangler": "^3.57.1" } }, + " ../ui-libs": { + "extraneous": true + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -3224,16 +3228,16 @@ }, "node_modules/@nuxtjs/mdc": { "name": "@nuxtjs/mdc-edge", - "version": "0.7.2-28597777.7f98bca", - "resolved": "https://registry.npmjs.org/@nuxtjs/mdc-edge/-/mdc-edge-0.7.2-28597777.7f98bca.tgz", - "integrity": "sha512-UBWHF30jz8bKqFwOVCqt5sRglZ9CFT00yNghHYtN5nswS+HwEKapJktbFRbG6IyUBdPY7h7E4jCZ/gry4Wx3EA==", + "version": "0.6.2-28517347.0c8167c", + "resolved": "https://registry.npmjs.org/@nuxtjs/mdc-edge/-/mdc-edge-0.6.2-28517347.0c8167c.tgz", + "integrity": "sha512-t4Yp5K2kTolul2Rvz/wSt9kMGYNQHWfFQOBr/lJVBqamF1djaxE+cbhOB06P1W5vZd5USMhjVa6MuiAXNnTtoQ==", "dev": true, "dependencies": { - "@nuxt/kit": "^3.11.2", - "@shikijs/transformers": "^1.5.2", + "@nuxt/kit": "^3.11.1", + "@shikijs/transformers": "^1.2.0", "@types/hast": "^3.0.4", - "@types/mdast": "^4.0.4", - "@vue/compiler-core": "^3.4.27", + "@types/mdast": "^4.0.3", + "@vue/compiler-core": "^3.4.21", "consola": "^3.2.3", "debug": "^4.3.4", "defu": "^6.1.4", @@ -3246,7 +3250,7 @@ "ohash": "^1.1.3", "parse5": "^7.1.2", "pathe": "^1.1.2", - "property-information": "^6.5.0", + "property-information": "^6.4.1", "rehype-external-links": "^3.0.0", "rehype-raw": "^7.0.0", "rehype-slug": "^6.0.0", @@ -3254,16 +3258,16 @@ "rehype-sort-attributes": "^5.0.0", "remark-emoji": "^4.0.1", "remark-gfm": "^4.0.0", - "remark-mdc": "^3.2.1", + "remark-mdc": "^3.2.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.1.0", "scule": "^1.3.0", - "shiki": "^1.5.2", + "shiki": "^1.2.0", "ufo": "^1.5.3", "unified": "^11.0.4", "unist-builder": "^4.0.0", "unist-util-visit": "^5.0.0", - "unwasm": "^0.3.9" + "unwasm": "^0.3.8" } }, "node_modules/@nuxtjs/sitemap": { diff --git a/package.json b/package.json index 3a92556bae..6d094f2353 100644 --- a/package.json +++ b/package.json @@ -49,16 +49,17 @@ "@nuxt/content": "^2.12.1", "@nuxt/devtools": "^1.3.2", "@nuxt/image": "^1.7.0", - "@nuxtjs/mdc": "npm:@nuxtjs/mdc-edge@0.7.2-28597777.7f98bca", + "@nuxtjs/mdc": "npm:@nuxtjs/mdc-edge@0.6.2-28517347.0c8167c", "@nuxtjs/sitemap": "^5.2.0", "@types/node": "^20.12.12", "nuxt": "^3.11.2", "nuxt-gtag": "^2.0.6", "nuxt-multi-cache": "^3.1.1", + "shiki": "^1.1.7", "remark-code-import": "file:./utils/remark-code-import", "remark-flexible-markers": "^1.2.1", "rss": "^1.2.2", "sass": "^1.77.2", "wrangler": "^3.57.1" } -} +} \ No newline at end of file diff --git a/pages/plugins/[...slug].vue b/pages/plugins/[...slug].vue index 50fdd80e65..db2917ea4b 100644 --- a/pages/plugins/[...slug].vue +++ b/pages/plugins/[...slug].vue @@ -3,7 +3,7 @@