Skip to content

Commit dbaeb91

Browse files
Add way to build the api docs site from a local repo
1 parent 97cf583 commit dbaeb91

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

getDependenciesDevelop.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
BLUE='\033[0;34m'
2+
NC='\033[0m' # No Color
3+
4+
echo
5+
echo "${BLUE}Fetching base theme${NC}"
6+
if
7+
cd linode-hugo-theme; then
8+
git pull origin development; else
9+
git clone https://github.com/linode/linode-hugo-theme.git;
10+
fi
11+
12+
echo
13+
echo "${BLUE}Fetching API specs${NC}"
14+
cd -
15+
yes | cp -rf ../linode-api-docs/openapi.yaml static/api/docs/v4/openapi.yaml
16+
17+
echo
18+
echo "${BLUE}Removing faulty data${NC}"
19+
sed -i.bak '/backgroundColor:/d' static/api/docs/v4/openapi.yaml
20+
rm static/api/docs/v4/openapi.yaml.bak
21+
22+
echo
23+
echo "${BLUE}Converting YAML to JSON${NC}"
24+
./node_modules/yamljs/bin/yaml2json static/api/docs/v4/openapi.yaml > static/api/docs/v4/spec.json

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
],
5151
"scripts": {
5252
"build": "./getDependencies.sh && gatsby build && node search/buildIndex.js",
53-
"develop": "./getDependencies.sh && gatsby develop",
53+
"develop": "./getDependenciesDevelop.sh && gatsby develop",
5454
"start": "npm run develop",
5555
"serve": "gatsby serve",
5656
"test": "echo \"Write tests! -> https://gatsby.app/unit-testing\""

0 commit comments

Comments
 (0)