Fixed absolute links in external content#886
Conversation
The files we’re pulling from docker/docker may include links to docs.docker.com. And we can’t forbid that because relative links wouldn’t make sense in the context of docker/docker repository in some situations. So let’s just fix these links right after get imported. Signed-off-by: Adrien Duermael <adrien@duermael.com>
|
ping @johndmulhausen |
| && wget -O allv/registry/configuration.md https://raw.githubusercontent.com/docker/distribution/$DISTRIBUTION_BRANCH/docs/configuration.md \ | ||
| && jekyll build -s allv -d allvbuild \ | ||
| && find allvbuild/engine/reference -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/#g' \ | ||
| && find allvbuild/engine/extend -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/#g' \ |
There was a problem hiding this comment.
Adding the obligatory link to the "don't use regex to parse HTML" post http://stackoverflow.com/a/1732454/1811501 here 😇
There was a problem hiding this comment.
But yeah, I guess this works; when thinking about this, I wondered if we could simply strip https://docs.docker.com/ in case there's links somehow that used single quotes, but I assume that's not a problem here
There was a problem hiding this comment.
hehe, yes, I don't like doing this too much...
There was a problem hiding this comment.
Nobody likes doing this - it's just the worst. :/
|
@johndmulhausen can you merge that one please if you don't have comments? These links are the only reason why this new test fails: #849 I would like to move forward and keep fixing content in docker/docker.github.io. If we don't need these 2 lines in a near future, we can simply remove them. Thanks! |
|
thanks @thaJeztah ! |
|
Thanks, @aduermael :) |
Proposed changes
The files we’re pulling from docker/docker may include links to
docs.docker.com. And we can’t forbid that because relative links wouldn’t make sense in the context ofdocker/dockerrepository in some situations. So let’s just fix these links right after they get imported.This is necessary for tests in #849 to pass.