Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit 8057559

Browse files
authored
Updated Docusaurus config to fix Javadocs CSS bug (#3546)
* Updated Docusaurus config to ignore Javadocs CSS * Refactored and updated gitignore rules * Website build script cleanup
1 parent 9377b10 commit 8057559

File tree

6 files changed

+27
-34
lines changed

6 files changed

+27
-34
lines changed

.gitignore

+1-6
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,7 @@ atlassian-ide-plugin.xml
130130
com_crashlytics_export_strings.xml
131131

132132
# generated for the website
133-
website/node_modules/
134-
website/public/
135-
136-
website2/website/public
137-
website2/website/static/api
138-
website2/website/venv/
133+
generated-site/
139134

140135
# Visual Studio Code
141136
.vscode

website2/.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
.DS_Store
22

3-
node_modules
3+
website/node_modules
44

55
lib/core/metadata.js
66
lib/core/MetadataBlog.js
77

8+
website/public/
9+
website/static/api/
10+
website/venv/
811
website/translated_docs
912
website/build/
1013
website/yarn.lock
1114
website/node_modules
1215
website/i18n/*
16+
website/scripts/bazelrc

website2/website/Makefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.PHONY : start javadocs python-docs buildsite publish clean
2+
13
start:
24
yarn start
35

@@ -7,10 +9,12 @@ javadocs:
79
python-docs:
810
@scripts/python-doc-gen.sh 0.0.0
911

10-
buildsite:
11-
@scripts/javadocs.sh
12-
@scripts/python-doc-gen.sh 0.0.0
12+
buildsite: javadocs python-docs
1313
@scripts/build-site.sh
1414

1515
publish:
1616
@scripts/publish_site.sh
17+
18+
clean:
19+
rm -rf static/api/*
20+
rm -rf build/*

website2/website/scripts/build-site.sh

+2-9
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,7 @@ npm run-script build
2828

2929
node ./scripts/replace.js
3030

31-
rm -rf ${ROOT_DIR}/generated-site/content
32-
mkdir -p ${ROOT_DIR}/generated-site/content/api/java
33-
mkdir -p ${ROOT_DIR}/generated-site/content/api/python
3431
## copy generated site
32+
rm -rf ${ROOT_DIR}/generated-site/content/*
33+
mkdir -p ${ROOT_DIR}/generated-site/content/
3534
cp -R build/incubator-heron/* ${ROOT_DIR}/generated-site/content
36-
## copy java docs
37-
cp -R ${ROOT_DIR}/website2/website/public/api/java/* ${ROOT_DIR}/generated-site/content/api/java/
38-
## copy pydocs
39-
cp -R ${ROOT_DIR}/website2/website/static/api/python/* ${ROOT_DIR}/generated-site/content/api/python/
40-
## remove bazelrc for dockerfile
41-
rm ${ROOT_DIR}/website2/website/scripts/bazelrc

website2/website/scripts/javadocs.sh

+1-15
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ JAVADOC=javadoc
2121
FLAGS="-quiet -Xdoclint:none"
2222

2323
HERON_ROOT_DIR=$(git rev-parse --show-toplevel)
24-
# for display on GitHub website
25-
JAVADOC_OUTPUT_DIR=$HERON_ROOT_DIR/website2/website/public/api/java
26-
# for display on local Hugo server
27-
JAVADOC_OUTPUT_LOCAL_DIR=$HERON_ROOT_DIR/website2/website/static/api
24+
JAVADOC_OUTPUT_DIR=$HERON_ROOT_DIR/website2/website/static/api/java
2825
GEN_PROTO_DIR=$HERON_ROOT_DIR/bazel-bin/heron/proto/_javac
2926

3027
# The path of the customized landing page for the Javadocs
@@ -66,16 +63,5 @@ $JAVADOC $FLAGS \
6663
-overview $OVERVIEW_HTML_FILE \
6764
-d $JAVADOC_OUTPUT_DIR $GEN_FILES $HERON_SRC_FILES $BACKTYPE_SRC_FILES $APACHE_SRC_FILES || true
6865

69-
# Generated Java API doc needs to be copied to $JAVADOC_OUTPUT_LOCAL_DIR
70-
# for the following two reasons:
71-
# 1. When one is developing website locally, They should
72-
# be able to click into API doc link and view API doc to
73-
# check if the correct API link is given.
74-
# 2. ``wget`` needs to verify if links to Java API doc are valid when we are
75-
# serving the website locally. This means that Hugo should be able to display
76-
# Java API doc properly.
77-
78-
cp -r $JAVADOC_OUTPUT_DIR $JAVADOC_OUTPUT_LOCAL_DIR
7966
echo "Javadocs generated at $JAVADOC_OUTPUT_DIR"
80-
echo "Javadocs copied to: $JAVADOC_OUTPUT_LOCAL_DIR"
8167
exit 0

website2/website/siteConfig.js

+11
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ const siteConfig = {
107107
theme: 'default',
108108
},
109109

110+
// Ignores CSS files found in the static folder.
111+
// Any CSS files not listed here will be added to the Docusaurus main.css
112+
separateCss: [
113+
`${baseUrl}static/css/custom.css`,
114+
`${baseUrl}static/api/java/jquery/jquery-ui.css`,
115+
`${baseUrl}static/api/java/jquery/jquery-ui.min.css`,
116+
`${baseUrl}static/api/java/jquery/jquery-ui.structure.min.css`,
117+
`${baseUrl}static/api/java/jquery/jquery-ui.structure.css`,
118+
`${baseUrl}static/api/java/stylesheet.css`,
119+
],
120+
110121
// Add custom scripts here that would be placed in <script> tags.
111122
scripts: [
112123
'https://buttons.github.io/buttons.js',

0 commit comments

Comments
 (0)