1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

feat: update deps and use pnpm

This commit is contained in:
Mr.Hope 2023-04-28 16:17:44 +08:00
parent c1fc5ac09c
commit 7703240ba3
14 changed files with 6304 additions and 78 deletions

13
.gitignore vendored
View File

@ -1,15 +1,14 @@
/node_modules node_modules/
/package-lock.json
# *.drawio # *.drawio
*.drawio.bkp *.drawio.bkp
.DS_Store .DS_Store
# VS Code Config file # VS Code Config file
.vscode/ .vscode/
# Vuepress Cache # VuePress Cache
.cache/ **/.vuepress/.cache/
# Vuepress Temp # VuePress Temp
.temp/ **/.vuepress/.temp/
# Vuepress Output # VuePress Output
dist/ dist/
# Build files # Build files
packages/*/lib/ packages/*/lib/

View File

@ -1,14 +1,15 @@
import { defineUserConfig } from "vuepress"; import { defineUserConfig } from "vuepress";
import { themeConfig } from "./themeConfig"; import { searchProPlugin } from "vuepress-plugin-search-pro";
import { searchPlugin } from "@vuepress/plugin-search";
import theme from "./theme.js";
export default defineUserConfig({ export default defineUserConfig({
dest: "./dist", dest: "./dist",
theme: themeConfig,
shouldPrefetch: false,
title: "JavaGuide(Java面试+学习指南)", title: "JavaGuide(Java面试+学习指南)",
description: description:
"「Java学习指北+Java面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识。准备 Java 面试,复习 Java 知识点,首选 JavaGuide ", "「Java学习指北+Java面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识。准备 Java 面试,复习 Java 知识点,首选 JavaGuide ",
head: [ head: [
// meta // meta
["meta", { name: "robots", content: "all" }], ["meta", { name: "robots", content: "all" }],
@ -46,25 +47,16 @@ export default defineUserConfig({
["link", { rel: "stylesheet", href: "/iconfont/iconfont.css" }], ["link", { rel: "stylesheet", href: "/iconfont/iconfont.css" }],
["link", { rel: "icon", href: "/favicon.ico" }], ["link", { rel: "icon", href: "/favicon.ico" }],
], ],
locales: { locales: {
"/": { "/": {
lang: "zh-CN", lang: "zh-CN",
}, },
}, },
plugins: [
searchPlugin({ theme,
// https://v2.vuepress.vuejs.org/zh/reference/plugin/search.html
// 排除首页 plugins: [searchProPlugin({ indexContent: true })],
isSearchable: (page) => page.path !== "/",
maxSuggestions: 10, shouldPrefetch: false,
hotKeys: ["s", "/"],
// 用于在页面的搜索索引中添加额外字段
getExtraFields: () => [],
locales: {
"/": {
placeholder: "搜索",
},
},
}),
],
}); });

View File

@ -1,10 +1,14 @@
import { navbar } from "vuepress-theme-hope"; import { navbar } from "vuepress-theme-hope";
export const navbarConfig = navbar([ export default navbar([
{ text: "面试指南", icon: "java", link: "/home.md" }, { text: "面试指南", icon: "java", link: "/home.md" },
{ text: "开源项目", icon: "github", link: "/open-source-project/" }, { text: "开源项目", icon: "github", link: "/open-source-project/" },
{ text: "技术书籍", icon: "book", link: "/books/" }, { text: "技术书籍", icon: "book", link: "/books/" },
{ text: "程序人生", icon: "article", link: "/high-quality-technical-articles/" }, {
text: "程序人生",
icon: "article",
link: "/high-quality-technical-articles/",
},
{ {
text: "网站相关", text: "网站相关",
icon: "about", icon: "about",

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2922463 */ font-family: "iconfont"; /* Project id 2922463 */
src: url('iconfont.woff2?t=1660530571134') format('woff2'), src: url("iconfont.woff2?t=1660530571134") format("woff2"),
url('iconfont.woff?t=1660530571134') format('woff'), url("iconfont.woff?t=1660530571134") format("woff"),
url('iconfont.ttf?t=1660530571134') format('truetype'); url("iconfont.ttf?t=1660530571134") format("truetype");
} }
.iconfont { .iconfont {
@ -220,4 +220,3 @@
.icon-intellijidea:before { .icon-intellijidea:before {
content: "\ebd1"; content: "\ebd1";
} }

View File

@ -1,8 +1,10 @@
export const aboutTheAuthor = [ import { arraySidebar } from "vuepress-theme-hope";
export const aboutTheAuthor = arraySidebar([
{ {
text: "个人经历", text: "个人经历",
icon: "zuozhe", icon: "zuozhe",
collapsable: false, collapsible: false,
children: [ children: [
"internet-addiction-teenager", "internet-addiction-teenager",
"my-college-life", "my-college-life",
@ -14,7 +16,7 @@ export const aboutTheAuthor = [
{ {
text: "杂谈", text: "杂谈",
icon: "chat", icon: "chat",
collapsable: false, collapsible: false,
children: [ children: [
"writing-technology-blog-six-years", "writing-technology-blog-six-years",
"my-article-was-stolen-and-made-into-video-and-it-became-popular", "my-article-was-stolen-and-made-into-video-and-it-became-popular",
@ -22,4 +24,4 @@ export const aboutTheAuthor = [
"zhishixingqiu-two-years", "zhishixingqiu-two-years",
], ],
}, },
]; ]);

View File

@ -1,4 +1,6 @@
export const books = [ import { arraySidebar } from "vuepress-theme-hope";
export const books = arraySidebar([
{ {
text: "计算机基础", text: "计算机基础",
link: "cs-basics", link: "cs-basics",
@ -30,4 +32,4 @@ export const books = [
link: "distributed-system", link: "distributed-system",
icon: "distributed-network", icon: "distributed-network",
}, },
]; ]);

View File

@ -1,9 +1,11 @@
export const highQualityTechnicalArticles = [ import { arraySidebar } from "vuepress-theme-hope";
export const highQualityTechnicalArticles = arraySidebar([
{ {
text: "练级攻略", text: "练级攻略",
icon: "et-performance", icon: "et-performance",
prefix: "advanced-programmer/", prefix: "advanced-programmer/",
collapsable: false, collapsible: false,
children: [ children: [
"the-growth-strategy-of-the-technological-giant", "the-growth-strategy-of-the-technological-giant",
"seven-tips-for-becoming-an-advanced-programmer", "seven-tips-for-becoming-an-advanced-programmer",
@ -14,7 +16,7 @@ export const highQualityTechnicalArticles = [
text: "个人经历", text: "个人经历",
icon: "experience", icon: "experience",
prefix: "personal-experience/", prefix: "personal-experience/",
collapsable: false, collapsible: false,
children: [ children: [
"four-year-work-in-tencent-summary", "four-year-work-in-tencent-summary",
"two-years-of-back-end-develop--experience-in-didi&toutiao", "two-years-of-back-end-develop--experience-in-didi&toutiao",
@ -26,7 +28,7 @@ export const highQualityTechnicalArticles = [
text: "程序员", text: "程序员",
icon: "code", icon: "code",
prefix: "programmer/", prefix: "programmer/",
collapsable: false, collapsible: false,
children: [ children: [
"how-do-programmers-publish-a-technical-book", "how-do-programmers-publish-a-technical-book",
"efficient-book-publishing-and-practice-guide", "efficient-book-publishing-and-practice-guide",
@ -36,7 +38,7 @@ export const highQualityTechnicalArticles = [
text: "面试", text: "面试",
icon: "interview", icon: "interview",
prefix: "interview/", prefix: "interview/",
collapsable: false, collapsible: false,
children: [ children: [
"the-experience-of-get-offer-from-over-20-big-companies", "the-experience-of-get-offer-from-over-20-big-companies",
"the-experience-and-thinking-of-an-interview-experienced-by-an-older-programmer", "the-experience-and-thinking-of-an-interview-experienced-by-an-older-programmer",
@ -52,10 +54,10 @@ export const highQualityTechnicalArticles = [
text: "工作", text: "工作",
icon: "work", icon: "work",
prefix: "work/", prefix: "work/",
collapsable: false, collapsible: false,
children: [ children: [
"get-into-work-mode-quickly-when-you-join-a-company", "get-into-work-mode-quickly-when-you-join-a-company",
"employee-performance", "employee-performance",
], ],
}, },
]; ]);

View File

@ -1,10 +1,11 @@
import { sidebar } from "vuepress-theme-hope"; import { sidebar } from "vuepress-theme-hope";
import { highQualityTechnicalArticles } from "./sidebar/high-quality-technical-articles";
import { aboutTheAuthor } from "./sidebar/about-the-author";
import { books } from "./sidebar/books";
import { openSourceProject } from "./sidebar/open-source-project";
export const sidebarConfig = sidebar({ import { aboutTheAuthor } from "./about-the-author.js";
import { books } from "./books.js";
import { highQualityTechnicalArticles } from "./high-quality-technical-articles.js";
import { openSourceProject } from "./open-source-project.js";
export default sidebar({
// 应该把更精确的路径放置在前边 // 应该把更精确的路径放置在前边
"/open-source-project/": openSourceProject, "/open-source-project/": openSourceProject,
"/books/": books, "/books/": books,
@ -198,10 +199,7 @@ export const sidebarConfig = sidebar({
text: "Linux", text: "Linux",
collapsible: true, collapsible: true,
icon: "linux", icon: "linux",
children: [ children: ["linux-intro", "shell-intro"],
"linux-intro",
"shell-intro",
],
}, },
], ],
}, },

View File

@ -1,4 +1,6 @@
export const openSourceProject = [ import { arraySidebar } from "vuepress-theme-hope";
export const openSourceProject = arraySidebar([
{ {
text: "技术教程", text: "技术教程",
link: "tutorial", link: "tutorial",
@ -34,4 +36,4 @@ export const openSourceProject = [
link: "big-data", link: "big-data",
icon: "big-data", icon: "big-data",
}, },
]; ]);

View File

@ -1,4 +1,4 @@
$theme-color: #2980B9; $theme-color: #2980b9;
$sidebar-width: 20rem; $sidebar-width: 20rem;
$sidebar-mobile-width: 16rem; $sidebar-mobile-width: 16rem;
$content-width: 60em; $content-width: 60em;

View File

@ -1,19 +1,28 @@
import { hopeTheme } from "vuepress-theme-hope"; import { hopeTheme } from "vuepress-theme-hope";
import { navbarConfig } from "./navbar";
import { sidebarConfig } from "./sidebar";
export const themeConfig = hopeTheme({ import navbar from "./navbar.js";
import sidebar from "./sidebar/index.js";
export default hopeTheme({
logo: "/logo.png", logo: "/logo.png",
hostname: "https://javaguide.cn/", hostname: "https://javaguide.cn/",
iconAssets: "//at.alicdn.com/t/c/font_2922463_9aayheyb3v7.css",
author: { author: {
name: "Guide", name: "Guide",
url: "https://javaguide.cn/article/", url: "https://javaguide.cn/article/",
}, },
repo: "https://github.com/Snailclimb/JavaGuide", repo: "https://github.com/Snailclimb/JavaGuide",
docsDir: "docs", docsDir: "docs",
iconAssets: "//at.alicdn.com/t/c/font_2922463_9aayheyb3v7.css",
navbar: navbarConfig, navbar,
sidebar: sidebarConfig, sidebar,
footer:
'<a href="https://beian.miit.gov.cn/" target="_blank">鄂ICP备2020015769号-1</a>',
displayFooter: true,
pageInfo: [ pageInfo: [
"Author", "Author",
"Category", "Category",
@ -23,6 +32,7 @@ export const themeConfig = hopeTheme({
"Word", "Word",
"ReadingTime", "ReadingTime",
], ],
blog: { blog: {
intro: "/about-the-author/", intro: "/about-the-author/",
sidebarDisplay: "mobile", sidebarDisplay: "mobile",
@ -32,9 +42,7 @@ export const themeConfig = hopeTheme({
Gitee: "https://gitee.com/SnailClimb", Gitee: "https://gitee.com/SnailClimb",
}, },
}, },
footer:
'<a href="https://beian.miit.gov.cn/" target="_blank">鄂ICP备2020015769号-1</a>',
displayFooter: true,
plugins: { plugins: {
blog: true, blog: true,
copyright: true, copyright: true,

View File

@ -5,19 +5,17 @@
"description": "javaguide", "description": "javaguide",
"license": "MIT", "license": "MIT",
"author": "Guide", "author": "Guide",
"packageManager": "pnpm@8.3.1",
"scripts": { "scripts": {
"vite-build": "vuepress-vite build docs", "docs:build": "vuepress build docs",
"vite-serve": "vuepress-vite dev docs", "docs:serve": "vuepress dev docs",
"vite-clean-serve": "vuepress-vite dev docs --clean-cache", "docs:clean-serve": "vuepress dev docs --clean-cache"
"webpack-build": "vuepress-webpack build docs",
"webpack-clean-serve": "vuepress-webpack dev docs --clean-cache",
"webpack-serve": "vuepress-webpack dev docs"
}, },
"dependencies": { "dependencies": {
"vuepress": "^2.0.0-beta.53", "@vuepress/client": "2.0.0-beta.61",
"vuepress-theme-hope": "^2.0.0-beta.122", "vue": "3.2.47",
"vuepress-vite": "2.0.0-beta.53", "vuepress": "2.0.0-beta.61",
"vuepress-webpack": "2.0.0-beta.53", "vuepress-plugin-search-pro": "2.0.0-beta.206",
"@vuepress/plugin-search": "^2.0.0-beta.53" "vuepress-theme-hope": "2.0.0-beta.206"
} }
} }

6220
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff