From ec4e8007503d18ac396fd120ece95703895ddac9 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 24 Jan 2018 19:55:48 +0000 Subject: [PATCH] Replace `GetByPrefix` with `GetMatch` for 0.34 support --- .circleci/config.yml | 2 +- content/posts/make-qt-less-ugly/index.md | 2 +- content/posts/my-stack-2017/index.md | 2 +- content/posts/why-i-rewrote-my-website/index.md | 2 +- layouts/partials/content.html | 2 +- layouts/partials/list_item.html | 3 ++- layouts/shortcodes/resource.html | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f720e79..2621473 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ jobs: - checkout - run: name: Install Hugo - command: wget https://github.com/gohugoio/hugo/releases/download/v0.32.2/hugo_0.32.2_Linux-64bit.deb -O /tmp/hugo.deb && sudo dpkg -i /tmp/hugo.deb + command: wget https://github.com/gohugoio/hugo/releases/download/v0.34/hugo_0.34_Linux-64bit.deb -O /tmp/hugo.deb && sudo dpkg -i /tmp/hugo.deb - run: name: Install dependencies command: npm install diff --git a/content/posts/make-qt-less-ugly/index.md b/content/posts/make-qt-less-ugly/index.md index 6bc49ff..c37bd00 100644 --- a/content/posts/make-qt-less-ugly/index.md +++ b/content/posts/make-qt-less-ugly/index.md @@ -1,7 +1,7 @@ --- title: Make QT look less ugly date: 2017-12-27 -image: resource:qt-gtk-after +image: resource:qt-gtk-after.png hide_header_image: true --- diff --git a/content/posts/my-stack-2017/index.md b/content/posts/my-stack-2017/index.md index cbb36ac..b60bd47 100644 --- a/content/posts/my-stack-2017/index.md +++ b/content/posts/my-stack-2017/index.md @@ -1,7 +1,7 @@ --- title: My Stack - 2017 Edition date: 2017-12-31 -image: resource:editing-my-stack +image: resource:editing-my-stack.png hide_header_image: true --- diff --git a/content/posts/why-i-rewrote-my-website/index.md b/content/posts/why-i-rewrote-my-website/index.md index eea7ad1..1624ee4 100644 --- a/content/posts/why-i-rewrote-my-website/index.md +++ b/content/posts/why-i-rewrote-my-website/index.md @@ -1,7 +1,7 @@ --- title: Why I rewrote my website date: 2017-11-13 -image: resource:new-site-screenshot +image: resource:new-site-screenshot.png --- I've had a website for around 4 years now, starting with a python CGI-based site hosted at [1&1](https://www.1and1.co.uk/), and evolving into it's current form, powered by [Hugo](https://gohugo.io/). diff --git a/layouts/partials/content.html b/layouts/partials/content.html index 9b80e5d..16a5c69 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -1,7 +1,7 @@ {{ if .Params.image }}{{ if not .Params.hide_header_image }} {{ .Scratch.Set "image" .Params.image }} {{ if hasPrefix .Params.image "resource:" }} - {{ $resource := .Resources.GetByPrefix (replace .Params.image "resource:" "") }} + {{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }} {{ .Scratch.Set "image" $resource.Permalink }} {{ end }}
diff --git a/layouts/partials/list_item.html b/layouts/partials/list_item.html index bb6bca5..436cb16 100644 --- a/layouts/partials/list_item.html +++ b/layouts/partials/list_item.html @@ -4,7 +4,7 @@ {{ .Scratch.Set "image" .Params.image }} {{ if hasPrefix .Params.image "resource:" }} - {{ $resource := .Resources.GetByPrefix (replace .Params.image "resource:" "") }} + {{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }} {{ .Scratch.Set "image" ($resource.Resize "300x").Permalink }} {{ end }}
@@ -19,3 +19,4 @@

{{ partial "summary.html" . }}

+ diff --git a/layouts/shortcodes/resource.html b/layouts/shortcodes/resource.html index 4134d48..83b17dd 100644 --- a/layouts/shortcodes/resource.html +++ b/layouts/shortcodes/resource.html @@ -1,4 +1,4 @@ -{{ $original := .Page.Resources.GetByPrefix (.Get "src") }} +{{ $original := .Page.Resources.GetMatch (.Get "src") }} {{ $options := .Get "options" }} {{ .Scratch.Set "image" $original }}