Skip to content

Commit

Permalink
generate sitemap.xml when creating documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Nov 4, 2022
1 parent 08475dd commit c75bf2a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "jekyll-include-cache", group: :jekyll_plugins
gem 'jekyll-seo-tag', group: :jekyll_plugins
gem 'jekyll-seo-tag', group: :jekyll_plugins
gem 'jekyll-sitemap', group: :jekyll_plugins
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ quickstart_docs_uri: docs/quickstart.html
severity_docs_uri: docs/severity.html
thirdparty_logs_docs_uri: docs/third-party-logs.html
upload_docs_uri: docs/upload.html
url:
github:
owner_name: Idaho National Laboratory
default_branch: main
plugins:
- jekyll-relative-links
- jekyll-remote-theme
- jekyll-seo-tag
- jekyll-sitemap
show_downloads: true
relative_links:
enabled: true
Expand Down
10 changes: 8 additions & 2 deletions scripts/documentation_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ VERBOSE_FLAG=""
REVISION="${VCS_REVSION:-$( git rev-parse --short HEAD 2>/dev/null || true )}"
REPOSITORY_NAME=""
OWNER_NAME=""
SITEMAP_URL=""
DEFAULT_BRANCH=""
TOKEN="${GITHUB_TOKEN:-}"
LOG_BASE_DIR=$(pwd)
while getopts 'vr:t:n:o:b:' OPTION; do
while getopts 'vr:t:n:o:b:s:' OPTION; do
case "$OPTION" in
v)
set -x
Expand All @@ -47,12 +48,16 @@ while getopts 'vr:t:n:o:b:' OPTION; do
DEFAULT_BRANCH="$OPTARG"
;;

s)
SITEMAP_URL="$OPTARG"
;;

t)
TOKEN="$OPTARG"
;;

?)
echo "script usage: $(basename $0) [-v (verbose)] [-r revision] [-n repository-name] [-o owner-name] [-b default-branch] [-t github-token]" >&2
echo "script usage: $(basename $0) [-v (verbose)] [-r revision] [-n repository-name] [-o owner-name] [-b default-branch] [-t github-token] [-s sitemap-url]" >&2
exit 1
;;
esac
Expand Down Expand Up @@ -124,6 +129,7 @@ fi
[[ -n "$REPOSITORY_NAME" ]] && "$YQ" eval --inplace ".\"repository\"=\"$REPOSITORY_NAME\"" ./_config.yml
[[ -n "$OWNER_NAME" ]] && "$YQ" eval --inplace ".\"github\".\"owner_name\"=\"$OWNER_NAME\"" ./_config.yml
[[ -n "$DEFAULT_BRANCH" ]] && "$YQ" eval --inplace ".\"github\".\"default_branch\"=\"$DEFAULT_BRANCH\"" ./_config.yml
[[ -n "$SITEMAP_URL" ]] && "$YQ" eval --inplace ".\"url\"=\"$SITEMAP_URL\"" ./_config.yml

# pass GitHub API token through to Jekyll if it's available
if [[ -n "${TOKEN:-}" ]]; then
Expand Down

0 comments on commit c75bf2a

Please sign in to comment.