File tree Expand file tree Collapse file tree
themes/containerd/layouts/docs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 </ div >
2222
2323 < section class ="is-inner-content ">
24+ {{- $parts := split (trim .RelPermalink "/") "/" }}
25+ {{- $xVersion := "" }}
26+ {{- if gt (len $parts) 1 }}
27+ {{- $xVersion = index $parts 1 }}
28+ {{- end }}
29+
30+ {{- if ne $xVersion "" }}
31+ {{- $branch := cond (eq $xVersion "main") "main" (printf "release/%s" $xVersion) }}
32+ {{- $relPath := strings.TrimPrefix (printf "docs/%s/" $xVersion) .File.Path }}
33+
34+ {{- $isGenerated := false }}
35+ {{- if and (hasSuffix .File.Path "_index.md") (ne $relPath "_index.md") }}
36+ {{- $isGenerated = true }}
37+ {{- end }}
38+
39+ {{- if not $isGenerated }}
40+ {{- $sourcePath := cond (eq $relPath "_index.md") "README.md" (printf "docs/%s" $relPath) }}
41+ {{- $editUrl := printf "https://github.com/containerd/containerd/edit/%s/%s" $branch $sourcePath }}
42+
43+ < div class ="has-text-right mb-3 ">
44+ < a href ="{{ $editUrl }} " target ="_blank " class ="is-size-6 ">
45+ < span class ="icon is-small "> < i class ="fas fa-edit "> </ i > </ span > Edit this page
46+ </ a >
47+ </ div >
48+ {{- end }}
49+ {{- end }}
50+
2451 {{- $content := .Content }}
2552 {{ if .Content }}
2653 {{ $content | safeHTML }}
Original file line number Diff line number Diff line change 2121 </ div >
2222
2323 < section class ="is-inner-content ">
24+ {{- $parts := split (trim .RelPermalink "/") "/" }}
25+ {{- $xVersion := "" }}
26+ {{- if gt (len $parts) 1 }}
27+ {{- $xVersion = index $parts 1 }}
28+ {{- end }}
29+
30+ {{- if ne $xVersion "" }}
31+ {{- $branch := cond (eq $xVersion "main") "main" (printf "release/%s" $xVersion) }}
32+ {{- $relPath := strings.TrimPrefix (printf "docs/%s/" $xVersion) .File.Path }}
33+
34+ {{- $isGenerated := false }}
35+ {{- if and (hasSuffix .File.Path "_index.md") (ne $relPath "_index.md") }}
36+ {{- $isGenerated = true }}
37+ {{- end }}
38+
39+ {{- if not $isGenerated }}
40+ {{- $sourcePath := cond (eq $relPath "_index.md") "README.md" (printf "docs/%s" $relPath) }}
41+ {{- $editUrl := printf "https://github.com/containerd/containerd/edit/%s/%s" $branch $sourcePath }}
42+
43+ < div class ="has-text-right mb-3 ">
44+ < a href ="{{ $editUrl }} " target ="_blank " class ="is-size-6 ">
45+ < span class ="icon is-small "> < i class ="fas fa-edit "> </ i > </ span > Edit this page
46+ </ a >
47+ </ div >
48+ {{- end }}
49+ {{- end }}
50+
2451 {{- $content := .Content }}
2552 {{ $content | safeHTML }}
2653 </ section >
You can’t perform that action at this time.
0 commit comments