diff --git a/components/card/ArticleCard.vue b/components/card/ArticleCard.vue index 636aae3..ad637c1 100644 --- a/components/card/ArticleCard.vue +++ b/components/card/ArticleCard.vue @@ -1,6 +1,5 @@ - - - - diff --git a/components/card/IntroCard.vue b/components/card/IntroCard.vue index d070454..496ca48 100644 --- a/components/card/IntroCard.vue +++ b/components/card/IntroCard.vue @@ -1,5 +1,5 @@ - - diff --git a/pages/article/[cid].vue b/pages/article/[cid].vue index 33886fe..4b96ca2 100644 --- a/pages/article/[cid].vue +++ b/pages/article/[cid].vue @@ -3,7 +3,7 @@ const route = useRoute(), cid = route.params.cid as string, content = ref>(), - getPost = get, any>('/blog/index.php/api/post', { + getPost = get, unknown>('/blog/index.php/api/post', { params: { cid, md: false, diff --git a/pages/auth.vue b/pages/auth.vue index f56c613..735905c 100644 --- a/pages/auth.vue +++ b/pages/auth.vue @@ -3,6 +3,7 @@ diff --git a/pages/index.vue b/pages/index.vue index e4c7a8d..952a71d 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,7 +1,7 @@ diff --git a/plugins/fontawsome.ts b/plugins/fontawsome.ts index b811e61..2f8f210 100644 --- a/plugins/fontawsome.ts +++ b/plugins/fontawsome.ts @@ -1,6 +1,4 @@ import { config, library } from '@fortawesome/fontawesome-svg-core' -import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' -import { faClock, faFolder } from '@fortawesome/free-regular-svg-icons' import { faBars, faBlog, @@ -18,7 +16,9 @@ import { faPen, faXmark, } from '@fortawesome/free-solid-svg-icons' +import { faClock, faFolder } from '@fortawesome/free-regular-svg-icons' import { faGithubAlt, faQq, faSteamSymbol, faWeibo } from '@fortawesome/free-brands-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' // 因为默认添加了 nuxt会造成一些错误,所以不自动添加样式 config.autoAddCss = false diff --git a/plugins/markdown-it.ts b/plugins/markdown-it.ts index ca631d1..0bd91a8 100644 --- a/plugins/markdown-it.ts +++ b/plugins/markdown-it.ts @@ -1,40 +1,14 @@ import md, { type Options } from 'markdown-it' -// @ts-ignore import mm from 'markdown-it-mathjax3' const options: Options = { - // Enable HTML tags in source - html: true, - - // Use '/' to close single tags (
). - // This is only for full CommonMark compatibility. - xhtmlOut: true, - - // Convert '\n' in paragraphs into
breaks: true, - - // CSS language prefix for fenced blocks. Can be - // Useful for external highlighters. + html: true, langPrefix: 'language-', - - // Autoconvert URL-like text to links linkify: true, - - // Enable some language-neutral replacement + quotes beautification - // For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs - typographer: true, - - // Double + single quotes replacement pairs, when typographer enabled, - // And smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // And ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). quotes: '“”‘’', - - // Highlighter function. Should return escaped HTML, - // Or '' if the source string is not changed and should be escaped externally. - // If result starts with { diff --git a/plugins/mitt.ts b/plugins/mitt.ts index 8733f84..2bd018e 100644 --- a/plugins/mitt.ts +++ b/plugins/mitt.ts @@ -1,6 +1,6 @@ import mitt from 'mitt' -type Events = { +interface Events { openPost: IPost startLoading: boolean eventBus: INotification diff --git a/plugins/typedjs.ts b/plugins/typedjs.ts index f1f74fd..24be5d8 100644 --- a/plugins/typedjs.ts +++ b/plugins/typedjs.ts @@ -1,4 +1,4 @@ -// @ts-expect-error +// @ts-expect-error: 'vue3-typed-js' has no types import VueTyped from 'vue3-typed-js' export default defineNuxtPlugin((nuxtApp) => { diff --git a/types/blog.d.ts b/types/blog.d.ts deleted file mode 100644 index acacea9..0000000 --- a/types/blog.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -declare interface IBlogResponse { - status: string - message: string - data: T -} - -declare interface IPostsData { - page: number - pageSize: number - pages: number - count: number - dataSet: [] -} - -declare interface IPost { - cid: string - title: string - created: string - modified: string - slug: string - commentsNum: string - type: string - digest: string - password: string - categories: ICategory[] - category: string - directory: string[] - date: IDate - year: string - month: string - day: string - hidden: boolean - pathinfo: string - permalink: string - url: string - isMarkdown: boolean - feedUrl: string - feedRssUrl: string - feedAtomUrl: string - fields: any -} - -declare interface ICategory { - mid: string - name: string - slug: string - type: string - description: string - count: string - order: string - parent: string - cid: string - directory: string[] - url: string - feedUrl: string - feedRssUrl: string - feedAtomUrl: string -} - -declare interface IDate { - timeStamp: number - year: string - month: string - day: string -} - -declare interface IPostFull extends IPost { - text: string -} diff --git a/types/blog.ts b/types/blog.ts new file mode 100644 index 0000000..e2a9c61 --- /dev/null +++ b/types/blog.ts @@ -0,0 +1,72 @@ +declare global { + interface IBlogResponse { + status: string + message: string + data: T + } + + interface IPostsData { + page: number + pageSize: number + pages: number + count: number + dataSet: [] + } + + interface IPost { + cid: string + title: string + created: string + modified: string + slug: string + commentsNum: string + type: string + digest: string + password: string + categories: ICategory[] + category: string + directory: string[] + date: IDate + year: string + month: string + day: string + hidden: boolean + pathinfo: string + permalink: string + url: string + isMarkdown: boolean + feedUrl: string + feedRssUrl: string + feedAtomUrl: string + fields: unknown + } + + interface ICategory { + mid: string + name: string + slug: string + type: string + description: string + count: string + order: string + parent: string + cid: string + directory: string[] + url: string + feedUrl: string + feedRssUrl: string + feedAtomUrl: string + } + + interface IDate { + timeStamp: number + year: string + month: string + day: string + } + + interface IPostFull extends IPost { + text: string + } + +} diff --git a/types/git.d.ts b/types/git.d.ts deleted file mode 100644 index 70279f0..0000000 --- a/types/git.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -declare interface IActivity { - id: string - content: T - op_type: string - repo: { - name: string - html_url: string - } - created: string -} - -declare interface IContent { - Commits: ICommit[] - HeadCommit: ICommit - CompareURL: string - Len: number -} - -declare interface ICommit { - Sha1: string - Message: string - AuthorEmail: string - AuthorName: string - CommitterEmail: string - CommitterName: string - Timestamp: string -} diff --git a/types/git.ts b/types/git.ts new file mode 100644 index 0000000..47b5276 --- /dev/null +++ b/types/git.ts @@ -0,0 +1,29 @@ +declare global { + interface IActivity { + id: string + content: T + op_type: string + repo: { + name: string + html_url: string + } + created: string + } + + interface IContent { + Commits: ICommit[] + HeadCommit: ICommit + CompareURL: string + Len: number + } + + interface ICommit { + Sha1: string + Message: string + AuthorEmail: string + AuthorName: string + CommitterEmail: string + CommitterName: string + Timestamp: string + } +} diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index ee986f3..0000000 --- a/types/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare interface IBlogResponse { - status: string - message: string - data: T -} diff --git a/types/index.ts b/types/index.ts new file mode 100644 index 0000000..07c8bbb --- /dev/null +++ b/types/index.ts @@ -0,0 +1,7 @@ +declare global { + interface IBlogResponse { + status: string + message: string + data: T + } +} diff --git a/types/notification.d.ts b/types/notification.d.ts deleted file mode 100644 index 0ac69e7..0000000 --- a/types/notification.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare interface INotification { - level: 'warning' | 'error' | 'info' | 'success' - title: string - message: string -} diff --git a/types/notification.ts b/types/notification.ts new file mode 100644 index 0000000..93a2c38 --- /dev/null +++ b/types/notification.ts @@ -0,0 +1,7 @@ +declare global { + interface INotification { + level: 'warning' | 'error' | 'info' | 'success' + title: string + message: string + } +}