Add link checker and fix links

Signed-off-by: lucperkins <lucperkins@gmail.com>
This commit is contained in:
lucperkins 2020-02-27 16:07:52 -08:00
parent 64a77ad8e5
commit 0fa3a5346e
13 changed files with 43 additions and 20 deletions

4
.gitignore vendored
View File

@ -7,3 +7,7 @@ node_modules/
# Hugo-generated assets # Hugo-generated assets
public/ public/
resources/ resources/
# Link checker assets
bin/
tmp/

5
.htmltest.yml Normal file
View File

@ -0,0 +1,5 @@
DirectoryPath: public
IgnoreDirectoryMissingTrailingSlash: true
CheckExternal: false
IgnoreAltMissing: true
IgnoreInternalEmptyHash: true

View File

@ -1,3 +1,6 @@
clean:
rm -rf public resources
serve: serve:
hugo server \ hugo server \
--buildDrafts \ --buildDrafts \
@ -5,10 +8,21 @@ serve:
--disableFastRender --disableFastRender
production-build: production-build:
hugo hugo \
--minify
make check-links
preview-build: preview-build:
hugo \ hugo \
--baseURL $(DEPLOY_PRIME_URL) \ --baseURL $(DEPLOY_PRIME_URL) \
--buildDrafts \ --buildDrafts \
--buildFuture --buildFuture
install-link-checker:
curl https://raw.githubusercontent.com/wjdp/htmltest/master/godownloader.sh | bash
run-link-checker:
bin/htmltest
check-links: install-link-checker run-link-checker

View File

@ -10,8 +10,8 @@
{{- $fontAwesomeUrl := printf "https://use.fontawesome.com/releases/v%s/css/all.css" $fontAwesomeVersion }} {{- $fontAwesomeUrl := printf "https://use.fontawesome.com/releases/v%s/css/all.css" $fontAwesomeVersion }}
@charset "utf-8" @charset "utf-8"
@import url({{ $fontsUrl }}) @import url("{{ $fontsUrl }}")
@import url({{ $fontAwesomeUrl }}) @import url("{{ $fontAwesomeUrl }}")
// Project-specific colors and variables // Project-specific colors and variables
$twitter-blue: #1da1f2 $twitter-blue: #1da1f2

View File

@ -173,7 +173,7 @@ containerd versions:
| Component | Status | Stabilized Version | Links | | Component | Status | Stabilized Version | Links |
|------------------|----------|--------------------|---------------| |------------------|----------|--------------------|---------------|
| GRPC API | Stable | 1.0 | [api/](api) | | GRPC API | Stable | 1.0 | [gRPC API](#grpc) |
| Metrics API | Stable | 1.0 | - | | Metrics API | Stable | 1.0 | - |
| Runtime Shim API | Stable | 1.2 | - | | Runtime Shim API | Stable | 1.2 | - |
| Daemon Config | Stable | 1.0 | - | | Daemon Config | Stable | 1.0 | - |
@ -188,7 +188,7 @@ Unless explicitly stated here, components that are called out as unstable or
not covered may change in a future minor version. Breaking changes to not covered may change in a future minor version. Breaking changes to
"unstable" components will be avoided in patch versions. "unstable" components will be avoided in patch versions.
### GRPC API ### GRPC API {#grpc}
The primary product of containerd is the GRPC API. As of the 1.0.0 release, the The primary product of containerd is the GRPC API. As of the 1.0.0 release, the
GRPC API will not have any backwards incompatible changes without a _major_ GRPC API will not have any backwards incompatible changes without a _major_
@ -197,7 +197,7 @@ version jump.
To ensure compatibility, we have collected the entire GRPC API symbol set into To ensure compatibility, we have collected the entire GRPC API symbol set into
a single file. At each _minor_ release of containerd, we will move the current a single file. At each _minor_ release of containerd, we will move the current
`next.pb.txt` file to a file named for the minor version, such as `1.0.pb.txt`, `next.pb.txt` file to a file named for the minor version, such as `1.0.pb.txt`,
enumerating the support services and messages. See [api/](api) for details. enumerating the support services and messages.
Note that new services may be added in _minor_ releases. New service methods Note that new services may be added in _minor_ releases. New service methods
and new fields on messages may be added if they are optional. and new fields on messages may be added if they are optional.

View File

@ -7,7 +7,7 @@ containerd docs &ndash; {{ .Title }}
{{- $pages := where .Site.Pages "Section" $section }} {{- $pages := where .Site.Pages "Section" $section }}
{{ partial "hero.html" . }} {{ partial "hero.html" . }}
{{ partial "docs/tabs.html" (dict "pages" $pages "currentUrl" .URL) }} {{ partial "docs/tabs.html" (dict "pages" $pages "currentUrl" .RelPermalink) }}
<article class="is-{{ $section }}-article"> <article class="is-{{ $section }}-article">
<div class="container"> <div class="container">

View File

@ -7,7 +7,7 @@ containerd docs &ndash; {{ .Title }}
{{- $pages := where .Site.Pages "Section" "docs" }} {{- $pages := where .Site.Pages "Section" "docs" }}
{{ partial "hero.html" . }} {{ partial "hero.html" . }}
{{ partial "docs/tabs.html" (dict "pages" $pages "currentUrl" .URL) }} {{ partial "docs/tabs.html" (dict "pages" $pages "currentUrl" .RelPermalink) }}
<article class="is-{{ $section }}-article"> <article class="is-{{ $section }}-article">
<div class="container"> <div class="container">

View File

@ -1,4 +1,4 @@
{{- $currentUrl := .URL }} {{- $currentUrl := .RelPermalink }}
{{- $docs := where .Site.Pages "Section" "docs" }} {{- $docs := where .Site.Pages "Section" "docs" }}
<div class="dropdown"> <div class="dropdown">
<div class="dropdown-trigger"> <div class="dropdown-trigger">
@ -12,8 +12,8 @@
<div class="dropdown-menu" id="docs-dropdown-menu" role="menu"> <div class="dropdown-menu" id="docs-dropdown-menu" role="menu">
<div class="dropdown-content"> <div class="dropdown-content">
{{- range $docs }} {{- range $docs }}
{{- $isCurrentPage := eq $currentUrl .URL }} {{- $isCurrentPage := eq $currentUrl .RelPermalink }}
<a class="dropdown-item{{ if $isCurrentPage }} is-active{{ end }}" href="{{ .URL }}"> <a class="dropdown-item{{ if $isCurrentPage }} is-active{{ end }}" href="{{ .RelPermalink }}">
{{ .Title }} {{ .Title }}
</a> </a>
{{- end }} {{- end }}

View File

@ -5,9 +5,9 @@
<ul> <ul>
{{- range $pages }} {{- range $pages }}
{{- $title := cond (isset .Params "short") .Params.short .Title }} {{- $title := cond (isset .Params "short") .Params.short .Title }}
{{- $isCurrentPage := eq $currentUrl .URL }} {{- $isCurrentPage := eq $currentUrl .RelPermalink }}
<li{{ if $isCurrentPage }} class="is-active"{{ end }}> <li{{ if $isCurrentPage }} class="is-active"{{ end }}>
<a href="{{ .URL }}"> <a href="{{ .RelPermalink }}">
{{ $title }} {{ $title }}
</a> </a>
</li> </li>

View File

@ -24,7 +24,7 @@
<ul> <ul>
{{- range $docs }} {{- range $docs }}
<li> <li>
<a href="{{ .URL }}"> <a href="{{ .RelPermalink }}">
{{ .Title }} {{ .Title }}
</a> </a>
</li> </li>
@ -48,7 +48,7 @@
{{- range $projectPages }} {{- range $projectPages }}
<li> <li>
<a href="{{ .URL }}"> <a href="{{ .RelPermalink }}">
{{ .Title }} {{ .Title }}
</a> </a>
</li> </li>

View File

@ -35,6 +35,6 @@
<meta name="twitter:site" content="@{{ $twitterHandle }}"> <meta name="twitter:site" content="@{{ $twitterHandle }}">
<meta name="twitter:creator" content="@{{ $twitterHandle }}"> <meta name="twitter:creator" content="@{{ $twitterHandle }}">
<link rel="canonical" content="{{ .Permalink }}"> <link rel="canonical" href="{{ .Permalink }}">
<link rel="shortcut icon" href="/favicon.png" type="image/png"> <link rel="shortcut icon" href="/favicon.png" type="image/png">
{{ .Hugo.Generator }} {{ hugo.Generator }}

View File

@ -40,7 +40,7 @@
<div class="navbar-dropdown is-right"> <div class="navbar-dropdown is-right">
{{- range $docs }} {{- range $docs }}
<a class="navbar-item" href="{{ .URL }}"> <a class="navbar-item" href="{{ .RelPermalink }}">
{{ .Title }} {{ .Title }}
</a> </a>
{{- end }} {{- end }}
@ -58,7 +58,7 @@
</a> </a>
{{- range $projectPages }} {{- range $projectPages }}
<a class="navbar-item" href="{{ .URL }}"> <a class="navbar-item" href="{{ .RelPermalink }}">
{{ .Title }} {{ .Title }}
</a> </a>
{{- end }} {{- end }}

View File

@ -3,7 +3,7 @@ publish = "public"
command = "make production-build" command = "make production-build"
[build.environment] [build.environment]
HUGO_VERSION = "0.49" HUGO_VERSION = "0.65.3"
[context.deploy-preview] [context.deploy-preview]
command = "make preview-build" command = "make preview-build"