Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@

# Mac OS X
.DS_Store

# Backups from sed
*.bak
8 changes: 8 additions & 0 deletions site/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,12 @@ popd
# copy other static resource files
echo '{}' > "$WWW_ROOT_DIR/uctest.json"
wget -q --convert-links -O "$WWW_ROOT_DIR/index.html" --convert-links https://www.jenkins.io/templates/updates/index.html
# replace relative paths in URLs and footer by absolute ones, and set the proper attributes for jio-components
sed -i.bak '' \
-e 's|href="/|href="https://www.jenkins.io/|g' \
-e 's|src="/|src="https://www.jenkins.io/|g' \
-e 's|property="https://www.jenkins.io"|property="https://updates.jenkins.io"|g' \
-e 's|sourcepath=""|sourcepath="content/templates/updates.adoc"|' \
"$WWW_ROOT_DIR/index.html"

cp -av "tmp/tiers.json" "$WWW_ROOT_DIR/tiers.json"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ protected String initTemplate() {

doc.getElementsByAttribute("href").forEach(element -> setAbsoluteUrl(element, "href"));
doc.getElementsByAttribute("src").forEach(element -> setAbsoluteUrl(element, "src"));
doc.select("[property=https://www.jenkins.io]").forEach(element -> element.attr("property", "https://updates.jenkins.io"));
doc.select("[sourcepath=\"\"]").forEach(element -> element.attr("sourcepath", "content/templates/updates.adoc"));

globalTemplate = doc.toString();
} catch (IOException ioe) {
LOGGER.log(Level.SEVERE, "Problem loading template", ioe);
Expand Down