Skip to content

Commit

Permalink
Merge pull request #3805 from OpenLiberty/staging
Browse files Browse the repository at this point in the history
Update Prod
  • Loading branch information
SteveSamJacob19 authored Jul 16, 2024
2 parents ffb8c3f + 272d94c commit b5caf31
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 34 deletions.
7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

8 changes: 3 additions & 5 deletions scripts/build/clone_guides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,14 @@ def directory_exists?(repo_name)
# Clone static & interactive guides that are ready to be published to openliberty.io
if repo_name.start_with?('iguide') || repo_name.start_with?('guide')
# Clone the guides, using the dev branch for travis and prod for all other environments.
`git clone https://github.com/OpenLiberty/#{repo_name}.git -b #{guide_branch} src/main/content/guides/#{repo_name}`

system("git","clone","https://github.com/OpenLiberty/#{repo_name}.git","-b","#{guide_branch}","src/main/content/guides/#{repo_name}")
# # Clone the fallback branch if the guide_branch does not exist for this guide repo.
if !(directory_exists?(repo_name))
`git clone https://github.com/OpenLiberty/#{repo_name}.git -b #{fallback_guide_branch} src/main/content/guides/#{repo_name}`
system("git","clone","https://github.com/OpenLiberty/#{repo_name}.git","-b","#{fallback_guide_branch}","src/main/content/guides/#{repo_name}")
end

# Clone the default branch if the fallback_guide_branch does not exist for this guide repo.
if !(directory_exists?(repo_name))
`git clone https://github.com/OpenLiberty/#{repo_name}.git src/main/content/guides/#{repo_name}`
system("git","clone","https://github.com/OpenLiberty/#{repo_name}.git","src/main/content/guides/#{repo_name}")
end
end
if ENV['DRAFT_SITE'] || ENV['GUIDES_DRAFT_SITE']
Expand Down
35 changes: 19 additions & 16 deletions scripts/build/parse_features_toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,22 +297,25 @@ def sort_versions_for(feature, high_to_low=True):
print("Modifying the docs TOCs of version " + version + " to remove the duplicate feature versions.")
feature_version_path = featurePath + version
for root, dirs, files in os.walk(feature_version_path):
for basename in files:
if fnmatch.fnmatch(basename, "*.html"):
if(basename != "index.html"):
href = path.join(root, basename)
page = BeautifulSoup(open(href), "lxml")

# Find the toc and replace it with the modified toc
page_toc = page.find_all('ul', {'class': 'nav-list'})[0]
if page_toc.find('span', text='Features') is not None:
toc_to_replace = page_toc.find('span', text='Features').parent
elif page_toc.find('a', text='Features') is not None:
toc_to_replace = page_toc.find('a', text='Features').parent
toc_to_replace.clear()
toc_to_replace.append(featureTOC)
with open(href, "w") as file:
file.write(str(page))
if "../" not in root:
for basename in files:
if fnmatch.fnmatch(basename, "*.html"):
if(basename != "index.html"):
href = path.join(root, basename)
page = BeautifulSoup(open(href), "lxml")

# Find the toc and replace it with the modified toc
page_toc = page.find_all('ul', {'class': 'nav-list'})[0]
if page_toc.find('span', text='Features') is not None:
toc_to_replace = page_toc.find('span', text='Features').parent
elif page_toc.find('a', text='Features') is not None:
toc_to_replace = page_toc.find('a', text='Features').parent
toc_to_replace.clear()
toc_to_replace.append(featureTOC)
with open(href, "w") as file:
file.write(str(page))
else:
print("Invalid path for root")

timerEnd = time.time()
print('Total execution time for parsing ToC Features: ', timerEnd - timerStart)
7 changes: 3 additions & 4 deletions src/main/content/_assets/js/antora-redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $(document).ready(function () {
if (hash.indexOf("#") === 0) {
hash = hash.substring(1); // Remove hash
}
window.location.replace(window.location.origin + "/docs/latest/" + hash);
window.location.href= window.location.origin + "/docs/latest/" + hash;
} else if (
path.indexOf("/docs/ref/feature/") > -1 ||
path.indexOf("/docs/ref/config/") > -1 ||
Expand Down Expand Up @@ -48,13 +48,12 @@ $(document).ready(function () {
break;
}
}
window.location.replace(
window.location.href =
window.location.origin +
"/docs/latest/reference/" +
resource_type +
"/" +
page +
hash
);
hash;
}
});
4 changes: 2 additions & 2 deletions src/main/content/_assets/js/guides.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,11 @@ $(document).ready(function () {
var total = $(this).find(".guide_column").length;
// update num_guides
if (showTotal) {
$("#" + $(this).attr("id").replace("_category", "_num_guides")).html(
$("#" + $(this).attr("id").replace("_category", "_num_guides")).text(
"(" + count + "/" + total + " guides)"
);
} else {
$("#" + $(this).attr("id").replace("_category", "_num_guides")).html(
$("#" + $(this).attr("id").replace("_category", "_num_guides")).text(
"(" + count + " guides)"
);
}
Expand Down

0 comments on commit b5caf31

Please sign in to comment.