Skip to content

Commit 50bd5da

Browse files
Move contributing pages from docs to pages (typescript-cheatsheets#565)
1 parent 535ef36 commit 50bd5da

File tree

3 files changed

+11
-43
lines changed

3 files changed

+11
-43
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ website/.docusaurus
126126
website/.cache-loader
127127

128128
# copy of contributors for the website
129-
docs/contributors.md
130-
docs/contributing.md
129+
website/src/pages/contributing.md
130+
website/src/pages/contributors.md
131131

132132
# Local Netlify folder
133133
.netlify

copyFile.js

+4-29
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,14 @@ const fs = require("fs");
22
const filesTopCopy = [
33
{
44
src: "../CONTRIBUTORS.md",
5-
dest: "../docs/contributors.md",
6-
hideHeader: true,
5+
dest: "src/pages/contributors.md",
76
},
87
{
98
src: "../CONTRIBUTING.md",
10-
dest: "../docs/contributing.md",
11-
hideHeader: true,
9+
dest: "src/pages/contributing.md",
1210
},
1311
];
1412

15-
const generatingPageOptions = `---
16-
hide_title: true
17-
---
18-
19-
`;
20-
21-
function writeNewFile(src, dest) {
22-
const fileContent = fs.readFileSync(src).toString();
23-
const data = new Uint8Array(Buffer.from(generatingPageOptions + fileContent));
24-
25-
fs.writeFile(dest, data, (err) => {
26-
if (err) {
27-
console.log("Error Found:", err);
28-
} else {
29-
console.log("Files added");
30-
}
31-
});
32-
}
33-
3413
function copyFile(src, dest) {
3514
fs.copyFile(src, dest, (err) => {
3615
if (err) {
@@ -41,10 +20,6 @@ function copyFile(src, dest) {
4120
});
4221
}
4322

44-
filesTopCopy.forEach(({ src, dest, hideHeader }) => {
45-
if (hideHeader) {
46-
writeNewFile(src, dest);
47-
} else {
48-
copyFile(src, dest);
49-
}
23+
filesTopCopy.forEach(({ src, dest }) => {
24+
copyFile(src, dest);
5025
});

website/docusaurus.config.js

+5-12
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ const users = [
99
];
1010

1111
const setupDoc = "docs/basic/setup";
12-
const contributorsDoc = "docs/contributors";
13-
const contributingDoc = "docs/contributing";
1412

1513
module.exports = {
1614
favicon: "img/icon.png",
@@ -79,11 +77,6 @@ module.exports = {
7977
label: "Discord",
8078
position: "right",
8179
},
82-
{
83-
to: contributorsDoc,
84-
label: "Contributors",
85-
position: "right",
86-
},
8780
// {to: 'blog', label: 'Blog', position: 'right'},
8881
],
8982
},
@@ -117,10 +110,6 @@ module.exports = {
117110
label: "Migrating",
118111
to: "docs/migration",
119112
},
120-
{
121-
label: "Contributing",
122-
to: contributingDoc,
123-
},
124113
],
125114
},
126115
{
@@ -140,7 +129,11 @@ module.exports = {
140129
},
141130
{
142131
label: "Contributors",
143-
to: contributorsDoc,
132+
to: "contributors",
133+
},
134+
{
135+
label: "Contributing",
136+
to: "contributing",
144137
},
145138
],
146139
},

0 commit comments

Comments
 (0)