-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add-vuepress-action-with-root-directory-as-docs-directo…
…ry' of github.com:Ocelot-Social-Community/Ocelot-Social into 6866-remove-temp-(x.)ocelot.social-links # Conflicts: # README.md
- Loading branch information
Showing
26 changed files
with
20,001 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineUserConfig } from 'vuepress' | ||
import meta from './config/meta' | ||
import theme from './config/theme' | ||
import plugins from './config/plugins' | ||
|
||
export default defineUserConfig({ | ||
pagePatterns: ['**/*.md', '!.vuepress', '!node_modules', '!backend/node_modules', '!webapp/node_modules', '!deployment/src/old'], | ||
...meta, | ||
theme, | ||
plugins, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default { | ||
base: '/', | ||
title: 'Ocelot.Social Documentation', | ||
description: 'Ocelot.Social Documentation', | ||
head: [ | ||
['meta', {name: 'viewport', content: 'width=device-width,initial-scale=1'}], | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { searchProPlugin } from 'vuepress-plugin-search-pro' | ||
|
||
export default [ | ||
searchProPlugin({ | ||
indexContent: true, | ||
autoSuggestions: true, | ||
customFields: [ | ||
{ | ||
getter: (page) => page.frontmatter.category, | ||
formatter: "Category: $content", | ||
}, | ||
{ | ||
getter: (page) => page.frontmatter.tag, | ||
formatter: "Tag: $content", | ||
}, | ||
], | ||
}) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import path from 'path' | ||
import fs from 'fs' | ||
import { hopeTheme } from 'vuepress-theme-hope' | ||
|
||
export default hopeTheme({ | ||
favicon: 'favicon.ico', | ||
logo: '/logo.svg', | ||
docsRepo: 'https://github.com/Ocelot-Social-Community/Ocelot-Social', | ||
docsBranch: 'master', | ||
docsDir: '.', | ||
editLink: true, | ||
lastUpdated: false, | ||
contributors: false, | ||
print: false, | ||
pure: true, | ||
displayFooter: true, | ||
footer: 'CC BY busFaktor() e.V. & Authors', | ||
sidebar: generateSidebar('../../SUMMARY.md'), | ||
navbar: [ | ||
{ text: 'Home', link: '/' }, | ||
{ | ||
text: 'Github', | ||
link: 'https://github.com/Ocelot-Social-Community/Ocelot-Social' | ||
}, | ||
], | ||
plugins: { | ||
mdEnhance: { | ||
tabs: true, | ||
imgSize: true | ||
} | ||
} | ||
}) | ||
|
||
function generateSidebar(summaryFileName) { | ||
const summaryFile = path.resolve(__dirname, summaryFileName) | ||
|
||
try { | ||
return getSummaryData(summaryFile) | ||
} catch (err) { | ||
console.error(`Error generating sidebar from file ${summaryFileName}:`, err) | ||
process.exit(1) | ||
} | ||
} | ||
|
||
function getSummaryData(file) { | ||
const lines = fs.readFileSync(file, 'utf8').split('\n') | ||
const sidebarStructure = [] | ||
let currentParent = null | ||
|
||
lines.forEach((line, i) => { | ||
const level = line.search(/\S|$/) / 2 | ||
const match = line.match(/^\s*\*\s*\[([^\]]+)\]\(([^)]+)\)/) | ||
|
||
if (match) { | ||
const newEntry = { text: match[1], link: `/${match[2]}`, children: [] } | ||
if (level === 0) { | ||
sidebarStructure.push(newEntry) | ||
currentParent = sidebarStructure[sidebarStructure.length - 1] | ||
} else { | ||
let parent = currentParent | ||
|
||
for (let i = 1; i < level; i++) { | ||
parent = parent.children[parent.children.length - 1] | ||
} | ||
|
||
parent.children.push(newEntry) | ||
} | ||
} | ||
}) | ||
|
||
sidebarStructure.forEach(removeEmptyArrays) | ||
return sidebarStructure | ||
} | ||
|
||
function removeEmptyArrays(item) { | ||
if (item.children && item.children.length === 0) { | ||
delete item.children; | ||
} else if (item.children) { | ||
item.children.forEach(removeEmptyArrays); | ||
} | ||
} | ||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.