Skip to content

Commit

Permalink
feat: 修改hope主题配置,新增一些文档优化
Browse files Browse the repository at this point in the history
- 优化导航栏结构
- 修改搜索框样式和位置
- 删除无用的eslint校验规则
  • Loading branch information
chufan443 committed Feb 6, 2023
1 parent 5474059 commit c564f9f
Show file tree
Hide file tree
Showing 21 changed files with 5,206 additions and 2,205 deletions.
11 changes: 0 additions & 11 deletions .eslintrc.js

This file was deleted.

20 changes: 1 addition & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ logs
*.log
.vscode
.vscode/*
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
*/.DS_Store
.DS_Store
*/.vscode
Expand All @@ -32,8 +28,6 @@ coverage
# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components
Expand Down Expand Up @@ -66,8 +60,6 @@ typings/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz
Expand Down Expand Up @@ -98,22 +90,12 @@ dist
# vuepress build output
# .vuepress/dist

## static resource
## static resource
docs/.vuepress/.cache/
docs/.vuepress/.temp/
docs/.vuepress/dist/



# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
/docs/.vuepress/.temp/
2 changes: 0 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
>
> 创建时间:2020年2月14日


<!-- ## 关于作者
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
##
## 服务名: JavaScriptCollection
## IP范围: 172.30.0.100
##
version: '2'
services:
### JavaScriptCollection服务,ip范围 172.30.0.100
JavaScriptCollection:
image: registry.cn-hangzhou.aliyuncs.com/142vip/doc_book:JavaScriptCollection_0.0.1
container_name: JavaScriptCollection
Expand Down
105 changes: 6 additions & 99 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,109 +1,16 @@
import {defaultTheme} from "vuepress";
import navbar from "./config/navbar";
import sidebar from "./config/sidebar";


// 参考:https://v2.vuepress.vuejs.org/zh/guide/getting-started.html
// 主题参考:https://antdocs.js.org/
import pluginsConfig from "./config/plugins.config";
import themeConfig from "./config/theme.config";


export default {
title: "凡是过往、皆为序章",
description: "一本有趣的JavaScript合集",
base: "/JavaScriptCollection/",
port: 7100,
port: 5000,
head: [
["link", {rel: "icon", href: "/fight_favicon.ico"}]
],
theme: defaultTheme({
home: '/',
logo: "/favicon.ico",
darkMode: false, // 禁用夜色
navbar,
sidebar,
smoothScroll: true,
lastUpdated: true,
lastUpdatedText: "最近更新",
contributorsText: '贡献者',
notFound: ['not exist'],// 自定义404 页面提示语,数组
backToHome: '返回首页', // 返回首页
repo: "https://github.com/mmdapl/JavaScriptCollection",
editLink: false,
// 默认为 "Edit this page"
// editLinkText: '帮助我们改善此页面!',
displayAllHeaders: true,// 默认值:false 显示所有页面的标题链接
search: true,
searchMaxSuggestions: 10,
}),
plugins: [
// 全文搜索 参考配置:https://github.com/vuepress/vuepress-next/blob/main/docs/.vuepress/config.ts
// ['@vuepress/docsearch',
// {
// apiKey: '<API_KEY>',
// indexName: '<INDEX_NAME>',
// locales: {
// '/': {
// placeholder: '搜索一下',
// translations: {
// button: {
// buttonText: '搜索一下',
// buttonAriaLabel: '搜索一下',
// },
// modal: {
// searchBox: {
// resetButtonTitle: '清除查询条件',
// resetButtonAriaLabel: '清除查询条件',
// cancelButtonText: '取消',
// cancelButtonAriaLabel: '取消'
// },
// startScreen: {
// recentSearchesTitle: '搜索历史',
// noRecentSearchesText: '没有搜索历史',
// saveRecentSearchButtonTitle: '保存至搜索历史',
// removeRecentSearchButtonTitle: '从搜索历史中移除',
// favoriteSearchesTitle: '收藏',
// removeFavoriteSearchButtonTitle: '从收藏中移除',
// },
// errorScreen: {
// titleText: '无法获取结果',
// helpText: '你可能需要检查你的网络连接',
// },
// footer: {
// selectText: '查询',
// selectKeyAriaLabel: 'Enter key',
// navigateText: '切换',
// navigateUpKeyAriaLabel: 'Arrow up',
// navigateDownKeyAriaLabel: 'Arrow down',
// closeText: '关闭',
// closeKeyAriaLabel: 'Escape key',
// searchByText: '技术支持',
// },
// noResultsScreen: {
// noResultsText: '无法找到相关结果',
// suggestedQueryText: '你可以尝试查询',
// openIssueText: '你认为该查询应该有结果?',
// openIssueLinkText: '点击反馈',
// },
// },
// }
// }
// }
// }],
// other plugins
// [
// // 本地全文搜索
// '@vuepress/plugin-search',
// {
// locales: {
// '/': {
// placeholder: '搜索',
// },
// '/zh/': {
// placeholder: '搜索',
// },
// },
// maxSuggestions: 10 // 显示最大搜索
// },
// ],
]
theme: themeConfig,
// 插件配置
plugins:pluginsConfig,
};
4 changes: 4 additions & 0 deletions docs/.vuepress/config/constant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export const FOOTER_HTML_INFO=`Copyrights ©2019-${new Date().getFullYear()}
<a href="https://github.com/mmdapl" target="_blank">Chu·Fan</a> All Rights Reserved Rong姐姐好可爱`

2 changes: 1 addition & 1 deletion docs/.vuepress/config/navbar/front-end.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
text: "前端【Web】",
text: "前端",
children: [
{
text: "HTML",
Expand Down
21 changes: 12 additions & 9 deletions docs/.vuepress/config/navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,24 @@ export default [
battleInterview,
readBooks,
{
text: "常用网站",
text:"其他",
children: [
{
text: "平台汇总",
text: "常用网站",
link: "/sum-links",
},
{
text: "技术文档",
children: [
{
text: "百度",
link: "http://www.baidu.com",
},
],
link:'/test'
},
{
text: "todo计划",
link: "/sum-links",
},
{
text: "变更记录",
link: "/sum-links",
},
],
},
}
];
4 changes: 2 additions & 2 deletions docs/.vuepress/config/navbar/microservice.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
text: '分布式微服务',
text: '微服务',
children: [
{
text: "RPC框架",
Expand Down Expand Up @@ -36,7 +36,7 @@ export default {
],
},
{
text: '服务网关Kong',
text: '网关Kong',
link: '/kong'
},
{
Expand Down
22 changes: 22 additions & 0 deletions docs/.vuepress/config/plugins.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {searchProPlugin} from "vuepress-plugin-search-pro";

/**
* 使用的插件配置
*/
export default [
searchProPlugin({
// 索引全部内容
indexContent: true,
// 为分类和标签添加索引
customFields: [
{
getter: (page) => page.frontmatter.category,
formatter: "分类:$content",
},
{
getter: (page) => page.frontmatter.tag,
formatter: "标签:$content",
},
],
}),
]
4 changes: 2 additions & 2 deletions docs/.vuepress/config/sidebar/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import readBooksContent from "./read-books-content";
import readBooksContentSidebar from "./read-books-content.sidebar";

export default {
"/read-books": readBooksContent
"/read-books": readBooksContentSidebar
}
90 changes: 90 additions & 0 deletions docs/.vuepress/config/theme.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import {hopeTheme} from "vuepress-theme-hope";
import navbar from "./navbar";
import sidebar from "./sidebar";
import {FOOTER_HTML_INFO} from "./constant";

/**
* 主题相关配置
* 参考主题:https://theme-hope.vuejs.press/zh/config/intro.html#%E9%85%8D%E7%BD%AE%E6%A6%82%E5%BF%B5
*/
export default hopeTheme({
darkmode:"toggle",
// 支持全屏
// fullscreen: true,
// 纯净模式
// pure: true,
hostname:'https://408.142vip.cn',
author:{
name:'Chu·Fan',
email:'fairy_408@2925.com',
url:'https://www.142vip.cn'
},
favicon:"/favicon.ico",
// logo: "/assets/408_logo.png",
navbar: navbar,
// 导航栏布局
navbarLayout:{
start: ["Brand"],
center: ["Links"],
end: ["Language","Search","Repo", "Outlook", ]
},
sidebar: sidebar,
// sidebar: "heading",

// 主题布局选项
docsRepo: "https://github.com/142vip/JavaScriptCollection.git",
repo: "https://github.com/142vip/JavaScriptCollection",
logoDark:"/assets/408_logo.png",

// 博客配置
blog:{
name:'测试',
avatar:'',
description:'',
intro:'',
roundAvatar:true,
timeline:"时间轴的顶部文字",
articleInfo:"",
medias:{
"BiliBili": "https://space.bilibili.com/350937042?spm_id_from=333.1007.0.0"
}
},
// 设置页脚
displayFooter:true,
footer:FOOTER_HTML_INFO,

// 主题色选择器
themeColor: {
blue: "#2196f3",
red: "#f26d6d",
green: "#3eaf7c",
orange: "#fb9b5f",
},

plugins: {
copyright:true,
// 开启博客功能
blog:true,
// 代码块
mdEnhance: {
codetabs: true,
},
copyCode: {
showInMobile:true
},
// 参考:https://theme-hope.vuejs.press/zh/guide/markdown/components.html
components: {
// 你想使用的组件
components: [
"AudioPlayer",
"Badge",
"BiliBili",
"CodePen",
"PDF",
"StackBlitz",
"VideoPlayer",
"YouTube",
],
},
},
})
7 changes: 7 additions & 0 deletions docs/.vuepress/styles/config.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// 参考:https://theme-hope.vuejs.press/zh/guide/interface/code-theme.htm

// 浅色主题
$code-light-them:"vs";

// 深色主题
$code-dark-theme:"atom-dark";

0 comments on commit c564f9f

Please sign in to comment.