Add a link checker

Signed-off-by: Celeste Horgan <celeste@cncf.io>
This commit is contained in:
Tim Bannister
2020-05-25 18:14:44 +01:00
committed by Celeste Horgan
parent 7a3d98a4be
commit 2eb6ab1ad3
14 changed files with 131 additions and 27 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
{{- $filepath := .page.File.Path }}
{{- $editLink := printf "https://github.com/kubernetes/website/edit/master/content/%s/%s" .page.Language.Lang $filepath }}
<p>
<a href="{{ $editLink }}" id="editPageButton" target="_blank">
<a href="{{ $editLink }}" id="editPageButton" target="_blank" data-proofer-ignore>
Edit This Page
</a>
</p>
@@ -15,4 +15,4 @@
{{ .page.TableOfContents }}
{{ end }}
{{ .page.Content }}
{{ end }}
{{ end }}
+2 -2
View File
@@ -12,10 +12,10 @@
<ul>
{{ range $menuSections }}
{{ $yah := $p.IsDescendant . }}
<li><a href="{{ .RelPermalink }}"{{ if $yah }} class="YAH"{{ end }}>{{ .LinkTitle | upper }}</a></li>
<li><a href="{{ .RelPermalink }}"{{ if $yah }} class="YAH"{{ end }} data-proofer-ignore>{{ .LinkTitle | upper }}</a></li>
{{ end }}
</ul>
<form id="searchBox" action="/docs/search/" role="search">
<input type="text" id="search" name="q" placeholder="{{ T "ui_search_placeholder" }}" aria-label="Search">
</form>
</div>
</div>
+3 -3
View File
@@ -1,10 +1,10 @@
<footer>
<div class="light-text main-section">
<nav>
{{ with site.GetPage "page" "docs/tutorials/stateless-application/hello-minikube" }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
{{ with site.GetPage "page" "docs/tutorials/stateless-application/hello-minikube" }}<a href="{{ .RelPermalink }}" data-proofer-ignore>{{ .LinkTitle }}</a>{{ end }}
{{ $sections := slice "docs/home" "blog" "training" "partners" "community" "case-studies" }}
{{ range $sections }}
{{ with site.GetPage "section" . }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
{{ with site.GetPage "section" . }}<a href="{{ .RelPermalink }}" data-proofer-ignore>{{ .LinkTitle }}</a>{{ end }}
{{ end }}
</nav>
<div class="social" role="region" aria-label="Social hyperlinks">
@@ -34,4 +34,4 @@
ICP license: 京ICP备17074266号-3
</div>
</div>
</footer>
</footer>
+9 -9
View File
@@ -1,40 +1,40 @@
<div id="cellophane" onclick="kub.toggleMenu()"></div>
<header>
<a href="{{ site.Home.RelPermalink }}" class="logo" title="{{ site.Home.Title }} - {{ site.Params.title }}" aria-label="Kubernetes website"></a>
<a href="{{ site.Home.RelPermalink }}" class="logo" title="{{ site.Home.Title }} - {{ site.Params.title }}" aria-label="Kubernetes website" data-proofer-ignore></a>
<div class="nav-buttons" data-auto-burger="primary">
<ul class="global-nav">
{{ $sections := slice "docs" "blog" "training" "partners" "community" "case-studies" }}
{{ range $sections }}
{{ with site.GetPage "section" . }}<li><a href="{{ .RelPermalink }}"{{ if eq .Section $.Section }} class="active"{{ end}}>{{ .LinkTitle }}</a></li>{{ end }}
{{ with site.GetPage "section" . }}<li><a href="{{ .RelPermalink }}"{{ if eq .Section $.Section }} class="active"{{ end}} data-proofer-ignore>{{ .LinkTitle }}</a></li>{{ end }}
{{ end }}
{{/* Link directly to documentation etc., if possible. */}}
{{ $langPage := cond (gt (len .Translations) 0) . site.Home }}
<li>
<a href="#">
<a href="#" data-proofer-ignore>
{{ $langPage.Language.LanguageName }} <span class="ui-icon ui-icon-carat-1-s"></span>
</a>
<ul>
{{ range $langPage.Translations }}
<li><a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
<li><a href="{{ .RelPermalink }}" data-proofer-ignore>{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
</li>
<li>
<a href="#">
<a href="#" data-proofer-ignore>
{{ site.Params.version }} <span class="ui-icon ui-icon-carat-1-s"></span>
</a>
<ul>
{{ range site.Params.versions }}
<li><a href="{{ .url }}{{ $.RelPermalink }}">{{ .version }}</a></li>
<li><a href="{{ .url }}{{ $.RelPermalink }}" data-proofer-ignore>{{ .version }}</a></li>
{{ end }}
</ul>
</li>
</ul>
{{ with site.GetPage "section" "docs/tutorials/kubernetes-basics" }}
<a href="{{ .RelPermalink }}" class="button" id="tryKubernetes" data-auto-burger-exclude>{{ .LinkTitle }}</a>
<a href="{{ .RelPermalink }}" class="button" id="tryKubernetes" data-auto-burger-exclude data-proofer-ignore>{{ .LinkTitle }}</a>
{{ end }}
<button id="hamburger" onclick="kub.toggleMenu()" data-auto-burger-exclude><div></div></button>
@@ -44,7 +44,7 @@
<div class="main-section" data-auto-burger="primary">
{{ range site.Menus.main }}
<div class="nav-box">
<h3><a href="{{ .URL }}">{{ .Title }}</a></h3>
<h3><a href="{{ .URL }}" data-proofer-ignore>{{ .Title }}</a></h3>
{{ .Post }}
</div>
{{ end }}
@@ -70,4 +70,4 @@
<div class="clear" style="clear: both"></div>
</div>
</nav>
</header>
</header>
+5 -5
View File
@@ -1,9 +1,9 @@
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}" data-proofer-ignore></a>
{{ template "section-tree-nav" (dict "ctx" . "section" .) }}
{{ define "section-tree-nav" }}
{{ $pages := (union .section.Pages .section.Sections) }}
{{ with site.Params.language_alternatives }}
{{ range . }}
{{ range . }}
{{ with (where $.section.Translations ".Lang" . ) }}
{{ $p := index . 0 }}
{{ $pages = $pages | lang.Merge (union $p.Pages $p.Sections) }}
@@ -25,7 +25,7 @@
{{ if ge (len .section.Content) 10 }}
{{/* The section page has content, so link to it. */}}
{{ $isForeignLanguage := (ne .section.Lang $.ctx.Lang)}}
<a class="item" {{ if $isForeignLanguage }}target="_blank" {{ end }}data-title="{{ .section.LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .section.Lang | upper }})</small>{{ end }}" href="{{ .section.RelPermalink }}"></a>
<a class="item" {{ if $isForeignLanguage }}target="_blank" {{ end }}data-title="{{ .section.LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .section.Lang | upper }})</small>{{ end }}" href="{{ .section.RelPermalink }}" data-proofer-ignore></a>
{{ end }}
{{ template "section-tree-nav" . }}
</div>
@@ -33,5 +33,5 @@
{{ end }}
{{ define "section-tree-nav-page" }}
{{ $isForeignLanguage := (ne .page.Lang $.ctx.Lang)}}
<a class="item" {{ if $isForeignLanguage }}target="_blank" {{ end }}data-title="{{ .page.LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .page.Lang | upper }})</small>{{ end }}" href="{{ .page.RelPermalink }}"></a>
{{ end }}
<a class="item" {{ if $isForeignLanguage }}target="_blank" {{ end }}data-title="{{ .page.LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .page.Lang | upper }})</small>{{ end }}" href="{{ .page.RelPermalink }}" data-proofer-ignore></a>
{{ end }}