Skip to content

Commit

Permalink
Remove webhook badge and revert mustache template
Browse files Browse the repository at this point in the history
  • Loading branch information
sserrata committed Dec 20, 2022
1 parent 3aa70d3 commit b018794
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
4 changes: 2 additions & 2 deletions demo/api.mustache
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
id: {{{id}}}
title: "{{{frontMatter.title}}}"
title: "{{{title}}}"
description: "{{{frontMatter.description}}}"
{{^api}}
sidebar_label: Introduction
{{/api}}
{{#api}}
sidebar_label: "{{{frontMatter.title}}}"
sidebar_label: "{{{title}}}"
{{/api}}
{{^api}}
sidebar_position: 0
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-plugin-openapi-docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ export default function pluginOpenAPIDocs(
? fs.readFileSync(template).toString()
: `---
id: {{{id}}}
title: "{{{frontMatter.title}}}"
title: "{{{title}}}"
description: "{{{frontMatter.description}}}"
{{^api}}
sidebar_label: Introduction
{{/api}}
{{#api}}
sidebar_label: "{{{frontMatter.title}}}"
sidebar_label: "{{{title}}}"
{{/api}}
{{^api}}
sidebar_position: 0
Expand Down
13 changes: 1 addition & 12 deletions packages/docusaurus-plugin-openapi-docs/src/openapi/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,6 @@ function createItems(
.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
.replace(/\s+$/, "")
: "",
title: title ? title.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'") : "",
sidebar_label: title
? title.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
: "",
...(options?.proxy && { proxy: options.proxy }),
},
api: {
Expand Down Expand Up @@ -328,10 +324,7 @@ function createItems(
id: baseId,
infoId: infoId ?? "",
unversionedId: baseId,
title: title
? title.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'") +
` <span class="badge badge--secondary webhook-badge">webhook</span>`
: "",
title: title ? title.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'") : "",
description: operationObject.description
? operationObject.description.replace(
/((?:^|[^\\])(?:\\{2})*)"/g,
Expand All @@ -344,10 +337,6 @@ function createItems(
.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
.replace(/\s+$/, "")
: "",
title: title ? title.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'") : "",
sidebar_label: title
? title.replace(/((?:^|[^\\])(?:\\{2})*)"/g, "$1'")
: "",
...(options?.proxy && { proxy: options.proxy }),
},
api: {
Expand Down

0 comments on commit b018794

Please sign in to comment.