You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/04/02 11:55:10 UTC

[GitHub] [cassandra-website] michaelsembwever commented on a change in pull request #121: move and prepare files for content folder

michaelsembwever commented on a change in pull request #121:
URL: https://github.com/apache/cassandra-website/pull/121#discussion_r841067847



##########
File path: site-content/docker-entrypoint.sh
##########
@@ -196,14 +196,87 @@ generate_site_yaml() {
 
 render_site_content_to_html() {
   pushd "${CASSANDRA_WEBSITE_DIR}/site-content" > /dev/null
-  echo "Building the site HTML content."
+  log_message "INFO" "Building the site HTML content."
   antora --generator antora-site-generator-lunr site.yaml
-  echo "Rendering complete!"
+  log_message "INFO" "Rendering complete!"
   popd > /dev/null
 }
 
+
+prepare_site_html_for_publication() {
+  pushd "${CASSANDRA_WEBSITE_DIR}" > /dev/null
+
+  # copy everything to content/ directory
+  log_message "INFO" "Moving site HTML to content/"
+  mkdir -p content/doc
+  cp -r site-content/build/html/* content/
+
+  # remove hardcoded domain name, and empty domain names first before we duplicate and documentation
+  content_files_to_change=($(grep -rl 'https://cassandra.apache.org/' content/))
+  log_message "INFO" "Removing hardcoded domain names in ${#content_files_to_change[*]} files"
+  for content_file in ${content_files_to_change[*]}
+  do
+    log_message "DEBUG" "Processing file ${content_file}"
+    # sed automatically uses the character following the 's' as a delimiter.
+    # In this case we will use the ',' so we can avoid the need to escape the '/' characters
+    sed -i 's,https://cassandra.apache.org/,/,g' ${content_file}
+  done
+
+  content_files_to_change=($(grep -rl 'href="//' content/))
+  log_message "INFO" "Removing empty domain names in ${#content_files_to_change[*]} files"
+  for content_file in ${content_files_to_change[*]}
+  do
+    log_message "DEBUG" "Processing file ${content_file}"
+    sed -i 's,href="//,href="/,g' ${content_file}
+  done
+
+  # move around the in-tree docs if generated
+  if [ "${COMMAND_GENERATE_DOCS}" = "run" ]
+  then
+    log_message "INFO" "Moving versioned documentation HTML to content/doc"
+    move_intree_document_directories "3.11" "3.11.11" "3.11.12"
+    move_intree_document_directories "4.0" "4.0.0" "4.0.1" "4.0.2" "4.0.3" "stable"
+    move_intree_document_directories "trunk" "4.1" "latest"

Review comment:
       we're going to need to know how to deal with tagsā€¦ 
   i.e. everytime we cut a new patch release, we can be having to come here and edit these lines. (identifying all release tags needs to be automatic.)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org