Skip to content

Commit

Permalink
Fixes #13126: Generate redirection info to latest stable doc
Browse files Browse the repository at this point in the history
  • Loading branch information
amousset committed Aug 1, 2018
1 parent cecba07 commit e85833b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
18 changes: 15 additions & 3 deletions Makefile
Expand Up @@ -6,11 +6,11 @@ GENERIC_DOCS = site site-dev site-local

SITES = $(GENERIC_DOCS) $(VERSION_DOCS)

.PHONY: prepare rudder-theme/build/ui-bundle.zip optipng doc-build $(SITES)
.PHONY: prepare rudder-theme/build/ui-bundle.zip optipng doc-build build/sites/redirect-current.conf build/files $(SITES)
.DEFAULT_GOAL := local

all: $(GENERIC_DOCS) $(VERSION_ARCHIVES) test
online: site site-dev $(VERSION_ARCHIVES) test
all: $(GENERIC_DOCS) $(VERSION_ARCHIVES) build/sites/redirect-current.conf build/files test
online: site site-dev $(VERSION_ARCHIVES) build/sites/redirect-current.conf build/files test
local: site-local test

rudder-theme/build/ui-bundle.zip:
Expand All @@ -36,9 +36,21 @@ $(SITES): prepare rudder-theme/build/ui-bundle.zip
antora --ui-bundle-url ./rudder-theme/build/ui-bundle.zip $@.yml

%.tar.gz: %
mkdir -p build/archives
cd build && tar -cvzf $@ $<
mv build/$@ build/archives/
rm -rf build/$<

# Generate apache conf for current redirection to latest release
build/sites/redirect-current.conf:
# once 5.0 is relased, should be https://www.rudder-project.org/release-info/rudder/versions/latest
echo 'RedirectMatch ^/reference/current/(.*)$$ /reference/5.0/$$1' > $@

# Download documentation files
build/files:
mkdir -p build/files
curl -o build/files/rudder-cheatsheet-advanced.pdf "https://raw.githubusercontent.com/Normation/rudder-tools/master/documents/cheatsheet-advanced/rudder-cheatsheet-advanced.pdf"

test:
./tests/check_broken_links.sh

Expand Down
4 changes: 2 additions & 2 deletions rudder-theme/src/partials/header-content.hbs
Expand Up @@ -14,10 +14,10 @@
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Resources</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="http://faq.rudder-project.org/">FAQ</a>
<a class="navbar-item" href="https://faq.rudder-project.org/">FAQ</a>
<a class="navbar-item" href="https://www.rudder-project.org/changelog">Changelog</a>
<a class="navbar-item" href="https://docs.rudder.io/api/">API reference</a>
<a class="navbar-item" href="https://github.com/Normation/rudder-tools/raw/master/documents/cheatsheet-advanced/rudder-cheatsheet-advanced.pdf">Cheatsheet</a>
<a class="navbar-item" href="https://docs.rudder.io/files/rudder-cheatsheet-advanced.pdf">Cheatsheet</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
Expand Down
2 changes: 1 addition & 1 deletion site-dev.yml
Expand Up @@ -3,7 +3,7 @@ site:
start_page: get-started::home
url: https://docs.rudder.io/dev
output:
dir: ./build/site-dev
dir: ./build/sites/site-dev
content:
sources:
- url: .
Expand Down
2 changes: 1 addition & 1 deletion site-local.yml
Expand Up @@ -2,7 +2,7 @@ site:
title: Rudder Documentation Local Test
start_page: get-started::home
output:
dir: ./build/site-local
dir: ./build/sites/site-local
content:
sources:
- url: .
Expand Down
2 changes: 2 additions & 0 deletions site.yml
Expand Up @@ -2,6 +2,8 @@ site:
title: Rudder Documentation
start_page: get-started::home
url: https://docs.rudder.io
output:
dir: ./build/sites/site
content:
sources:
- url: .
Expand Down
2 changes: 1 addition & 1 deletion tests/check_broken_links.sh
@@ -1,4 +1,4 @@
#!/bin/sh
# A recursion level of 2 is enough because all pages are referenced in the left tree.
# Add an exception for build.opensuse.org as they appear to have restrictions based on User-Agent
linkchecker -r 2 --check-extern --ignore-url="/_/img/favicon.ico" --ignore-url=^https://build.opensuse.org --ignore-url=^http://localhost --ignore-url=^https://your.rudder.server --ignore-url=^https://social.technet.microsoft.com build/*/index.html
linkchecker -r 2 --check-extern --ignore-url="/_/img/favicon.ico" --ignore-url=^https://build.opensuse.org --ignore-url=^http://localhost --ignore-url=^https://your.rudder.server --ignore-url=^https://social.technet.microsoft.com build/sites/*/index.html

0 comments on commit e85833b

Please sign in to comment.