Skip to content

Commit

Permalink
算法
Browse files Browse the repository at this point in the history
  • Loading branch information
elarbor committed Jun 17, 2024
1 parent adef464 commit dd9aeec
Show file tree
Hide file tree
Showing 23 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions config/exclude-sidebars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"api-examples"
]
Binary file modified docs/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/.vitepress/cache/auto-nav-cache.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig } from 'vitepress'
import excludeSidebars from "../../config/exclude-sidebars.json"
import path from "path"
import fs from "fs"

Expand All @@ -10,7 +11,7 @@ import fs from "fs"
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "前端题库",
description: "最全面的前端面试题库",
// description: "集思广益,共同完善的大题库",
base: "/questions/",
markdown: {
lineNumbers: true // 默认显示行号
Expand Down Expand Up @@ -38,7 +39,7 @@ export default defineConfig({
pattern: 'https://github.com/chergn/questions/edit/main/docs/:path'
},
footer: {
message: '欢迎投稿,共同完善题库',
message: '立志成为最全面的前端面试题库',
// copyright: 'Copyright © cherry'
}
},
Expand All @@ -49,13 +50,18 @@ export default defineConfig({
function getSideBars() {
var sidebars = [];
const docsPath = path.dirname(__dirname); // docs 目录路径
// 给需要排除的文件名增加后缀名
for (let index in excludeSidebars) {
excludeSidebars[index] += ".md";
}

(function getSideBar(docsPath, link = "") {
let sidebar = [];
const files = fs.readdirSync(docsPath);
// console.log("一维:", files);
files.forEach((filename, index) => {
if (filename.startsWith(".") || !filename) return;
if (excludeSidebars.includes(filename)) return;

const filepath = path.join(docsPath, filename);
const stat = fs.statSync(filepath);
Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ layout: home

hero:
name: "前端题库"
text: "最全面的前端面试题库"
# text: "集思广益,共同完善的大题库"
tagline: 苟有恒,何必三更眠五更起;最无益,莫过一日曝十日寒
actions:
- theme: brand
text: Markdown Examples
text: 开始学习
link: /markdown-examples
- theme: alt
text: API Examples
link: /api-examples
text: 我要投稿
link: https://github.com/chergn/questions/discussions/new?category=ideas

features:
- title: Feature A
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit dd9aeec

Please sign in to comment.