Skip to content

Commit

Permalink
feat: add tsconfig.json for TypeScript configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbenben committed Apr 16, 2024
1 parent c22fbd9 commit 5d5e423
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/.vuepress/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SocialLink from "./components/SocialLink";
import SocialLink from "./components/SocialLink.js";
import { defineClientConfig } from "vuepress/client";

export default defineClientConfig({
Expand Down
6 changes: 3 additions & 3 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { googleAnalyticsPlugin } from "@vuepress/plugin-google-analytics";
import theme from "./theme.js";

export default defineUserConfig({
// 网站路径默认为主域名。如果网站部署在子路径下,比如 xxx.com/yyy,那么 base 应该被设置为 "/yyy/"
base: "/",

// 网站语言,默认为中文
lang: "zh-CN",
// 网站标题
title: "LearnData 开源笔记",
// 网站描述
description: "开源工具、效率方法、心理学探索的自我提升笔记,记录并输出一切能让自己提升的知识。",

// 网站路径默认为主域名。如果网站部署在子路径下,比如 xxx.com/yyy,那么 base 应该被设置为 "/yyy/"
base: "/",

theme,
// 是否开启页面预拉取,如果服务器宽带足够,可改为 true,会提升其他页面加载速度
shouldPrefetch: false,
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default sidebar({
},
{
text: "博客文章",
icon: "fa-solid fa-blog",
icon: "fa-solid fa-feather-pointed",
prefix: "/_posts/",
link: "/blog",
collapsible: true,
Expand Down
8 changes: 7 additions & 1 deletion docs/.vuepress/styles/config.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// 响应式布局断点,和代码块主题设置,而非网站主题
// 响应式布局断点,网站主题色和代码块主题设置
// https://theme-hope.vuejs.press/zh/config/style.html
// you can change config here

//$theme-color: #3eaf7c !default;
//$theme-colors: #2196f3, #f26d6d, #fb9b5f;

// https://theme-hope.vuejs.press/zh/guide/interface/code-theme.html
//$code-light-theme: 'one-light';
//$code-dark-theme: 'one-dark';
6 changes: 3 additions & 3 deletions docs/.vuepress/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { hopeTheme } from "vuepress-theme-hope";
import navbar from "./navbar";
import sidebar from "./sidebar";
import navbar from "./navbar.js";
import sidebar from "./sidebar.js";

export default hopeTheme({
// 主题选项:https://theme-hope.vuejs.press/zh/config/theme/layout.html
Expand Down Expand Up @@ -184,7 +184,7 @@ export default hopeTheme({
json: true,
rss: true,
count: 10,
sorter: (a, b) => b.frontmatter.date - a.frontmatter.date,
sorter: (a, b) => Number(b.frontmatter.date) - Number(a.frontmatter.date),
},
},

Expand Down
9 changes: 9 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ES2022"
},
"include": ["docs/.vuepress/**/*.ts", "docs/.vuepress/**/*.vue"],
"exclude": ["node_modules"]
}

0 comments on commit 5d5e423

Please sign in to comment.