Consolidate YAML files [part-2] (#9236)

Changes that will help upcoming consolidation work:

- Add variable `githubWebsiteRaw` to config.toml to facilitate building
  links to raw YAML files
- Revise `codenew` shortcode to generate links to raw YAML files instead
  of github.com file view;
- Rename `artifacts` directory to `examples` to better reflect its usage;

Accompanied changes as show cases:

- Moved `deployment.yaml`, `deployment-update.yaml` and
  `deployment-scale.yaml` to the new `examples/application` subdirectory;
- Removed duplicate instances of the above YAML files in other
  directories;
- Update example_test.go to test the relocated YAML files and removed
  testing for files that no longer needed.
This commit is contained in:
Qiming
2018-06-27 00:34:52 +08:00
committed by k8s-ci-robot
parent 767bd9371e
commit a3415f6228
12 changed files with 16 additions and 81 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
{{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }}
{{ $fileDir := path.Split $file }}
{{ $bundlePath := path.Join .Page.Dir $fileDir.Dir }}
{{ $filename := printf "/content/%s/artifacts/%s" .Page.Lang $file | safeURL }}
{{ $ghlink := printf "https://%s/blob/master%s" .Page.Site.Params.githubWebsiteRepo $filename | safeURL }}
{{ $filename := printf "/content/%s/examples/%s" .Page.Lang $file | safeURL }}
{{ $ghlink := printf "https://%s/master%s" .Page.Site.Params.githubWebsiteRaw $filename | safeURL }}
{{/* First assume this is a bundle and the file is inside it. */}}
{{ $resource := $p.Resources.GetMatch (printf "%s*" $file ) }}
{{ with $resource }}