Commit Graph

6 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
cafd5a9943 Use full URLs for canonical links
Canonical links are expected to be full URLs, not relative.

For this to work, the Dockerfile had to be updated, because we're stripping
the domain-name from links ("<a href..."), but the script currently also included
"<link rel='canonical' .." tags.

With the change, canonical links are left alone;

These hrefs will be replaced

    echo '<a class=foo href="https://docs.docker.com/foo">hello</a>' | sed -e 's#\(<a[^>]* href="\)https://docs.docker.com/#\1/#g'
    # <a class=foo href="/foo">hello</a>
    echo '<a href="https://docs.docker.com/foo">hello</a>' | sed -e 's#\(<a[^>]* href="\)https://docs.docker.com/#\1/#g'
    # <a href="/foo">hello</a>

But, for example, this one is left alone

    echo '<link rel="canonical" href="https://docs.docker.com/foo/bar" />' | sed -e 's#\(<a[^>]* href="?\)https://docs.docker.com/#\1/#g'
    # <link rel="canonical" href="https://docs.docker.com/foo/bar" />

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-12 13:09:32 +02:00
Sebastiaan van Stijn
3353d60062 engine-api: create unique description for each API version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-06 16:22:35 +02:00
Sebastiaan van Stijn
c3e55377e4 Make the latest API reference page the canonical URL
We host multiple versions of the API reference. While older versions of the
API are still supported by the latest engine release, users should generally
refer to the latest version of the API.

This patch adds a "canonical" meta-tag to the API reference pages, and points
it to the latest version of the API.

Note that there's also a /engine/api/latest/ page, but I didn't pick that
URL, because it's a redirect to `/engine/api/v<current>/`, which Google
probably doesn't like.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-25 18:13:51 +02:00
Sebastiaan van Stijn
770cdeecb1 Engine API: use filename instead of custom api_version property
Now that the files are named `<api-version>.md`, we no longer need
to set a custom `api_version` property; instead we can use the filename
to detect what API version we're rendering.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-25 14:00:57 +01:00
Sebastiaan van Stijn
6dab89c905 Engine API: unify APIs: fetch from single branch
The upstream (moby/moby) repository is unifying all API swagger files
to be in the release branch. With that change, it is no longer needed
to fetch each version of the API separately, and instead all versions
can be fetched at once.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-25 14:00:55 +01:00
Sebastiaan van Stijn
f757d8a14b Engine API: use template for API reference pages
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-24 13:58:30 +01:00