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>
This commit squashes 21 commits. Leaving the commit messages here for posterity.
* Activate Night Mode
- Add toggle for night mode
- Update base styles
* remove font-size
* Update _night-mode.scss
* Fix first-line indenting and color differences
* Fix rescale bug
* stuff
* Add menu fixs
* Update core pallette - light/dark mode
* Toc link padding
* Remove color cycle
Remove temp.css
* update secondary nav bg
* remove paddin-top ul left nav on med viewport
* rough pass at tabs, jsonification
* GHPages 147, authoring YML, sitemap via plugin, working JS
* Update Gemfile
* Removing dk.rb artifact
* Simplifying authoring YML even more
* More YML simplification
* Remove jekyll-seo -- even more perf gain
* Glossary support
* Collections support
* Incremental off; GH Pages 172 gets build time to 50 seconds
* Revert "Put back delimited for YAML (#4046)"
This reverts commit fba2177277.
* Revert "copy-edits and clarify Docker for Windows purpose (#4014)"
This reverts commit df36e90b6e.
* Revert "Update index.md (#3993)"
This reverts commit 3c259d8fb1.
* Revert "Update scaling.md (#4007)"
This reverts commit b9df557deb.
* Revert "used proper css tag for accordion background color (#4016)"
This reverts commit 7ab454f1d5.
* Revert "Fix for index.md# Links (#3981)"
This reverts commit 29c11bebec.
jekyll-redirect-from v0.12.1 causes "Liquid Exception: invalid byte sequence in US-ASCII in _layouts/redirect.html"
-override default built-in redirect.html with a custom "_layouts/redirect.html" that has the ellipsis HTML fix encoded localy
* Simplify both left and right sidebars
- Rewrite the sidebars to use the same CSS class instead of having two
very similar classes. This involves removing all affix related
attributes and functionality from the sidebars and replaced them with
`position: sticky`.
- The table of content elements should not be floated
- Removed unused CSS rules related to the sidebars
- Remove JavaScript used to resize the sidebars
* Improve the mobile menu to be fixed
- Simply JS used to hide/display the navigation bar on mobile viewports
- The mobile menu should be fixed so it can be viewable from the bottom
of the page. Before this change, you would have to scroll up to see
the menu that `position: absolute`
* Fix disappearing top navbar on homepage
- Change the calculation of the affix offset for the navbar on the home
page to ensure the navbar never leaves the viewport. This change also
takes into account the change of how the sidebars' offsets are used
* Fix auto scrolling on overflow
* Add polyfill for 'position: sticky' on IE
* Fix hamburger menu at incorrect breakpoint
* Fix left nav hidden after expanding from mobile
If you expand and collapse the left nav while on mobile and expand to a
desktop view, the left nav would be hidden; this has been fixed
* Unify navbar on homepage with rest of website