Upgraded Hugo and Docsy (#1870)

* Upgraded Hugo and Docsy.

* Updated generated CSS.

* Updated more SCSS files.

* Updated/removed Kubeflow custom layouts in accordance with Docsy updates.

* Revert to older Hugo to see if that fixes the deploy errors.

* Restored latest Hugo to continue troubleshooting the deploy error.

* Created own version of main.css to hold recent change.

* Removed own version of main.css as it didn't fix the deploy error.

* Added more custom layouts for previous changes.

* Swapped to BlackFriday Markdown renderer to see if that fixes the deploy error.

* Swapped back to default renderer Goldmark.

* Removed the enerated resources to see if Hugo will create them for us.

* Forced commit of the generated resources.

* Clarified the version info and added eof empty lines.

* Fixed template for edit-page on single lang site; enabled add-issue-to-project.

* Fixed layouts for alpha/beta banners.

* Removed empty lines to fix table rendering in server overview.

* Closed some HTML anchor tags to fix rendering issues.

* Fixed rendering of cell within table for Pipelines output viewer.

* Fixed list formatting in kfctl/kustomize guide.
This commit is contained in:
Sarah Maddox 2020-04-15 08:12:03 +10:00 committed by GitHub
parent 3698fd021e
commit 4007120ec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
63 changed files with 591 additions and 12990 deletions

View File

@ -47,12 +47,17 @@ and run a local server to host your website. This section shows you how.
### Install Hugo and other dependencies
The Kubeflow website uses the Docsy theme, which recommends that you have
**Hugo version 0.53 or later**, and it must be the **extended** version of Hugo.
You need Hugo version 0.60 or later, and it must be the **extended** version of
Hugo. Hugo version 0.60 and later support thenGoldmark renderer for Markdown.
Goldmark offers improved rendering of some text formatting such as lists.
To get the extended version of Hugo:
**Note:** From April 2020 onwards, Kubeflow recommends that you use
**Hugo version 0.68.3** or later. The Kubeflow website now uses Hugo 0.68.3 via
Netlify.
1. Go to the [Hugo releases](https://github.com/gohugoio/hugo/releases).
To get the latest extended version of Hugo:
1. Go to the [Hugo releases](https://github.com/gohugoio/hugo/releases) page.
1. In the most recent release, scroll down until you find a list of
**extended** versions.
1. Download the relevant file for your operating system.
@ -60,9 +65,9 @@ To get the extended version of Hugo:
For example, to install Hugo on Linux:
1. Download
[hugo_extended_0.53_Linux-64bit.tar.gz](https://github.com/gohugoio/hugo/releases/download/v0.53/hugo_extended_0.53_Linux-64bit.tar.gz)
(or the latest version).
1. Download `hugo_extended_0.68.3_Linux-64bit.tar.gz`
(or the latest version) from the
[Hugo releases](https://github.com/gohugoio/hugo/releases/tag/v0.68.3) page.
1. Create a new directory:
@ -70,14 +75,15 @@ For example, to install Hugo on Linux:
1. Extract the file you downloaded to `$HOME/hugo`.
tar -zxvf hugo_extended_0.53_Linux-64bit.tar.gz
tar -zxvf hugo_extended_0.68.3_Linux-64bit.tar.gz
For more details about installing Hugo, See the
[Hugo installation guide](https://gohugo.io/getting-started/installing/).
If you plan to make changes to the site styling, you need to install some
**CSS libraries** as well. Follow the instructions in the
[Docsy theme's setup guide](https://www.docsy.dev/docs/getting-started/#install-postcss).
[Docsy theme's setup
guide](https://www.docsy.dev/docs/getting-started/#install-postcss).
### Fork and clone the website repository and run a local website server

View File

@ -23,6 +23,10 @@ $navbar-dark-color: rgba($white, 1);
$navbar-dark-hover-color: rgba($white, 0.75);
$navbar-dark-active-color: $navbar-dark-color;
// Fonts
$google_font_family: "Open+Sans:300,300i,400,400i,600,600i,700,700i&display=swap" !default;
// Front page styling
.card-img-top {

60
assets/scss/main.scss Normal file
View File

@ -0,0 +1,60 @@
@import "support/functions";
@import "variables_project";
@import "variables";
@import "support/mixins";
@import "../vendor/bootstrap/scss/bootstrap";
@import "../vendor/Font-Awesome/scss/fontawesome.scss";
@import "../vendor/Font-Awesome/scss/solid.scss";
@import "../vendor/Font-Awesome/scss/brands.scss";
@import "support/utilities";
@import "colors";
@import "boxes";
@import "blog";
@import "code";
@import "nav";
@import "sidebar-tree";
@import "sidebar-toc";
@import "buttons";
@import "breadcrumb";
@import "alerts";
@import "content";
@import "search";
@import "main-container";
@import "blocks/blocks";
@import "section-index";
@import "pageinfo";
@if $td-enable-google-fonts {
@import url('#{$web-font-path}');
}
footer {
min-height: 150px;
@include media-breakpoint-down(md) {
min-height: 200px;
}
}
// Adjust anchors vs the fixed menu.
@include media-breakpoint-up(md) {
.td-offset-anchor:target {
display: block;
position: relative;
top: -4rem;
visibility: hidden;
}
h2[id]:before, h3[id]:before, h4[id]:before, h5[id]:before {
display: block;
content: " ";
margin-top: -5rem;
height: 5rem;
visibility: hidden;
}
}
@import "styles_project";

View File

@ -55,12 +55,13 @@ pygmentsStyle = "tango"
#[permalinks]
#blog = "/:section/:year/:month/:day/:slug/"
## Docsy: Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday
[blackfriday]
plainIDAnchors = true
hrefTargetBlank = true
angledQuotes = false
latexDashes = true
# Docsy: Configuration for Goldmark markdown parser, which is default from
# Hugo 0.60 onwards. https://github.com/yuin/goldmark/
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
# Allow Goldmark to render raw HTML:
unsafe = true
# Docsy: Image processing configuration.
[imaging]
@ -92,7 +93,12 @@ time_format_blog = "02.01.2006"
# Site params
[params]
# GitHub repository for in-page links to editing a page and opening and issues.
github_repo = "https://github.com/kubeflow/website"
# An optional link to a related project repo. For example, the sibling repository where your product code lives.
github_project_repo = "https://github.com/kubeflow/kubeflow"
RSSLink = "/index.xml"
author = "kubeflow.org" # add your company name
github = "kubeflow" # add your github profile name

View File

@ -27,7 +27,6 @@ KFServing and Seldon Core. A check mark (**✓**) indicates that the system
<th>Seldon Core</th>
</tr>
</thead>
<tbody>
<tr>
<td>Framework</td>
@ -35,126 +34,108 @@ KFServing and Seldon Core. A check mark (**&check;**) indicates that the system
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/tensorflow">sample</a></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/servers/tensorflow.html">docs</a></td>
</tr>
<tr>
<td></td>
<td>XGBoost</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/xgboost">sample</a></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/servers/xgboost.html">docs</a></td>
</tr>
<tr>
<td></td>
<td>scikit-learn</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/sklearn">sample</a></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/servers/sklearn.html">docs</a></td>
</tr>
<tr>
<td></td>
<td>NVIDIA Triton Inference Server</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/triton">sample</a></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/examples/nvidia_mnist.html">docs</a></td>
</tr>
<tr>
<td></td>
<td>ONNX</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/onnx">sample</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td>PyTorch</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/pytorch">sample</a></td>
<td><b>&check;</b></td>
</tr>
<tr>
<td>Graph</td>
<td>Transformers</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/blob/master/docs/samples/transformer/image_transformer/kfserving_sdk_transformer.ipynb">sample</a></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/examples/transformer_spam_model.html">docs</a></td>
</tr>
<tr>
<td></td>
<td>Combiners</td>
<td>Roadmap</td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/examples/openvino_ensemble.html">sample</a></td>
</tr>
<tr>
<td></td>
<td>Routers including <a href="https://en.wikipedia.org/wiki/Multi-armed_bandit">MAB</a></td>
<td>Roadmap</td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/analytics/routers.html">docs</a></td>
</tr>
<tr>
<td>Analytics</td>
<td>Explanations</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/explanation/alibi">sample</a></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/analytics/explainers.html">docs</a></td>
</tr>
<tr>
<td>Scaling</td>
<td>Knative</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/autoscaling">sample</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td>GPU AutoScaling</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/autoscaling">sample</a></td>
<td></td>
</tr>
<tr>
<td></td>
<td>HPA</td>
<td><b>&check;</b></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/graph/scaling.html#autoscaling-seldon-deployments">docs</a></td>
</tr>
<tr>
<td>Custom</td>
<td>Container</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/custom">sample</a></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/wrappers/language_wrappers.html">docs</a></td>
</tr>
<tr>
<td></td>
<td>Language Wrappers</td>
<td></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/python/index.html">Python</a>, <a href="https://docs.seldon.io/projects/seldon-core/en/latest/java/README.html">Java</a>, <a href="https://docs.seldon.io/projects/seldon-core/en/latest/R/README.html">R</a></td>
</tr>
<tr>
<td></td>
<td>Multi-Container</td>
<td></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/graph/inference-graph.html">docs</a></td>
</tr>
<tr>
<td>Rollout</td>
<td>Canary</td>
<td><b>&check;</b> <a href="https://github.com/kubeflow/kfserving/tree/master/docs/samples/rollouts">sample</a></td>
<td><b>&check;</b> <a href="https://docs.seldon.io/projects/seldon-core/en/latest/examples/istio_canary.html">docs</a></td>
</tr>
<tr>
<td></td>
<td>Shadow</td>
<td></td>
<td><b>&check;</b></td>
</tr>
<tr>
<td>Istio</td>
<td></td>
@ -164,7 +145,7 @@ KFServing and Seldon Core. A check mark (**&check;**) indicates that the system
</tbody>
</table>
</div>
Notes:
* KFServing and Seldon Core share some technical features, including

View File

@ -94,15 +94,15 @@ Follow these steps to apply the configurations to your Kubeflow cluster:
configuration. If you chose a different configuration in the previous step,
you must change the file name to reflect your configuration:
```
export CONFIG_FILE=${KF_DIR}/{{% config-file-k8s-istio %}}
```
```
export CONFIG_FILE=${KF_DIR}/{{% config-file-k8s-istio %}}
```
1. Apply the configurations:
```
kfctl apply -V -f ${CONFIG_FILE}
```
```
kfctl apply -V -f ${CONFIG_FILE}
```
<a id="kubeflow-directory"><a/>
### Your Kubeflow directory layout

View File

@ -59,7 +59,7 @@ the status of an application:
</table>
</div>
<a id="community-support">
<a id="community-support"></a>
## Support from the Kubeflow community
Kubeflow has an active and helpful community of users and contributors.

View File

@ -10,8 +10,8 @@ for reproducibility. You can track the progress of a run by looking at its
details page on the Kubeflow Pipelines UI, where you can see the runtime graph,
output artifacts, and logs for each step in the run.
<a id=recurring-run>
A *recurring run* , or job in the Kubeflow Pipelines [backend APIs](https://github.com/kubeflow/pipelines/tree/06e4dc660498ce10793d566ca50b8d0425b39981/backend/api/go_http_client/job_client), is a repeatable run of
<a id=recurring-run></a>
A *recurring run*, or job in the Kubeflow Pipelines [backend APIs](https://github.com/kubeflow/pipelines/tree/06e4dc660498ce10793d566ca50b8d0425b39981/backend/api/go_http_client/job_client), is a repeatable run of
a pipeline. The configuration for a recurring run includes a copy of a pipeline
with all parameter values specified and a
[run trigger](/docs/pipelines/concepts/run-trigger/).

View File

@ -11,7 +11,7 @@ you're new to pipelines, see the conceptual guides to
[pipelines](/docs/pipelines/concepts/pipeline/)
and [components](/docs/pipelines/concepts/component/).
<a id="general">
<a id="general"></a>
### General component design rules
* Design your components with composability in mind. Think about

View File

@ -142,11 +142,9 @@ viewers later on the page.
<a href="https://docs.minio.io/">Minio</a>, and
<a href="https://cloud.google.com/storage/docs/">Google Cloud
Storage</a>.</p>
<p>The path can contain wildcards *, in
which case the Kubeflow Pipelines UI concatenates the data from the
matching source files.</p>
<p><code>source</code> can also contain inlined string data instead of
a path when <code>storage='inline'</code>.</p>
</td>

View File

@ -0,0 +1,18 @@
<!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js {{ if .IsHome }}smooth-scroll{{ end }}">
<head>
{{ partial "head.html" . }}
</head>
<body class="td-{{ .Kind }}">
<header>
{{ partial "navbar.html" . }}
</header>
<div class="container-fluid td-default td-outer">
<main role="main" class="td-main">
{{ block "main" . }}{{ end }}
</main>
{{ partial "footer.html" . }}
</div>
{{ partialCached "scripts.html" . }}
</body>
</html>

View File

@ -1,31 +0,0 @@
<!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js">
<head>
{{ partial "head.html" . }}
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
</head>
<body class="td-{{ .Kind }}">
<header>
{{ partial "navbar.html" . }}
</header>
<div class="container-fluid td-outer">
<div class="td-main">
<div class="row flex-xl-nowrap">
<div class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none">
{{ partial "sidebar.html" . }}
</div>
<div class="d-none d-xl-block col-xl-2 td-toc d-print-none">
{{ partial "toc.html" . }}
</div>
<main class="col-12 col-md-9 col-xl-8 pl-md-5" role="main">
{{ partial "version-banner.html" . }}
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
{{ block "main" . }}{{ end }}
</main>
</div>
</div>
{{ partial "footer.html" . }}
</div>
{{ partial "scripts.html" . }}
</body>
</html>

View File

@ -24,4 +24,10 @@
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
{{ partial "hooks/head-end.html" . }}
{{ if .Site.Params.offlineSearch }}
<script
src="https://unpkg.com/lunr@2.3.8/lunr.min.js"
integrity="sha384-vRQ9bDyE0Wnu+lMfm57BlYLO0/XauFuKpVsZPs7KEDwYKktWi5+Kz3MP8++DFlRY"
crossorigin="anonymous"></script>
{{end}}
{{ partial "hooks/head-end.html" . }}

View File

@ -1,15 +1,26 @@
{{ if .Path }}
{{ $pathFormatted := replace .Path "\\" "/" }}
{{ $gh_repo := ($.Param "github_repo") }}
{{ $gh_subdir := ($.Param "github_subdir") }}
{{ $gh_project_repo := ($.Param "github_project_repo") }}
{{ $gh_branch := (default "master" ($.Param "github_branch")) }}
{{ if $gh_repo }}
<div class="td-page-meta ml-2 pb-1 pt-2 mb-0">
{{/* Kubeflow customization to fix the editURL in single-language site. */}}
{{ $editURL := printf "%s/edit/master/content/%s" $gh_repo .Path }}
{{ if .Site.IsMultiLingual }}
{{ $editURL = printf "%s/edit/master/content/%s/%s" $gh_repo ($.Site.Language.Lang) .Path }}
{{ end }}
{{/* Kubeflow customization to add the page URL to the issue body. */}}
{{$doc_url := printf "https://www.kubeflow.org%s" .URL }}
{{ $issuesURL := printf "%s/issues/new?title=%s&body=%s" $gh_repo (htmlEscape $.Title) (htmlEscape $doc_url) }}
<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a>
<a href="{{ $issuesURL }}" target="_blank"><i class="fab fa-github fa-fw"></i> {{ T "post_create_issue" }}</a>
{{ if $gh_project_repo }}
{{ $project_issueURL := printf "%s/issues/new" $gh_project_repo }}
<a href="{{ $project_issueURL }}" target="_blank"><i class="fas fa-tasks fa-fw"></i> {{ T "post_create_project_issue" }}</a>
{{ end }}
</div>
{{ end }}
{{ end }}

View File

@ -1,14 +0,0 @@
<!-- Check the variable that indicates whether this is an archived doc set.
If yes, display a banner. -->
{{ if .Site.Params.archived_version }}
{{ $color := "primary" }}
{{ $latest := .Site.Params.url_latest_version }}
<div class="pageinfo pageinfo-{{ $color }}">
{{ with .Site.Params.version }}<p>Version {{ . | markdownify }} of the
documentation is no longer actively maintained. The site that you are
currently viewing is an archived snapshot. For up-to-date documentation,
see the
<a href="{{ $latest | safeURL }}" target="_blank">latest version</a>.</p>
{{ end }}
</div>
{{ end }}

View File

@ -2,13 +2,7 @@
<h4 class="alert-heading">Alpha</h4>
This Kubeflow component has <b>alpha</b> status with limited support. See the
<a href="/docs/reference/version-policy/">Kubeflow versioning policies</a>.
The Kubeflow team is interested in your
{{ if .Get "feedbacklink"}}
{{ with .Get "feedbacklink" }}
<a href="{{ . | safeURL }}">feedback</a></h4>
{{ end }}
{{ else }}
feedback
{{ end }}
The Kubeflow team is interested in your {{ if .Get "feedbacklink"}} {{ with .Get "feedbacklink" }}
<a href="{{ . | safeURL }}">feedback</a></h4>{{ end }} {{ else }}feedback{{ end }}
about the usability of the feature.
</div>

View File

@ -2,14 +2,8 @@
<h4 class="alert-heading">Beta</h4>
This Kubeflow component has <b>beta</b> status. See the
<a href="/docs/reference/version-policy/">Kubeflow versioning policies</a>.
The Kubeflow team is interested in your
{{ if .Get "feedbacklink"}}
{{ with .Get "feedbacklink" }}
<a href="{{ . | safeURL }}">feedback</a></h4>
{{ end }}
{{ else }}
feedback
{{ end }}
The Kubeflow team is interested in your {{ if .Get "feedbacklink"}} {{ with .Get "feedbacklink" }}
<a href="{{ . | safeURL }}">feedback</a></h4>{{ end }} {{ else }}feedback{{ end }}
about the usability of the feature.
</div>

View File

@ -3,8 +3,8 @@
command = "hugo"
[context.deploy-preview.environment]
HUGO_VERSION = "0.55.6"
HUGO_VERSION = "0.68.3"
[context.production.environment]
HUGO_VERSION = "0.55.6"
HUGO_VERSION = "0.68.3"
HUGO_ENV = "production"

View File

@ -1,6 +0,0 @@
(function($){'use strict';$(function(){$('[data-toggle="tooltip"]').tooltip();$('[data-toggle="popover"]').popover();$('.popover-dismiss').popover({trigger:'focus'})});function bottomPos(element){return element.offset().top+element.outerHeight();}
$(function(){var promo=$(".js-td-cover");if(!promo.length){return}
var promoOffset=bottomPos(promo);var navbarOffset=$('.js-navbar-scroll').offset().top;var threshold=Math.ceil($('.js-navbar-scroll').outerHeight());if((promoOffset-navbarOffset)<threshold){$('.js-navbar-scroll').addClass('navbar-bg-onscroll');}
$(window).on('scroll',function(){var navtop=$('.js-navbar-scroll').offset().top-$(window).scrollTop();var promoOffset=bottomPos($('.js-td-cover'));var navbarOffset=$('.js-navbar-scroll').offset().top;if((promoOffset-navbarOffset)<threshold){$('.js-navbar-scroll').addClass('navbar-bg-onscroll');}else{$('.js-navbar-scroll').removeClass('navbar-bg-onscroll');$('.js-navbar-scroll').addClass('navbar-bg-onscroll--fade');}});});}(jQuery));(function($){'use strict';$(function(){var article=document.getElementsByTagName('main')[0];if(!article){return;}
var headings=article.querySelectorAll('h1, h2, h3, h4, h5, h6');headings.forEach(function(heading){if(heading.id){var a=document.createElement('a');a.style.visibility='hidden';a.setAttribute('aria-hidden','true');a.innerHTML=' <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>';a.href='#'+heading.id;heading.insertAdjacentElement('beforeend',a);heading.addEventListener('mouseenter',function(){a.style.visibility='initial';});heading.addEventListener('mouseleave',function(){a.style.visibility='hidden';});}});});}(jQuery));(function($){'use strict';var Search={init:function(){$(document).ready(function(){$(document).on('keypress','.td-search-input',function(e){if(e.keyCode!==13){return}
var query=$(this).val();var searchPage="/search/?q="+query;document.location=searchPage;return false;});});},};Search.init();}(jQuery));

View File

@ -1 +0,0 @@
{"Target":"js/main.min.2e15022e3e5c9f45bb4de5fa6fbc8ea28077fdcb44b86997ee95342fcfb3299d.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-LhUCLj5cn0W7TeX6b7yOooB3/ctEuGmX7pU0L8+zKZ0="}}

View File

@ -1,43 +0,0 @@
/*
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
(function($) {
'use strict';
var Search = {
init: function() {
$(document).ready(function() {
$(document).on('keypress', '.td-search-input', function(e) {
if (e.keyCode !== 13) {
return
}
var query = $(this).val();
var searchPage = "//localhost:1313/search/?q=" + query;
document.location = searchPage;
return false;
});
});
},
};
Search.init();
}(jQuery));

View File

@ -1 +0,0 @@
{"Target":"js/search.js","MediaType":"application/javascript","Data":{}}

View File

@ -0,0 +1 @@
{"Target":"scss/main.min.f7081e3eac1b5f14acf08cb53ae2eb699e67db20378350df8d4f4d20cd891e25.css","MediaType":"text/css","Data":{"Integrity":"sha256-9wgePqwbXxSs8Iy1OuLraZ5n2yA3g1DfjU9NIM2JHiU="}}

View File

@ -1 +0,0 @@
{"Target":"scss/main.min.e0049549d48c88a1c34cccbbb2f73210e21e3e650be8f940a01a16188955d266.css","MediaType":"text/css","Data":{"Integrity":"sha256-4ASVSdSMiKHDTMy7svcyEOIePmUL6PlAoBoWGIlV0mY="}}

View File

@ -1 +0,0 @@
{"Target":"scss/main.css","MediaType":"text/css","Data":{}}

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 276.93 274.55"><g data-name="Layer 2"><g data-name="Layer 1"><path d="M95.9 62.15l4.1 102.1 73.75-94.12a6.79 6.79.0 0 1 9.6-1.11l46 36.92-15-65.61z" fill="#4279f4"/><path fill="#0028aa" d="M102.55 182.98h65.42l-40.17-32.23-25.25 32.23z"/><path fill="#014bd1" d="M180.18 83.92l-44 56.14 46.88 37.61 44.47-55.76-47.35-37.99z"/><path fill="#bedcff" d="M83.56 52.3l.01-.01 38.69-48.52-62.39 30.05-15.41 67.51 39.1-49.03z"/><path fill="#6ca1ff" d="M45.32 122.05l41.44 51.96-3.95-98.98-37.49 47.02z"/><path fill="#a1c3ff" d="M202.31 28.73 142.65.0l-37.13 46.56 96.79-17.83z"/><path d="M1.6 272v-44.78h5.74v23.41l20.48-23.41h6.4l-17.39 19.7 19 25.07H29.1l-15.92-20.8-5.84 6.65V272zm40.02-9.79V240h5.43v22.39a4.67 4.67.0 0 0 2.35 4.19 11 11 0 0 0 11 0 4.69 4.69.0 0 0 2.33-4.19V240h5.43v22.19a9.08 9.08.0 0 1-4.1 7.87 16.2 16.2.0 0 1-18.37.0 9.07 9.07.0 0 1-4.07-7.85zM77.46 272v-48h5.43v16.81a29.29 29.29.0 0 1 9.32-1.73 13.1 13.1.0 0 1 6.2 1.41 10.71 10.71.0 0 1 4.18 3.74 18.07 18.07.0 0 1 2.23 5.06 21.26 21.26.0 0 1 .73 5.58q0 8.43-4.38 12.79T87.35 272zm5.43-4.87h4.55q6.77.0 9.72-2.95t3-9.51a14.21 14.21.0 0 0-2-7.52 6.55 6.55.0 0 0-6-3.22 24.73 24.73.0 0 0-9.25 1.54zm29.47-11.19q0-7.71 4.09-12.3a13.75 13.75.0 0 1 10.8-4.59q13.35.0 13.36 18.86h-22.82a12.3 12.3.0 0 0 2.9 7.07q2.59 3.11 7.9 3.1a24.92 24.92.0 0 0 10.55-2v5a27.74 27.74.0 0 1-9.86 1.87 19.83 19.83.0 0 1-7.7-1.37 13.31 13.31.0 0 1-5.28-3.76 16.21 16.21.0 0 1-3-5.38 20.84 20.84.0 0 1-.94-6.5zm5.62-2.12h17.26a14.91 14.91.0 0 0-2.37-7.12 6.44 6.44.0 0 0-5.62-2.78 8.2 8.2.0 0 0-6.21 2.72 12.07 12.07.0 0 0-3.04 7.18z" fill="#4279f4" stroke="#4279f4" stroke-miterlimit="10" stroke-width="3.2"/><path d="M147.32 244.89V240h5v-7.59a8.14 8.14.0 0 1 2.31-6.05 7.79 7.79.0 0 1 5.69-2.28h7.86V229h-5c-2.21.0-3.67.45-4.37 1.34s-1.06 2.55-1.06 5V240h8.46v4.87h-8.46V272h-5.44v-27.1zM175.26 272v-48h5.43v48zm19.15-3.95a17.86 17.86.0 1 1 12.33 4.9 16.57 16.57.0 0 1-12.33-4.9zm3.84-20.65a13.16 13.16.0 0 0 0 17.2 12.07 12.07.0 0 0 17 0 13.09 13.09.0 0 0 0-17.2 12.07 12.07.0 0 0-17 0zm30.2-7.4h5.75l7.3 25.32 7.43-25.32h5.36l7.34 25.34L269 240h5.74l-10.04 32h-6.12l-6.83-24.58L245 272h-6.47z" fill="#0028aa" stroke="#0028aa" stroke-miterlimit="10" stroke-width="3.2"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1 +0,0 @@
{"Target":"icons/logo.min.svg","MediaType":"image/svg+xml","Data":{}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,5 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 4
}

View File

@ -26,3 +26,9 @@ information on using pull requests.
This project follows
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
## How to contribute
See the [contribution
guidelines](https://www.docsy.dev/docs/contribution-guidelines/)
in the Docsy user guide.

View File

@ -0,0 +1,177 @@
// Adapted from code by Matt Walters https://www.mattwalters.net/posts/hugo-and-lunr/
(function($) {
'use strict';
$(document).ready(function() {
const $searchInput = $('.td-search-input');
//
// Options for popover
//
$searchInput.data('html', true);
$searchInput.data('placement', 'bottom');
//
// Register handler
//
$searchInput.on('change', event => {
render($(event.target));
// Hide keyboard on mobile browser
$searchInput.blur();
});
// Prevent reloading page by enter key on sidebar search.
$searchInput.closest('form').on('submit', () => {
return false;
});
//
// Lunr
//
let idx = null; // Lunr index
const resultDetails = new Map(); // Will hold the data for the search results (titles and summaries)
// Set up for an Ajax call to request the JSON data file that is created by Hugo's build process
$.ajax($searchInput.data('offline-search-index-json-src')).then(
data => {
idx = lunr(function() {
this.ref('ref');
this.field('title', { boost: 2 });
this.field('body');
data.forEach(doc => {
this.add(doc);
resultDetails.set(doc.ref, {
title: doc.title,
excerpt: doc.excerpt
});
});
});
$searchInput.trigger('change');
}
);
const render = $targetSearchInput => {
// Dispose the previous result
$targetSearchInput.popover('dispose');
//
// Search
//
if (idx === null) {
return;
}
const searchQuery = $targetSearchInput.val();
if (searchQuery === '') {
return;
}
const results = idx
.query(q => {
const tokens = lunr.tokenizer(searchQuery.toLowerCase());
tokens.forEach(token => {
const queryString = token.toString();
q.term(queryString, {
boost: 100
});
q.term(queryString, {
wildcard:
lunr.Query.wildcard.LEADING |
lunr.Query.wildcard.TRAILING,
boost: 10
});
q.term(queryString, {
editDistance: 2
});
});
})
.slice(0, 10);
//
// Make result html
//
const $html = $('<div>');
$html.append(
$('<div>')
.css({
display: 'flex',
justifyContent: 'space-between',
marginBottom: '1em'
})
.append(
$('<span>')
.text('Search results')
.css({ fontWeight: 'bold' })
)
.append(
$('<i>')
.addClass('fas fa-times search-result-close-button')
.css({
cursor: 'pointer'
})
)
);
const $searchResultBody = $('<div>').css({
maxHeight: `calc(100vh - ${$targetSearchInput.offset().top +
180}px)`,
overflowY: 'auto'
});
$html.append($searchResultBody);
if (results.length === 0) {
$searchResultBody.append(
$('<p>').text(`No results found for query "${searchQuery}"`)
);
} else {
results.forEach(r => {
const $cardHeader = $('<div>').addClass('card-header');
const doc = resultDetails.get(r.ref);
const href =
$searchInput.data('offline-search-base-href') +
r.ref.replace(/^\//, '');
$cardHeader.append(
$('<a>')
.attr('href', href)
.text(doc.title)
);
const $cardBody = $('<div>').addClass('card-body');
$cardBody.append(
$('<p>')
.addClass('card-text text-muted')
.text(doc.excerpt)
);
const $card = $('<div>').addClass('card');
$card.append($cardHeader).append($cardBody);
$searchResultBody.append($card);
});
}
$targetSearchInput.on('shown.bs.popover', () => {
$('.search-result-close-button').on('click', () => {
$targetSearchInput.val('');
$targetSearchInput.trigger('change');
});
});
$targetSearchInput
.data('content', $html[0].outerHTML)
.popover('show');
};
});
})(jQuery);

View File

@ -0,0 +1,5 @@
{{- $.Scratch.Add "offline-search-index" slice -}}
{{- range where .Site.AllPages ".Params.exclude_search" "!=" true -}}
{{- $.Scratch.Add "offline-search-index" (dict "title" .Title "ref" .RelPermalink "body" .Plain "excerpt" (.Summary | truncate 100)) -}}
{{- end -}}
{{- $.Scratch.Get "offline-search-index" | jsonify -}}

View File

@ -52,7 +52,7 @@ $td-sidebar-border-color: $border-color !default;
// Background colors for the sections on home page etc. It is a paint by number system, starting at 0, where the number is taken from the shortcode's ordinal
// if not provided by the user.
// These colors are all part of the theme palette, but the mix is fairly random to create variation. This can be overridden by the project if needed.
$td-box-colors: $dark, $primary, $secondary, $info, $primary-light, $gray-600, $success, $warning, $dark, $danger, $primary, $secondary, $primary-light, $info;
$td-box-colors: $dark, $primary, $secondary, $info, $primary-light, $gray-600, $success, $warning, $dark, $danger, $primary, $secondary, $primary-light, $info !default;
$link-color: darken($blue, 15%) !default;
$link-decoration: none !default;
@ -62,7 +62,7 @@ $link-hover-decoration: none !default;
// Fonts
$google_font_name: "Open Sans" !default;
$google_font_family: "Open+Sans:300,300i,400,400i,600,600i,700,700i&display=swap" !default;
$google_font_family: "Open+Sans:300,300i,400,400i,700,700i" !default;
$web-font-path: "https://fonts.googleapis.com/css?family=#{$google_font_family}";
$td-fonts-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
@ -110,8 +110,8 @@ $display4-size: 1.75rem !default;
// Space
$spacer: 1rem;
$td-block-space-top-base: 4 * $spacer;
$td-block-space-bottom-base: 4 * $spacer;
$td-block-space-top-base: 4 * $spacer !default;
$td-block-space-bottom-base: 4 * $spacer !default;
// Pagination

View File

@ -16,4 +16,9 @@
size: cover;
};
}
& > .byline {
position: absolute;
bottom: 2px;
right: 4px;
}
}

View File

@ -28,7 +28,7 @@
@import "pageinfo";
@if $td-enable-google-fonts {
@import url('#{$web-font-path}');
@import url($web-font-path);
}
footer {

View File

@ -0,0 +1,43 @@
# UI strings. Buttons and similar.
[ui_pager_prev]
other = "Anterior"
[ui_pager_next]
other = "Próximo"
[ui_read_more]
other = "Ler mais"
[ui_search]
other = "Buscar no site…"
# Used in sentences such as "Posted in News"
[ui_in]
other = "em"
# Footer text
[footer_all_rights_reserved]
other = "Todos os direitos reservados"
[footer_privacy_policy]
other = "Política de Privacidade"
# Post (blog, articles etc.)
[post_byline_by]
other = "Por"
[post_created]
other = "Criado"
[post_last_mod]
other = "Última modificação"
[post_edit_this]
other = "Editar essa página"
[post_create_issue]
other = "Relatar um problema de documentação"
[post_create_project_issue]
other = "Relatar um problema no projeto"
[post_posts_in]
other = "Posts em"

43
themes/docsy/i18n/zh.toml Normal file
View File

@ -0,0 +1,43 @@
# UI strings. Buttons and similar.
[ui_pager_prev]
other = "上一页"
[ui_pager_next]
other = "下一页"
[ui_read_more]
other = "更多"
[ui_search]
other = "站内搜索…"
# Used in sentences such as "Posted in News"
[ui_in]
other = "in"
# Footer text
[footer_all_rights_reserved]
other = "All Rights Reserved"
[footer_privacy_policy]
other = "隐私政策"
# Post (blog, articles etc.)
[post_byline_by]
other = "By"
[post_created]
other = "创建"
[post_last_mod]
other = "最后修改"
[post_edit_this]
other = "编辑此页"
[post_create_issue]
other = "提交文档问题"
[post_create_project_issue]
other = "提交项目问题"
[post_posts_in]
other = "Posts in"

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

BIN
themes/docsy/images/tn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

View File

@ -1,5 +1,5 @@
<!doctype html>
<html lang="{{ .Site.Language.Lang }}" class="no-js {{ if .IsHome }}smooth-scroll{{ end }}">
<html lang="{{ .Site.Language.Lang }}" class="no-js">
<head>
{{ partial "head.html" . }}
</head>

View File

@ -18,6 +18,7 @@
{{ partial "toc.html" . }}
</div>
<main class="col-12 col-md-9 col-xl-8 pl-md-5" role="main">
{{ partial "version-banner.html" . }}
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
{{ block "main" . }}{{ end }}
</main>

View File

@ -7,6 +7,6 @@
<link rel="icon" type="image/png" href="{{ "favicons/android-36x36.png" | relURL }}" sizes="36x36">
<link rel="icon" type="image/png" href="{{ "favicons/android-48x48.png" | relURL }}" sizes="48x48">
<link rel="icon" type="image/png" href="{{ "favicons/android-72x72.png" | relURL }}" sizes="72x72">
<link rel="icon" type="image/png" href="{{ "favicons/android-96x196.png" | relURL }}" sizes="96x196">
<link rel="icon" type="image/png" href="{{ "favicons/android-96x96.png" | relURL }}" sizes="96x96">
<link rel="icon" type="image/png" href="{{ "favicons/android-144x144.png" | relURL }}" sizes="144x144">
<link rel="icon" type="image/png" href="{{ "favicons/android-192x192.png" | relURL }}"sizes="192x192">
<link rel="icon" type="image/png" href="{{ "favicons/android-192x192.png" | relURL }}" sizes="192x192">

View File

@ -8,4 +8,4 @@
{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" false) | postCSS | minify | fingerprint }}
<link rel="preload" href="{{ $css.RelPermalink }}" as="style">
<link href="{{ $css.RelPermalink }}" rel="stylesheet" integrity="{{ $css.Data.integrity }}">
{{ end }}
{{ end }}

View File

@ -23,4 +23,10 @@
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
{{ partial "hooks/head-end.html" . }}
{{ if .Site.Params.offlineSearch }}
<script
src="https://unpkg.com/lunr@2.3.8/lunr.min.js"
integrity="sha384-vRQ9bDyE0Wnu+lMfm57BlYLO0/XauFuKpVsZPs7KEDwYKktWi5+Kz3MP8++DFlRY"
crossorigin="anonymous"></script>
{{end}}
{{ partial "hooks/head-end.html" . }}

View File

@ -0,0 +1,3 @@
{{ with .Site.Params.algolia_docsearch }}
<!-- scripts for algolia docsearch -->
{{ end }}

View File

@ -0,0 +1,3 @@
{{ with .Site.Params.algolia_docsearch }}
<!-- stylesheet for algolia docsearch -->
{{ end }}

View File

@ -1,16 +1,18 @@
{{ if .Path }}
{{ $pathFormatted := replace .Path "\\" "/" }}
{{ $gh_repo := ($.Param "github_repo") }}
{{ $gh_subdir := ($.Param "github_subdir") }}
{{ $gh_project_repo := ($.Param "github_project_repo") }}
{{ $gh_branch := (default "master" ($.Param "github_branch")) }}
{{ if $gh_repo }}
<div class="td-page-meta ml-2 pb-1 pt-2 mb-0">
{{ $editURL := printf "%s/edit/master/content/%s" $gh_repo .Path }}
{{ $editURL := printf "%s/edit/%s/content/%s" $gh_repo $gh_branch $pathFormatted }}
{{ if and ($gh_subdir) (.Site.Language.Lang) }}
{{ $editURL = printf "%s/edit/master/%s/content/%s/%s" $gh_repo $gh_subdir ($.Site.Language.Lang) $.Path }}
{{ $editURL = printf "%s/edit/%s/%s/content/%s/%s" $gh_repo $gh_branch $gh_subdir ($.Site.Language.Lang) $pathFormatted }}
{{ else if .Site.Language.Lang }}
{{ $editURL = printf "%s/edit/master/content/%s/%s" $gh_repo ($.Site.Language.Lang) .Path }}
{{ $editURL = printf "%s/edit/%s/content/%s/%s" $gh_repo $gh_branch ($.Site.Language.Lang) $pathFormatted }}
{{ else if $gh_subdir }}
{{ $editURL = printf "%s/edit/master/%s/content/%s" $gh_repo $gh_subdir $.Path }}
{{ $editURL = printf "%s/edit/%s/%s/content/%s" $gh_repo $gh_branch $gh_subdir $pathFormatted }}
{{ end }}
{{ $issuesURL := printf "%s/issues/new?title=%s" $gh_repo (htmlEscape $.Title )}}
<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a>

View File

@ -4,6 +4,9 @@
{{ $jsBase := resources.Get "js/base.js" }}
{{ $jsAnchor := resources.Get "js/anchor.js" }}
{{ $jsSearch := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" .Site.Home }}
{{ if .Site.Params.offlineSearch }}
{{ $jsSearch = resources.Get "js/offline-search.js" }}
{{ end }}
{{ $js := (slice $jsBase $jsAnchor $jsSearch) | resources.Concat "js/main.js" }}
{{ if .Site.IsServer }}
<script src="{{ $js.RelPermalink }}"></script>

View File

@ -1,3 +1,22 @@
{{ with .Site.Params.gcs_engine_id }}
<input type="search" class="form-control td-search-input" placeholder="&#xf002 {{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off">
{{ end }}
{{ if or .Site.Params.gcs_engine_id .Site.Params.algolia_docsearch }}
<input type="search" class="form-control td-search-input" placeholder="&#xf002 {{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off">
{{ else if .Site.Params.offlineSearch }}
{{ $offlineSearchIndex := resources.Get "json/offline-search-index.json" | resources.ExecuteAsTemplate "offline-search-index.json" . }}
{{ $offlineSearchIndexFingerprint := $offlineSearchIndex | resources.Fingerprint "sha512" }}
<input
type="search"
class="form-control td-search-input"
placeholder="&#xf002; {{ T "ui_search" }}"
aria-label="{{ T "ui_search" }}"
autocomplete="off"
{{/*
The data attribute name of the json file URL must end with `src` since
Hugo's absurlreplacer requires `src`, `href`, `action` or `srcset` suffix for the attribute name.
If the absurlreplacer is not applied, the URL will start with `/`.
It causes the json file loading error when when relativeURLs is enabled.
https://github.com/google/docsy/issues/181
*/}}
data-offline-search-index-json-src="{{ $offlineSearchIndexFingerprint.RelPermalink }}"
data-offline-search-base-href="/"
>
{{ end }}

View File

@ -0,0 +1,16 @@
<!-- Check the variable that indicates whether this is an archived doc set.
If yes, display a banner. -->
{{ if .Site.Params.archived_version }}
{{ $color := "primary" }}
{{ $latest_version := .Site.Params.url_latest_version }}
{{ $current_version := .Site.Params.version }}
<div class="pageinfo pageinfo-{{ $color }}">
{{ with $current_version }}<p>Version {{ . | markdownify }} of the
documentation is no longer actively maintained. The site that you are
currently viewing is an archived snapshot.
{{ with $latest_version }}For up-to-date documentation, see the
<a href="{{ $latest_version | safeURL }}" target="_blank">latest version</a>.</p>
{{ end }}
{{ end }}
</div>
{{ end }}

View File

@ -6,7 +6,8 @@
{{ $image_anchor := .Get "image_anchor" | default "smart" }}
{{ $logo_anchor := .Get "logo_anchor" | default "smart" }}
{{/* Height can be one of: auto, min, med, max, full. */}}
{{ $height := .Get "height" | default "max" }}
{{ $height := .Get "height" | default "max" }}
{{ $byline := .Get "byline" | default "" }}
{{ with $promo_image }}
{{ $promo_image_big := (.Fill (printf "1920x1080 %s" $image_anchor)) }}
{{ $promo_image_small := (.Fill (printf "960x540 %s" $image_anchor)) }}
@ -37,4 +38,9 @@
</div>
</div>
</div>
{{ if $byline }}
<div class="byline">
<small>{{ $byline }}</small>
</div>
{{ end }}
</section>

View File

@ -1,7 +1,12 @@
# Hugo build configuration for Netlify
# (https://gohugo.io/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify)
# Default build settings
[build]
publish = "userguide/public"
command = "git submodule update -f --init && cd userguide && npm install postcss-cli && hugo --themesDir ../.."
# "production" environment specific build settings
[build.environment]
HUGO_VERSION = "0.55.6"
HUGO_THEME = "repo"

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long