This fixes various inconsistencies between the landing page and the
other pages by sharing more styles between both:
- fix homepage using a different color for the active tab
- fix homepage not having "hover" styles for the top navigation
I addition, this:
- fixes unwanted whitespace in the hamburger-menu on mobile
- fixes "active" menu item not being highlighted on mobile
- fixes left-side aligning of left-hand menu on desktop
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- move "docker desktop" to the top of the "product manuals" section,
and make it the default page
- Add a "Reference documentation" menu item to the TOC, which will be
the "active" menu item when opening the reference section.
- move the "Samples home" menu item outside of the "samples" sub-menu,
and add it at the top level as "samples overview", so that the "index"
highlights that menu-item without opening the "samples" sub-menu. The
"samples" submenu contains various samples which are a bit outdated,
so probably shouldn't be _that_ prominent when opening the page.
Moving the menu item also makes the "breadcrumb" navigation more
natural (moving from a sample to "samples overview" navigates back
to the "top" of the samples section.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This reduces the time to build, as Jekyll doesn't have to
render the body, then copy it into the layout:
Production before: 62 seconds
Production after: 46 seconds
Development before: 35 seconds
Development after: 33 seconds
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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>
See https://web.dev/external-anchors-use-rel-noopener/
Using noopener, as that addresses the security issue. "noreferer" blocks
the REFERER header, which may still be useful for some target URLs.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The existing implementation was broken, and didn't override
the URLs (due to leading, trailing slashes the paths were not
matched).
Instead of using the custom "not_edited_here.yaml", set the
edit-url as front-matter variable through the _config.yml
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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>
The JavaScript "link fix" looks to be only needed for pages
where Markdown is included, and which contain relative links.
Now that we modified all local includes to use absolute links,
the only location where links are not properly generated, is
in the reference documentation.
If broken links are found elsewhere in the website, those links
are legitimately broken, and should be fixed in the markdown
source, not fixed-up afterwards.
This patch moves the javascript to the cli.md include, so that
the script is only run on the reference pages instead of on every
page.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The base href caused browsers to produce incorrect URLs for
anchor links on various pages, for example, pointing to:
https://docs-test.docker.com/engine/reference/#foreground
Instead of
https://docs-test.docker.com/engine/reference/run/#foreground
Also cleaning up and fixing the JavaScript workaround for links
in include-files;
- only fix up links in the main content, not in other parts
of the page
- don't fix up anchor links, absolute links, or links that don't
contain `.md`: for those we can assume they were generated
correctly, and if not, those are links that should be fixed in
the markdown source, not fixed afterwards.
- document the function for future readers.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- remove some stray empty lines
- put liquid code that was before the opening HTML inside a HTML
comment, to prevent IDE's from marking it as invalid HTML
- fix some indentation
- fix some minor linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Updated the footer to remove redundant links and ensured the entries and layout match the footer displayed on the WWW site.
- Removed Sign in and Create Docker ID option from the header
- Removed Get Support from the right-nav
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>
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>