Skip to content

Commit 70d0d67

Browse files
author
Alejandra Quetzalli
authored
ci: updating spec urls to match new Information Architecture in website (asyncapi#801)
1 parent 84576c8 commit 70d0d67

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.github/scripts/remove-toc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = (givenSpec) => {
99
const startingLine = "## Table of Contents\n";
1010
const endingLine = "<!-- /TOC -->\n";
1111

12-
const specFile = fs.readFileSync(`./website/pages/docs/specifications/${givenSpec}.md`);
12+
const specFile = fs.readFileSync(`./website/pages/docs/reference/specification/${givenSpec}.md`);
1313

1414
const startingIndex = specFile.indexOf(startingLine);
1515
const endingIndex = specFile.indexOf(endingLine);
@@ -21,5 +21,5 @@ module.exports = (givenSpec) => {
2121
const firstHalf = specFile.slice(0, startingIndex);
2222
const secondHalf = specFile.slice(endingIndex + endingLine.length);
2323
const specWithoutToc = `${firstHalf}${secondHalf}`;
24-
fs.writeFileSync(`./website/pages/docs/specifications/${givenSpec}.md`, specWithoutToc);
24+
fs.writeFileSync(`./website/pages/docs/reference/specification/${givenSpec}.md`, specWithoutToc);
2525
}

.github/workflows/new-spec-release.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ jobs:
3838
script: |
3939
const fs = require("fs");
4040
41-
const specFiles = fs.readdirSync("./website/pages/docs/specifications");
41+
const specFiles = fs.readdirSync("./website/pages/docs/reference/specification");
4242
4343
const nextRelease = `${{github.event.release.tag_name}}`;
4444
const prefixRelease = nextRelease.split("-")[0];
4545
4646
for (const filename of specFiles) {
4747
if (filename.startsWith(prefixRelease)) {
48-
fs.unlinkSync(`./website/pages/docs/specifications/${filename}`);
48+
fs.unlinkSync(`./website/pages/docs/reference/specification/${filename}`);
4949
}
5050
}
5151
- name: Copy Spec file from Current Repo to Another
5252
working-directory: ./website
5353
run: |
54-
cp ../spec/spec/asyncapi.md ./pages/docs/specifications/${{github.event.release.tag_name}}.md
54+
cp ../spec/spec/asyncapi.md ./pages/docs/reference/specification/${{github.event.release.tag_name}}.md
5555
- name: Remove Table of Contents from Spec
5656
uses: actions/github-script@v4
5757
with:
@@ -71,7 +71,7 @@ jobs:
7171
const endingLine = "# LATEST-SPEC-REDIRECTION:END";
7272
7373
const releaseVersion = `${{github.event.release.tag_name}}`;
74-
const redirectLine = `/docs/specifications/latest /docs/specifications/${releaseVersion} 302!\n`;
74+
const redirectLine = `/docs/reference/specification/latest /docs/reference/specification/${releaseVersion} 302!\n`;
7575
7676
const redirectFile = fs.readFileSync("./website/public/_redirects", "utf-8");
7777
@@ -139,7 +139,7 @@ jobs:
139139
140140
const releaseVersionWithoutV = releaseVersion.slice(1);
141141
142-
const redirectLine = `/docs/specifications/${releaseVersionWithoutV} /docs/specifications/${releaseVersion} 302!\n`;
142+
const redirectLine = `/docs/reference/specification/${releaseVersionWithoutV} /docs/reference/specification/${releaseVersion} 302!\n`;
143143
144144
const redirectFile = fs.readFileSync("./website/public/_redirects", "utf-8");
145145

.github/workflows/update-spec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Copy Spec file from Current Repo to Another
4242
working-directory: ./website
4343
run: |
44-
cp ../spec/spec/asyncapi.md ./pages/docs/specifications/${{ steps.latest_version.outputs.latest_tag }}.md
44+
cp ../spec/spec/asyncapi.md ./pages/docs/reference/specification/${{ steps.latest_version.outputs.latest_tag }}.md
4545
- name: Remove Table of Contents from Spec
4646
uses: actions/github-script@v4
4747
with:

0 commit comments

Comments
 (0)