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

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

ossarga commented on code in PR #121:
URL: https://github.com/apache/cassandra-website/pull/121#discussion_r841307662


##########
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:
   Agreed. I have been thinking about this for some time. It will be addressed in [CASSANDRA-17517](https://issues.apache.org/jira/browse/CASSANDRA-17517).



-- 
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: dev-unsubscribe@cassandra.apache.org

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


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

Posted by "benedict@apache.org" <be...@apache.org>.
I just did the same for cassandra-accord, I guess some config was lost in the upgrade

https://issues.apache.org/jira/projects/INFRA/issues/INFRA-23074


From: Mick Semb Wever <mc...@apache.org>
Date: Monday, 4 April 2022 at 08:55
To: dev@cassandra.apache.org <de...@cassandra.apache.org>
Subject: Re: [GitHub] [cassandra-website] ossarga commented on a diff in pull request #121: move and prepare files for content folder

these notifications should be going to pr@

have created https://issues.apache.org/jira/browse/INFRA-23073

On Mon, 4 Apr 2022 at 03:09, GitBox <gi...@apache.org>> wrote:

ossarga commented on code in PR #121:
URL: https://github.com/apache/cassandra-website/pull/121#discussion_r841307662


##########
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:
   Agreed. I have been thinking about this for some time. It will be addressed in [CASSANDRA-17517](https://issues.apache.org/jira/browse/CASSANDRA-17517).



--
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: dev-unsubscribe@cassandra.apache.org<ma...@cassandra.apache.org>

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

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

Posted by Mick Semb Wever <mc...@apache.org>.
these notifications should be going to pr@

have created https://issues.apache.org/jira/browse/INFRA-23073

On Mon, 4 Apr 2022 at 03:09, GitBox <gi...@apache.org> wrote:

>
> ossarga commented on code in PR #121:
> URL:
> https://github.com/apache/cassandra-website/pull/121#discussion_r841307662
>
>
> ##########
> 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:
>    Agreed. I have been thinking about this for some time. It will be
> addressed in [CASSANDRA-17517](
> https://issues.apache.org/jira/browse/CASSANDRA-17517).
>
>
>
> --
> 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: dev-unsubscribe@cassandra.apache.org
>
> For queries about this service, please contact Infrastructure at:
> users@infra.apache.org
>
>