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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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 "context". A build'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>