|
| 1 | +import { getBlogs } from "./theme/serverUtils"; |
| 2 | +import mdKatex from "./theme/markdown-it-katex"; |
| 3 | +import { buildBlogRSS } from "./theme/rss"; |
| 4 | +import * as SECRETS from "./secret"; |
| 5 | +import MarkdownIt from "markdown-it"; |
| 6 | + |
| 7 | +async function configs() { |
| 8 | + return { |
| 9 | + title: "makevyc的博客", |
| 10 | + head: [ |
| 11 | + // live2d widget |
| 12 | + [ |
| 13 | + "script", |
| 14 | + { |
| 15 | + src: "https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js", |
| 16 | + } |
| 17 | + ], |
| 18 | + // KaTex stylesheet for markdown-it-katex |
| 19 | + [ |
| 20 | + "link", |
| 21 | + { |
| 22 | + rel: "stylesheet", |
| 23 | + href: |
| 24 | + "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css", |
| 25 | + }, |
| 26 | + ], |
| 27 | + // markdown-it |
| 28 | + [ |
| 29 | + "link", |
| 30 | + { |
| 31 | + rel: "stylesheet", |
| 32 | + href: |
| 33 | + "https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/4.0.0/github-markdown.min.css", |
| 34 | + }, |
| 35 | + ], |
| 36 | + // font-awesome |
| 37 | + [ |
| 38 | + "link", |
| 39 | + { |
| 40 | + rel: "stylesheet", |
| 41 | + href: |
| 42 | + "https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css", |
| 43 | + }, |
| 44 | + ], |
| 45 | + // ionicons used in `about-me` page |
| 46 | + [ |
| 47 | + "link", |
| 48 | + { |
| 49 | + rel: "stylesheet", |
| 50 | + href: "https://cdn.staticfile.org/ionicons/2.0.1/css/ionicons.min.css", |
| 51 | + }, |
| 52 | + ], |
| 53 | + // site resources |
| 54 | + [ |
| 55 | + "link", |
| 56 | + { |
| 57 | + rel: "icon", |
| 58 | + type: "image/png", |
| 59 | + href: "/logo.png", |
| 60 | + }, |
| 61 | + ], |
| 62 | + [ |
| 63 | + "meta", |
| 64 | + { |
| 65 | + name: "author", |
| 66 | + content: "makevyc", |
| 67 | + }, |
| 68 | + ], |
| 69 | + [ |
| 70 | + "meta", |
| 71 | + { |
| 72 | + property: "og:title", |
| 73 | + content: "Home", |
| 74 | + }, |
| 75 | + ], |
| 76 | + [ |
| 77 | + "meta", |
| 78 | + { |
| 79 | + property: "og:description", |
| 80 | + content: "Home of makevyc", |
| 81 | + }, |
| 82 | + ], |
| 83 | + ], |
| 84 | + locales: { |
| 85 | + root: { |
| 86 | + label: 'English', lang: 'en', |
| 87 | + description: "Personal Blog", |
| 88 | + themeConfig: { |
| 89 | + lastUpdatedText: "Last Updated", |
| 90 | + nav: [ |
| 91 | + { text: "🏡Homepage", link: "/" }, |
| 92 | + { text: "🦹♂️About Me", link: "/about-me/" }, |
| 93 | + { |
| 94 | + text: "📓Blogs", |
| 95 | + items: [ |
| 96 | + { text: "📃Archives", link: "/zh/blogs/" }, |
| 97 | + { text: "🔖Tags", link: "/zh/blogs/tags/" }, |
| 98 | + ], |
| 99 | + }, |
| 100 | + { |
| 101 | + text: "🔥RSS", |
| 102 | + link: "https://makevyc.github.io/feed.xml", |
| 103 | + }, |
| 104 | + ], |
| 105 | + } |
| 106 | + }, |
| 107 | + zh: { |
| 108 | + label: '中文', lang: 'zh-CN', link: '/zh/', |
| 109 | + description: "个人博客", |
| 110 | + themeConfig: { |
| 111 | + lastUpdatedText: "上次更新", |
| 112 | + nav: [ |
| 113 | + { text: "🏡主页", link: "/zh/" }, |
| 114 | + { text: "🦹♂️关于我", link: "/zh/about-me/" }, |
| 115 | + { |
| 116 | + text: "📓博客", |
| 117 | + items: [ |
| 118 | + { text: "📃所有博客", link: "/zh/blogs/" }, |
| 119 | + { text: "🔖标签分类", link: "/zh/blogs/tags/" }, |
| 120 | + ], |
| 121 | + }, |
| 122 | + { |
| 123 | + text: "🔥RSS", |
| 124 | + link: "https://makevyc.github.io/feed.xml", |
| 125 | + }, |
| 126 | + ], |
| 127 | + } |
| 128 | + }, |
| 129 | + }, |
| 130 | + themeConfig: { |
| 131 | + logo: "/assets/logo.png", |
| 132 | + homeLottie: "/assets/lottie-developer.json", |
| 133 | + i18nRouting: false, |
| 134 | + // refer to the `VPNavBarTitle.vue` in default theme, |
| 135 | + // we have to set it to null to disable the text in navigation bar, |
| 136 | + // the undefined is not applicable here, |
| 137 | + siteTitle: null, |
| 138 | + blogs: await getBlogs(), |
| 139 | + // select two latest posts to display on the index page |
| 140 | + latestNum: 2, |
| 141 | + // gitalk comments configurations |
| 142 | + gitalk: { |
| 143 | + admin: ["makevyc"], |
| 144 | + repo: 'makevyc.github.io', |
| 145 | + clientID: SECRETS.GITALK_ID, |
| 146 | + clientSecret: SECRETS.GITALK_SECRET, |
| 147 | + owner: "makevyc", |
| 148 | + }, |
| 149 | + // algolia search configurations |
| 150 | + algolia: { |
| 151 | + indexName: 'forswornsio', |
| 152 | + appId: SECRETS.ALGOLIA_ID, |
| 153 | + apiKey: SECRETS.ALGOLIA_SECRET, |
| 154 | + }, |
| 155 | + socialLinks: [ |
| 156 | + { icon: "github", link: "https://github.com/makevyc" }, |
| 157 | + ], |
| 158 | + }, |
| 159 | + markdown: { |
| 160 | + config: (md: MarkdownIt) => { |
| 161 | + md.use(mdKatex); |
| 162 | + }, |
| 163 | + }, |
| 164 | + buildEnd: buildBlogRSS, |
| 165 | + }; |
| 166 | +} |
| 167 | + |
| 168 | +export default configs(); |
0 commit comments