Commit Graph

25 Commits

Author SHA1 Message Date
CrazyMax b672b2894a
jekyll(assets): update font awesome to 6.1.2
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-07-27 16:03:02 +02:00
CrazyMax ef40cfffc3
allow search engines from crawling only on production
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-07-19 14:11:46 +02:00
Peter Dave Hello ed135fe151 Update most links to use https by default
Reference:

- #11640
- d405b17ca2

Signed-off-by: Peter Dave Hello <hsu@peterdavehello.org>
2021-10-12 15:45:57 +08:00
Sebastiaan van Stijn 8c302969af Update download-links
Adjust text, add modal pop-up for browsers with JavaScript enabled, and show
EULA inline for browsers without JavaScript.

Added configuration options in the _config.json to set the correct URLs
once known.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-31 14:35:20 +00:00
38elements 390abf9d51
Fix og:image 2021-02-12 18:43:16 +09: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 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 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 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 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 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 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 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 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 141c1a50b8
_includes: remove unused ng-cloak styles
These styles seem to be used when using AngularJS;
https://docs.angularjs.org/api/ng/directive/ngCloak

> The ngCloak directive is used to prevent the AngularJS html template from
> being briefly displayed by the browser in its raw (uncompiled) form while
> your application is loading. Use this directive to avoid the undesirable
> flicker effect caused by the html template display.

And I don't think that's used anywhere currently, so let's remove

Also removing some other ng-xx classes

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-08 10:26:22 +02:00
Sebastiaan van Stijn e72030d2c6
_includes/head.html: generate description for reference pages
This generates a description for pages that don't have one;

- for referene docs, try the "long" description
- fallback to "short" description
- finally, fallback to taking the first 30 words from the
  page content

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-07 11:23:23 +02:00
Sebastiaan van Stijn 7e5352f1ae
_includes/head.html: generate page title from H1 if needed
This is a very hacky way to extract the page title from pages that do not have
front-matter yaml, but have a H1 header. We need to take (id-) attributes into
account, so some hacking is needed.

Note that there's also a Jekyll plugin that features similar functionality, but
it requires additional dependencies, and we only have a few pages that need
this, so for now using this hack.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-06 23:57:51 +02:00
Sebastiaan van Stijn 6329797e25
_includes/head.html: reorder / regroup metadata fields
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-06 23:57:49 +02:00
Sebastiaan van Stijn 8063e9f3fc
_includes/head.html: remove duplicate "noindex", and cleanup whitespace
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-06 23:57:46 +02:00
Sebastiaan van Stijn ba85012f47
Remove scripts and assets related to archives
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-24 13:25:58 +02:00
Jérémie Drouet 20ff61b942 handle archive feature toggling with css
Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
2020-05-28 10:13:31 +02:00
Sebastiaan van Stijn 987312af65
Move Google Analytics to include, and prepare for making it optional
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-20 10:20:40 +02:00
Jérémie Drouet feb57a7eea landing page: change style
Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
2020-05-05 16:53:50 +02:00