Updating for Hugo 15 patch

Signed-off-by: Mary Anthony <mary@docker.com>
This commit is contained in:
Mary Anthony 2015-10-16 12:20:38 -07:00
parent dfe60f4cb1
commit 8e92a8ab00
5 changed files with 4 additions and 50 deletions

View file

@ -1,4 +1,4 @@
FROM docs/base:latest
FROM docs/base:hugo-github-linking
MAINTAINER Mary Anthony <mary@docker.com> (@moxiegirl)
ENV PROJECT=registry
@ -7,17 +7,3 @@ ENV PROJECT=registry
COPY . /src
COPY . /docs/content/$PROJECT/
# Processing GitHub Markdown
# 1 Remove <!--[metadata]> and <![end-metadata]-->
# 2 Remove any leading combination of dots and slashes (./, ../, ../../, etc)
# 3 Prepend /$PROJECT to all links, remove any trailing .md, only for non http:// links and non internal anchors
RUN find /docs/content/$PROJECT -type f -name "*.md" -not -name "*.compare.md" -exec sed -i.old \
-e '/^<!\(--\)\{0,1\}\[\(end-\)\{0,1\}metadata\]\(--\)\{0,1\}>/g' \
-e 's/\(\][(]\)\(\.*\/\)*/\1/g' \
-e 's/\(\][(]\)\([A-Za-z0-9_/-]\{1,\}\)\(\.md\)\{0,1\}\(#\{0,1\}\(#[A-Za-z0-9_-]*\)\{0,1\}\)[)]/\1\/'$PROJECT'\/\2\4)/g' \
{} \;
# Prepare the compare file and expect an empty diff against test.md
RUN sed -i.old -e 's/\/placeholder\//\/'$PROJECT'\//g' /docs/content/$PROJECT/test.compare.md && diff -u /docs/content/$PROJECT/test.md /docs/content/$PROJECT/test.compare.md