Commit Graph

416 Commits

Author SHA1 Message Date
Sebastiaan van Stijn ac396880ec
_includes/cli.md: fix flag descriptions with < and >
Some flag descriptions contain point-brackets to indicate required
options, e.g.:

    --ssh stringArray   SSH agent socket or keys to expose to the build (format: default|<id>[=<socket>|<key>[,<key>]])

When rendering those options as HTML, those options were not visible as
they were rendered as a HTML element.

Given that flag-descriptions are not expected to have MarkDown or HTML
formatting, we can HTML-escape them to prevent this.

This patch escapes the flag-descriptions using liquid's `esacape` command.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-01-13 10:45:30 +01:00
Usha Mandya d5f4338447
Merge pull request #11837 from cclauss/document-failed-to-find-a-Stack-API-version
Describe failed to find a Stack API version errors
2020-12-18 17:21:25 +00:00
Usha Mandya 9295dcb94a
Merge pull request #11744 from aiordache/update_compose_docs
Reference compose spec in compose file formats
2020-12-18 09:45:45 +00:00
Shu e8ce7016d8
Add clarification on username in code snippet
Following the convention e.g. [on this page](https://docs.docker.com/docker-hub/#step-4-build-and-push-a-container-image-to-docker-hub-from-your-computer)
Making it more clear it's to be modified by the user, not copied verbatim
2020-12-14 12:44:41 -05:00
Sebastiaan van Stijn 3ed7250644
Update engine reference for 20.10 release
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-12-09 00:50:04 +01:00
Christian Clauss a5c0b26594 Describe failed to find a Stack API version errors 2020-12-02 13:12:50 +01:00
aiordache 00119346fe Reference compose spec in compose file formats
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-11-17 10:42:36 +01:00
Sebastiaan van Stijn d405b17ca2
update http://dockr.ly links to use TLS
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-27 12:38:17 +01:00
Sebastiaan van Stijn 3ab44b9cd6
_scss: some refactoring of landing-page cta-banners
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-27 12:35:54 +01:00
Sebastiaan van Stijn 2ce808edc0
Remove references to obsolete engine versions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-26 15:45:07 +01:00
Sebastiaan van Stijn 332ce64398
Disable search auto-complete in development environment
As we don't generate a metadata.json, auto-complete is non-functional,
so disabling the script for previews.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-23 15:22:55 +02:00
Sebastiaan van Stijn d883621145
inline "body-landing" and "body" into layout
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>
2020-10-23 13:35:18 +02:00
Sebastiaan van Stijn ea7b89ea2b
inline side-menu include
It was fully static, only used in a single place, but would be processed
for each page.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-23 13:35:10 +02:00
Sebastiaan van Stijn 34a8929065
Skip read-time if it's a minute or less
I don't think the read-time is adding much value on short pages. The
reader is likely able to make a better estimation how long it would
take to read.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-22 17:07:58 +02:00
Sebastiaan van Stijn 91425c3708
Small changes to reading time to prevent redraws
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-22 17:07:56 +02:00
Sebastiaan van Stijn 72baee9555
_includes/head.html: preload OpenSans font to prevent redraws
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-22 17:07:54 +02:00
Sebastiaan van Stijn 0790040ded
Remove unused "tree" metadata variable
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-22 17:07:51 +02:00
Sebastiaan van Stijn 5a1ae8310f
Separate "development" and "production" configurations
This patch updates the default configuration to match a "development"
situation, and introduces build-options to produce a "production"
build.

By default (dev environment):

- Google Analytics / GTM and PollDaddy are disabled
- SASS builds non-minified stylesheets (for easier readabililty)
- Excludes "enterprise" stubs

Building a "production" build locally is still possible by overriding
the `JEKYLL_ENV` build-arg;

    JEKYLL_ENV=production docker-compose  up --build

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-22 15:41:15 +02:00
Sebastiaan van Stijn 126c4cf202
_samples: remove titles, keywords and description
These were not used in the generated redirect pages,
so we can remove them.

Also setting the "sitemap" metadata through the _config.yml
so that we don't have to set it in each of the stubs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-21 15:09:33 +02:00
Sebastiaan van Stijn 03d60f916a
Replace "hide_from_sitemap" with "sitemap: false"
The `hide_from_sitemap` metadata variable was a custom thing we implemented
to add a "noindex" meta-header to pages and to exclude a page from the
search auto-complete.

However, pages with that option set would still be included in sitemap.xml,
resulting in search engines to visit those pages (only to discover they
should not index them).

This patch replaces the custom `hide_from_sitemap` value for `sitemap: false`,
which is a metadata variable that's defined by the "jekyll-sitemap" plugin
we use to generate the sitemap.xml;

https://github.com/jekyll/jekyll-sitemap/blob/v1.4.0/README.md#exclusions

Setting this variable will now:

- add a "noindex" metadata header to the page
- exclude the page from the sitemap.xml.
- exclude the page from /js/metadata.json (used for search autocomplete)

Also fixed an issue in the metadata.json where the `notoc` metadata was
used to exclude pages, however that variable is meant to disable the
in-page TOC (right-hand side navigation with anchor links).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-21 15:09:11 +02:00
Sebastiaan van Stijn 92e2068c38
[Desktop] remove content refering to removed "osxfs" topic
This topic was removed in 9bebb666d9

We may want to add back the part describing sharing sshagent somewhere,
which is not really a feature related to osxfs. Also, some generic
description about file sharing (permissions, syncing) should probably
be added back.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-20 14:08:46 +02:00
Sebastiaan van Stijn a58cd7705d
landing-page: fix mobile navigation background-color
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-19 16:12:49 +02:00
Sebastiaan van Stijn 402a8eb47d
Load javascripts early, but defer execution
This moves our scripts in the head section, but use "defer" loading to allow the
browser to start loading them as soon as possible. Actual execution of deferred
scripts happens once the HTML is fully parsed.
see https://flaviocopes.com/javascript-async-defer/#with-defer-in-the-head

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-16 18:38:41 +02:00
Sebastiaan van Stijn 16ea1a8c31
_includes/head: add missing font, and switch to preload for all
Looks like lighthouse doesn't like prefetch for fonts, so switching
to preload. Also adds a missing variant of Geomanist to the list.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-16 18:06:03 +02:00
Sebastiaan van Stijn 5619dacec7
Improve font handling for best practices
preload fonts and add font-display: swap to prevent flickering

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-16 16:05:38 +02:00
Sebastiaan van Stijn 0bb9a7ff8f
js/search.js: rewrite local search autocomplete and update styling
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-15 17:20:28 +02:00
Sebastiaan van Stijn 52a4c1fe65
accessibility: fix some issues on landing page
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-15 16:12:36 +02:00
Sebastiaan van Stijn 5c8580c3f0
search: load metadata asynchronous as JSON
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 22:08:54 +02:00
Sebastiaan van Stijn e46cfab03c
Load toc.js asynchronously as JSON
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 22:08:50 +02:00
Sebastiaan van Stijn 6b6ef9fe0d
js: move theme switcher to its own script, and use localstorage
rewrite the script to not depend on jQuery, so that it can be run as
soon as possible.

Also switch to use localstorage instead of cookies, which is a more
suitable mechanism for this, and use the same HTML include as was
used on the landing-page for the whole site.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 17:37:21 +02:00
Usha Mandya 934e125ea9
Merge pull request #11541 from thaJeztah/move_polldaddy
Move polldaddy script to an include, and update some options
2020-10-14 16:30:36 +01:00
Sebastiaan van Stijn 8bf577084a
Move polldaddy script to an include, and update some options
- use a config-variable for the ID
- exclude the script if no ID is set
- set default font and font-color

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 15:33:16 +02:00
Sebastiaan van Stijn 017b8823a2
js: remove unused js/menu.js
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 15:00:19 +02:00
Sebastiaan van Stijn 1c2a455346
styles.css: include code-highlight styles in main css document
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 14:39:53 +02:00
Sebastiaan van Stijn 4a7d872cbe
_includes/body-landing.html: unwrap elements
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 14:39:50 +02:00
Usha Mandya e827815c56
Merge pull request #11534 from thaJeztah/accessibility_fixes
Small (accessibility-)fixes
2020-10-13 12:11:44 +01:00
Sebastiaan van Stijn b3104f4eb9
_includes/head.html: add "theme-color" meta
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-13 12:29:07 +02:00
Sebastiaan van Stijn 5923b22117
Add image dimensions to logos and video-icons
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-13 12:28:48 +02:00
Sebastiaan van Stijn b6b666a41f
accessibility: add label to search input
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-13 12:15:25 +02:00
Sebastiaan van Stijn c119ed174e
Use https:// for links and examples
Found these using `http://[^lp10\*`<][^o]` (to exclude "localhost" and IP-addresses)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-13 12:09:11 +02:00
Sebastiaan van Stijn bec50329b9
Fix links not having a trailing /
This avoids resulting in a redirect to the URL with /

Found these using `href="[^#][^#"]+[^/]"`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-13 12:06:06 +02:00
Usha Mandya a17a06c6a1
Merge pull request #11527 from thaJeztah/nosticky
Remove "position: sticky" stickyfill polyfill
2020-10-12 12:58:38 +01:00
Usha Mandya c923e95684
Merge pull request #11526 from thaJeztah/noopener
Add "rel=noopener" and fix canonical links
2020-10-12 12:58:12 +01:00
Aswin Vayiravan 79cf7e841e
added label for menu toggle 2020-10-12 13:40:00 +02:00
Sebastiaan van Stijn eaf40137dc
Remove "position: sticky" stickyfill polyfill
From the script's repository: https://github.com/wilddeer/stickyfill

> Stickyfill did a good job while the browsers were implementing position: sticky
> support. You can now safely use stickies without a polyfill, all modern browsers
> support them natively:
>
> https://caniuse.com/?search=position%3Asticky

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-12 13:27:15 +02:00
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 393d3f6566
Add rel="noopener" to external links
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>
2020-10-12 13:09:30 +02:00
Sebastiaan van Stijn fc407908d7
_includes/head.html: fix escaping in generated descriptions and titles
Commits 7e5352f1ae and e72030d2c6
added automatic generation of page titles and descriptions from the page's content
if no front-matter metadata was present.

Some pages may include characters that should be escaped before using as a HTML
attribute or JSON field.

This patch adds escaping to those texts to prevent the HTML or JSON from being
invalid.

Before this:

HTML meta:

    <meta name="description" content="docker build: The `docker build` command builds Docker images from a Dockerfile and a " context".="" a="" build's="" context="" is="" the="" set="" of="" files="" located="" in="" specified="" `path`="" or="" `url`...."="" />

JSON meta:

    <script type="application/ld+json">{"@context":"http://schema.org","@type":"WebPage","headline":"docker build","description":"docker build: The `docker build` command builds Docker images from a Dockerfile and a "context". A build's context is the set of files located in the specified `PATH` or `URL`....","url":"https://docs.docker.com/engine/reference/commandline/build/"}</script>

After this:

HTML meta:

    <meta name="description" content="docker build: The `docker build` command builds Docker images from a Dockerfile and a &quot;context&quot;. A build&#39;s context is the set of files located in the specified `PATH` or `URL`...." />

JSON meta:

    <script type="application/ld+json">{"@context":"http://schema.org","@type":"WebPage","headline":"docker build","description":"docker build: The `docker build` command builds Docker images from a Dockerfile and a \"context\". A build's context is the set of files located in the specified `PATH` or `URL`....","url":"https://docs.docker.com/engine/reference/commandline/build/"}</script>

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-09 16:16:42 +02:00
Sebastiaan van Stijn 0a03930c6d
Cleanup whitespace in templates
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-09 01:12:05 +02:00
Sebastiaan van Stijn 389f5d14d0
Move 404 script to 404 page, and improve link-generation
If we found a "referer" address, the body now contains the URL from which we
arrived at the 404. For example;

https://github.com/docker/docker.github.io/issues/new?title=404+at+%2Fnosuchpage&body=I+found+a+broken+link+%3A+https%3A%2F%2Fdocs.docker.com%2Fnosuchpage%0AI+arrived+on+this+page+through%3A+https%3A%2F%2Fdocs.docker.com%2Fregistry%2Fspec%2Fapi%2F

Which opens a new ticket:

    Title: 404 at /nosuchpage

    I found a broken link : https://docs.docker.com/nosuchpage
    I arrived on this page through: https://docs.docker.com/registry/spec/api/

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-09 01:12:03 +02:00