Browse Source

Use base hugo image

master
Chris Smith 5 years ago
parent
commit
f4c1d585c6
2 changed files with 11 additions and 20 deletions
  1. 1
    12
      Dockerfile
  2. 10
    8
      themes/book/layouts/partials/docs/shared.html

+ 1
- 12
Dockerfile View File

@@ -2,18 +2,7 @@
2 2
 ## Step 1 - add content and build with Hugo
3 3
 ##
4 4
 
5
-FROM debian:stretch as hugo
6
-RUN apt-get -qq update \
7
-	&& DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends python-pygments git ca-certificates ruby \
8
-	&& rm -rf /var/lib/apt/lists/* \
9
-	&& gem install asciidoctor pygments.rb
10
-
11
-ENV HUGO_VERSION 0.54.0
12
-ENV HUGO_BINARY hugo_extended_${HUGO_VERSION}_Linux-64bit.deb
13
-
14
-ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} /tmp/hugo.deb
15
-RUN dpkg -i /tmp/hugo.deb \
16
-	&& rm /tmp/hugo.deb
5
+FROM r.c5h.io/hugo as hugo
17 6
 
18 7
 ADD . /tmp/site
19 8
 RUN hugo -b https://kb.chameth.com/ -v -s /tmp/site -d /tmp/hugo && \

+ 10
- 8
themes/book/layouts/partials/docs/shared.html View File

@@ -1,12 +1,14 @@
1 1
 {{/*These templates contains some more complex logic and shared between partials*/}}
2 2
 {{- define "title" -}}
3
-  {{- if .Pages -}}
4
-    {{ $sections := split (trim .Dir "/") "/" }}
5
-    {{ $title := index ($sections | last 1) 0 | humanize | title }}
6
-    {{- default $title .Title -}}
7
-  {{- else -}}
8
-    {{ $title :=  .File | humanize | title }}
9
-    {{- default $title .Title -}}
3
+  {{- if .File -}}
4
+    {{- if .Pages -}}
5
+      {{ $sections := split (trim .File.Dir "/") "/" }}
6
+      {{ $title := index ($sections | last 1) 0 | humanize | title }}
7
+      {{- default $title .Title -}}
8
+    {{- else -}}
9
+      {{ $title := .File.BaseFileName | humanize | title }}
10
+      {{- default $title .Title -}}
11
+    {{- end -}}
10 12
   {{- end -}}
11 13
 {{- end -}}
12 14
 
@@ -23,4 +25,4 @@
23 25
       color: {{ default "#004ed0" .Site.Params.BookMenuBundleActiveLinkColor }};
24 26
   }
25 27
   </style>
26
-{{- end -}}
28
+{{- end -}}

Loading…
Cancel
Save