Commit Graph

54880 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 68911c8d45
js/docs.js: remove temporary hack for side menu
Looks like everything works without this

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 15:00:13 +02:00
Sebastiaan van Stijn a12ac448d2
_scss: cleanup and reformat comments, remove commented styles
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 14:52:24 +02:00
Sebastiaan van Stijn f0ee00befc
css: remove highlightjs styles as we no longer use them
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-14 14:39:55 +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 9bebb666d9
Merge pull request #11535 from usha-mandya/desktop-3326
Remove osxfs topics from Desktop docs
2020-10-13 19:24:37 +01:00
Usha Mandya beb163481d
Merge pull request #11536 from thaJeztah/fix_metadata
js/metadata.js: fix missing titles and descriptions
2020-10-13 12:43:37 +01: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 373343070e
js/metadata.js: fix missing titles and descriptions
Similar changes to how we generate missing titles and descriptions
for upstream resources.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-13 12:51:19 +02:00
Usha Mandya 2d8b420d3c
Merge pull request #11533 from thaJeztah/fixup_links
Various link fixes
2020-10-13 11:42:10 +01:00
Usha Mandya d400d938e6 Remove osxfs topics from Desktop docs
Signed-off-by: Usha Mandya <usha.mandya@docker.com>
2020-10-13 11:30:29 +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 d61d68cbb0
accessibility: fix active menu item low contrast in night-mode
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-13 12:17:56 +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
Sebastiaan van Stijn ac9a25c8e3
get started: update link title for accessibility
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-13 12:04:42 +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
Sebastiaan van Stijn a90b5b1ae3
Merge pull request #11472 from 123aswin123/name-menu
Added label for menu toggle to improve site accessibility on screen readers
2020-10-12 13:55:55 +02: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
Usha Mandya b753eb089f
Merge pull request #11520 from Lax/master
[doc] Fix parameter error in compose rails document
2020-10-12 10:34:33 +01:00
Usha Mandya 9364113254
Merge pull request #11516 from usha-mandya/desktop-3294
Move wsl 2 best practices
2020-10-12 09:40:09 +01:00
Liu Lantao 2a40c14676
update according to reviewer suggestion
Signed-off-by: Liu Lantao <liulantao@gmail.com>
2020-10-11 13:03:54 +08:00
Liu Lantao c59542a042
Update rails.md
Fix parameter error in compose document.
2020-10-11 13:02:37 +08:00
Usha Mandya 906605a92a
Merge pull request #11517 from thaJeztah/fix_metas
_includes/head.html: fix escaping in generated descriptions and titles
2020-10-09 17:48:04 +01:00
Usha Mandya df45a7c960 Update Win system requirements 2020-10-09 17:05:40 +01: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
Usha Mandya cb912718f7 Move wsl 2 best practices
Signed-off-by: Usha Mandya <usha.mandya@docker.com>
2020-10-09 11:45:59 +01:00
Usha Mandya 4ac8fc0dc8
Merge pull request #11512 from kietct/patch-1
Update formatting.md
2020-10-09 10:56:21 +01:00
Usha Mandya 78b8b8501e
Merge pull request #11509 from usha-mandya/scan-url-patch
Add link to HVS docs from docker scan CLI page
2020-10-09 10:45:03 +01:00
Usha Mandya 619f72ce47
Merge pull request #11514 from thaJeztah/body_template_cleanup
Various cleanup in template, and improvements to 404 page
2020-10-09 10:44:35 +01: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
Sebastiaan van Stijn 2993c55840
move ratings script to end of body, remove inline styles
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-09 01:12:01 +02:00
Sebastiaan van Stijn 9eb0b0c472
Remove "enterprise moved" include
All locations that included this file also have a redirect set, so the
include was never visible.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-09 01:11:51 +02:00
Sebastiaan van Stijn 7130372001
Remove highlight.js script as it was not enabled
Code is already highlighted through "rouge", so enabling highlight.js
only resulted in code being parsed/highlighted _twice_.

Highlight.js was only included on pages that explicitly enabled it,
which was not used anywhere, so removing it should not have an effect.

This patch removes highlight.js. There are some stylesheets that
can be removed and/or merged after this, but leaving that separate.

The github.css stylesheet is already included in the style.css
stylesheet (from the _scss directory), so was redundant.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-09 01:10:48 +02:00
Sebastiaan van Stijn 0be6bf621d
body: remove condition for homepage, as it uses its own template
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-09 01:10:36 +02:00
Usha Mandya f0427f7cb5
Merge pull request #11511 from thaJeztah/header_render
Generate top-navigation instead of using javascript
2020-10-08 17:34:01 +01:00
Sebastiaan van Stijn 1ba81da1bd
js/docs: don't traverse full TOC if we have a direct match
There's no need to traverse the whole TOC if the URL matches
the current URL.

Also some small cleaning up / refactoring.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-08 16:39:01 +02:00
Sebastiaan van Stijn fc89461836
Generate top-navigation instead of using javascript
This makes sure the top-navigation works, even if javascript
is disabled.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-08 16:38:55 +02:00
Sebastiaan van Stijn f4e9565b22
js/docs: remove special casing of glossary
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-08 16:36:34 +02:00
Sebastiaan van Stijn e861522ab9
landing page: generate header links from toc
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-08 16:36:32 +02:00
Sebastiaan van Stijn d58eacad79
_includes: remove unsed header-landing.html
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-10-08 16:36:29 +02:00
Usha Mandya 72226762e7 Add link to HVS docs from docker scan CLI page 2020-10-08 15:15:28 +01:00
Usha Mandya 674c5eb115
Merge pull request #11508 from thaJeztah/left_nav_focus
js/docs: scroll TOC to active menu item
2020-10-08 15:14:56 +01:00