From 51d17bbce6f0ff67a3e81f746b574dd1c900df9a Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Thu, 23 Jan 2020 16:15:18 +0700 Subject: [PATCH 1/3] add position param to imgproc just like image and figure --- layouts/shortcodes/imgproc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/shortcodes/imgproc.html b/layouts/shortcodes/imgproc.html index d4ac2de..662a37c 100644 --- a/layouts/shortcodes/imgproc.html +++ b/layouts/shortcodes/imgproc.html @@ -14,7 +14,7 @@ {{ $image := .Scratch.Get "image" }} -
+
{{ with .Inner }}
From b7a187917bb326f10206b8730924e8b07821b6a8 Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Wed, 29 Jan 2020 12:45:05 +0700 Subject: [PATCH 2/3] add local position var --- layouts/shortcodes/imgproc.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/imgproc.html b/layouts/shortcodes/imgproc.html index 662a37c..6681b0a 100644 --- a/layouts/shortcodes/imgproc.html +++ b/layouts/shortcodes/imgproc.html @@ -1,6 +1,7 @@ {{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }} {{ $command := .Get 1 }} {{ $options := .Get 2 }} +{{ $position := .Get 3}} {{ if eq $command "Fit"}} {{ .Scratch.Set "image" ($original.Fit $options) }} @@ -14,7 +15,7 @@ {{ $image := .Scratch.Get "image" }} -
+
{{ with .Inner }}
From 9598012a77c4782de1abe8e23e219092ac92b857 Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Fri, 31 Jan 2020 15:22:29 +0700 Subject: [PATCH 3/3] update README --- README.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7808341..7943d13 100644 --- a/README.md +++ b/README.md @@ -10,19 +10,21 @@ This theme is pretty basic and covers all of the essentials. All you have to do --- -- [Features](#features) -- [Built-in shortcodes](#built-in-shortcodes) -- [Code highlighting](#code-highlighting) -- [How to start](#how-to-start) -- [How to configure](#how-to-configure) -- [How to add a cover image to your posts](#how-to-add-a-cover-image-to-your-posts) -- [Add-ons](#add-ons) -- [How to run your site](#how-to-run-your-site) -- [How to edit the theme](#how-to-edit-the-theme) -- [How to contribute](#how-to-contribute) -- [Hello Friend theme user?](#hello-friend-theme-user) -- [Sponsoring](#sponsoring) -- [Licence](#licence) +- [Hello Friend](#hello-friend) + - [DEMO - https://hugo-hello-friend.now.sh/](#demo---httpshugo-hello-friendnowsh) + - [Features](#features) + - [Built-in shortcodes](#built-in-shortcodes) + - [Code highlighting](#code-highlighting) + - [How to start](#how-to-start) + - [How to configure](#how-to-configure) + - [How to add a cover image to your posts](#how-to-add-a-cover-image-to-your-posts) + - [Add-ons](#add-ons) + - [How to run your site](#how-to-run-your-site) + - [How to edit the theme](#how-to-edit-the-theme) + - [How to contribute](#how-to-contribute) + - [`Hello Friend` theme user?](#hello-friend-theme-user) + - [Sponsoring](#sponsoring) + - [License](#license) ## Features @@ -37,7 +39,9 @@ This theme is pretty basic and covers all of the essentials. All you have to do - eg: `{{< image src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" >}}` - **`figure`** (same as `image`, plus few optional props: **`caption`**, **`captionPosition`** (left | **center** is default | right), **`captionStyle`** - eg: `{{< figure src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" caption="Hello Friend!" captionPosition="right" captionStyle="color: red;" >}}` -- **`imgproc`** Hugo shortcode for image processing. More info at [https://gohugo.io/content-management/image-processing/](https://gohugo.io/content-management/image-processing/) +- **`imgproc`** Hugo shortcode for image processing, plus additional **`position`** param [ left | center | right ] (optional). + - eg: `{{< imgproc "img/hello.png" Resize "250x" center />}}` + - More detailed info on processing commands at [https://gohugo.io/content-management/image-processing/](https://gohugo.io/content-management/image-processing/) #### Code highlighting