Skip to content

Commit

Permalink
feat: content 구조 변경에 따른 설정 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jmkim0 committed Jan 13, 2024
1 parent 15d0e92 commit 6563cf2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const config: Config = {
'classic',
{
docs: {
path: 'content/10 Wiki',
path: 'content/01 Wiki',
routeBasePath: 'wiki',
sidebarPath: require.resolve('./sidebars.ts'),
showLastUpdateTime: true,
Expand All @@ -29,7 +29,7 @@ const config: Config = {
const items = await defaultSidebarItemsGenerator(args);

function stripNumberPrefix(item) {
const regex = /^(?:\d{2}|\d{2}\.\d{2,3}) (.+)/;
const regex = /^\d{2} (.+)/;
if (item.type === 'doc') {
const match = regex.exec(item.label);
return {...item, label: match ? match[1] : item.label};
Expand All @@ -48,7 +48,7 @@ const config: Config = {
},
},
blog: {
path: 'content/20 Posts',
path: 'content/02 Posts',
blogTitle: 'Posts',
blogDescription: 'Posts',
blogSidebarCount: 'ALL',
Expand Down Expand Up @@ -140,10 +140,10 @@ const config: Config = {
mermaid: true,
async parseFrontMatter(params) {
const result = await params.defaultParseFrontMatter(params);
const path = /(?:10 Wiki|20 Posts\/2\d)(.*).md/.exec(params.filePath)[1];
const path = /(?:01 Wiki|02 Posts)(.*).md/.exec(params.filePath)[1];

result.frontMatter.slug = path
.replaceAll(/(?:\d{2}|\d{2}\.\d{2,3}) /g, '')
.replaceAll(/\d{2} /g, '')
.replaceAll(' ', '+');

return result;
Expand Down

0 comments on commit 6563cf2

Please sign in to comment.