This is an automated email from the ASF dual-hosted git repository.

nicknezis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/master by this push:
     new 8057559  Updated Docusaurus config to fix Javadocs CSS bug (#3546)
8057559 is described below

commit 80575594fa2dbb41973a12032f94373c8e3eaaa4
Author: Nicholas Nezis <[email protected]>
AuthorDate: Wed Jun 24 22:23:51 2020 -0400

    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
---
 .gitignore                             |  7 +------
 website2/.gitignore                    |  6 +++++-
 website2/website/Makefile              | 10 +++++++---
 website2/website/scripts/build-site.sh | 11 ++---------
 website2/website/scripts/javadocs.sh   | 16 +---------------
 website2/website/siteConfig.js         | 11 +++++++++++
 6 files changed, 27 insertions(+), 34 deletions(-)

diff --git a/.gitignore b/.gitignore
index d33c02d..bf19afe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -130,12 +130,7 @@ atlassian-ide-plugin.xml
 com_crashlytics_export_strings.xml
 
 # generated for the website
-website/node_modules/
-website/public/
-
-website2/website/public
-website2/website/static/api
-website2/website/venv/
+generated-site/
 
 # Visual Studio Code
 .vscode
diff --git a/website2/.gitignore b/website2/.gitignore
index 5395ea7..e3ff46e 100755
--- a/website2/.gitignore
+++ b/website2/.gitignore
@@ -1,12 +1,16 @@
 .DS_Store
 
-node_modules
+website/node_modules
 
 lib/core/metadata.js
 lib/core/MetadataBlog.js
 
+website/public/
+website/static/api/
+website/venv/
 website/translated_docs
 website/build/
 website/yarn.lock
 website/node_modules
 website/i18n/*
+website/scripts/bazelrc
diff --git a/website2/website/Makefile b/website2/website/Makefile
index 7c25991..38ddc95 100644
--- a/website2/website/Makefile
+++ b/website2/website/Makefile
@@ -1,3 +1,5 @@
+.PHONY : start javadocs python-docs buildsite publish clean
+
 start:
        yarn start
 
@@ -7,10 +9,12 @@ javadocs:
 python-docs:
        @scripts/python-doc-gen.sh 0.0.0
 
-buildsite:
-       @scripts/javadocs.sh
-       @scripts/python-doc-gen.sh 0.0.0
+buildsite: javadocs python-docs
        @scripts/build-site.sh
 
 publish:
        @scripts/publish_site.sh
+
+clean:
+       rm -rf static/api/*
+       rm -rf build/*
\ No newline at end of file
diff --git a/website2/website/scripts/build-site.sh 
b/website2/website/scripts/build-site.sh
index 2647259..3c43b28 100755
--- a/website2/website/scripts/build-site.sh
+++ b/website2/website/scripts/build-site.sh
@@ -28,14 +28,7 @@ npm run-script build
 
 node ./scripts/replace.js
 
-rm -rf ${ROOT_DIR}/generated-site/content
-mkdir -p ${ROOT_DIR}/generated-site/content/api/java
-mkdir -p ${ROOT_DIR}/generated-site/content/api/python
 ## copy generated site
+rm -rf ${ROOT_DIR}/generated-site/content/*
+mkdir -p ${ROOT_DIR}/generated-site/content/
 cp -R build/incubator-heron/* ${ROOT_DIR}/generated-site/content
-## copy java docs
-cp -R ${ROOT_DIR}/website2/website/public/api/java/* 
${ROOT_DIR}/generated-site/content/api/java/
-## copy pydocs
-cp -R ${ROOT_DIR}/website2/website/static/api/python/* 
${ROOT_DIR}/generated-site/content/api/python/
-## remove bazelrc for dockerfile
-rm ${ROOT_DIR}/website2/website/scripts/bazelrc
\ No newline at end of file
diff --git a/website2/website/scripts/javadocs.sh 
b/website2/website/scripts/javadocs.sh
index cbd9c41..8cd99f2 100755
--- a/website2/website/scripts/javadocs.sh
+++ b/website2/website/scripts/javadocs.sh
@@ -21,10 +21,7 @@ JAVADOC=javadoc
 FLAGS="-quiet -Xdoclint:none"
 
 HERON_ROOT_DIR=$(git rev-parse --show-toplevel)
-# for display on GitHub website
-JAVADOC_OUTPUT_DIR=$HERON_ROOT_DIR/website2/website/public/api/java
-# for display on local Hugo server
-JAVADOC_OUTPUT_LOCAL_DIR=$HERON_ROOT_DIR/website2/website/static/api
+JAVADOC_OUTPUT_DIR=$HERON_ROOT_DIR/website2/website/static/api/java
 GEN_PROTO_DIR=$HERON_ROOT_DIR/bazel-bin/heron/proto/_javac
 
 # The path of the customized landing page for the Javadocs
@@ -66,16 +63,5 @@ $JAVADOC $FLAGS \
   -overview $OVERVIEW_HTML_FILE \
   -d $JAVADOC_OUTPUT_DIR $GEN_FILES $HERON_SRC_FILES $BACKTYPE_SRC_FILES 
$APACHE_SRC_FILES || true
 
-# Generated Java API doc needs to be copied to $JAVADOC_OUTPUT_LOCAL_DIR
-# for the following two reasons:
-# 1. When one is developing website locally, They should
-#    be able to click into API doc link and view API doc to
-#    check if the correct API link is given.
-# 2. ``wget`` needs to verify if links to Java API doc are valid when we are
-#    serving the website locally. This means that Hugo should be able to 
display
-#    Java API doc properly.
-
-cp -r $JAVADOC_OUTPUT_DIR $JAVADOC_OUTPUT_LOCAL_DIR
 echo "Javadocs generated at $JAVADOC_OUTPUT_DIR"
-echo "Javadocs copied to: $JAVADOC_OUTPUT_LOCAL_DIR"
 exit 0
diff --git a/website2/website/siteConfig.js b/website2/website/siteConfig.js
index e8fa9c9..c5b9278 100644
--- a/website2/website/siteConfig.js
+++ b/website2/website/siteConfig.js
@@ -107,6 +107,17 @@ const siteConfig = {
     theme: 'default',
   },
 
+  // Ignores CSS files found in the static folder.
+  // Any CSS files not listed here will be added to the Docusaurus main.css
+  separateCss: [
+      `${baseUrl}static/css/custom.css`,
+      `${baseUrl}static/api/java/jquery/jquery-ui.css`,
+      `${baseUrl}static/api/java/jquery/jquery-ui.min.css`,
+      `${baseUrl}static/api/java/jquery/jquery-ui.structure.min.css`,
+      `${baseUrl}static/api/java/jquery/jquery-ui.structure.css`,
+      `${baseUrl}static/api/java/stylesheet.css`,
+  ],
+
   // Add custom scripts here that would be placed in <script> tags.
   scripts: [
     'https://buttons.github.io/buttons.js',

Reply via email to