diff --git a/docs/content/about/new-in-032.md b/docs/content/about/new-in-032/index.md similarity index 89% rename from docs/content/about/new-in-032.md rename to docs/content/about/new-in-032/index.md index 3076b3d37..0ae93b557 100644 --- a/docs/content/about/new-in-032.md +++ b/docs/content/about/new-in-032/index.md @@ -12,6 +12,8 @@ sections_weight: 10 draft: false aliases: [] toc: true +images: +- images/blog/sunset.jpg --- @@ -119,6 +121,35 @@ Image operations in Hugo currently **do not preserve EXIF data** as this is not {{% /note %}} +### Image Processing Examples + +_The photo of the sunset used in the examples below is Copyright [Bjørn Erik Pedersen](https://commons.wikimedia.org/wiki/User:Bep) (Creative Commons Attribution-Share Alike 4.0 International license)_ + + +{{< imgproc sunset Resize "300x" >}} + +{{< imgproc sunset Fill "90x120 left" >}} + +{{< imgproc sunset Fill "90x120 right" >}} + +{{< imgproc sunset Fit "90x90" >}} + +{{< imgproc sunset Resize "300x q10" >}} + + +This is the shortcode used in the examples above: + + +{{< code file="layouts/shortcodes/imgproc.html" >}} +{{< readfile file="layouts/shortcodes/imgproc.html" >}} +{{< /code >}} + +And it is used like this: + +```html +{{}} +``` + ### Image Processing Options In addition to the dimensions (e.g. `200x100`) where either height or width can be omitted, Hugo supports a set of additional image options: diff --git a/docs/content/about/new-in-032/sunset.jpg b/docs/content/about/new-in-032/sunset.jpg new file mode 100644 index 000000000..7d7307bed Binary files /dev/null and b/docs/content/about/new-in-032/sunset.jpg differ diff --git a/docs/content/content-management/organization.md b/docs/content/content-management/organization.md index a239c5624..6a854c250 100644 --- a/docs/content/content-management/organization.md +++ b/docs/content/content-management/organization.md @@ -19,6 +19,14 @@ toc: true {{< youtube 0GZxidrlaRM >}} +## Content Bundles and Image Processing + +See [This Page](/about/new-in-032/). We will get the relevant parts of the rest of the Hugo docs updated. Eventually. + +{{< todo >}} +Remove the above when done. +{{< /todo >}} + ## Organization of Content Source In Hugo, your content should be organized in a manner that reflects the rendered website. diff --git a/docs/content/news/0.32-relnotes-ready.md b/docs/content/news/0.32-relnotes-ready.md index 4a2f500f4..c0a93d8e9 100644 --- a/docs/content/news/0.32-relnotes-ready.md +++ b/docs/content/news/0.32-relnotes-ready.md @@ -1,10 +1,12 @@ --- date: 2017-12-31 -title: "0.32" -description: "0.32" -slug: "0.32" +title: "Hugo 0.32: Page Bundles and Image Processing!" +description: "Images and other resources with page-relative links, resize, scale and crop images, and much more." +slug: "0.32-relnotes" categories: ["Releases"] +images: +- images/blog/hugo-32-poster.png --- Hugo `0.32` features **Page Bundles and Image Processing** by [@bep](https://github.com/bep), which is very cool and useful on so many levels. Read about it in more detail in the [Hugo documentation](https://gohugo.io/about/new-in-032/), but some of the highlights include: diff --git a/docs/content/news/0.32.1-relnotes-ready.md b/docs/content/news/0.32.1-relnotes-ready.md index 2a05ff647..80e90e6ed 100644 --- a/docs/content/news/0.32.1-relnotes-ready.md +++ b/docs/content/news/0.32.1-relnotes-ready.md @@ -1,17 +1,14 @@ --- date: 2018-01-02 -title: "0.32.1" -description: "0.32.1" -slug: "0.32.1" +title: "0.32.1: Two bugfixes" +description: "Fixes image processing in shortcodes." +slug: "0.32.1-relnotes" categories: ["Releases"] images: - images/blog/hugo-bug-poster.png - --- - - This fixes 2 bugs from the Hugo 0.32 release. * Fix image processing from shortcodes in non-server mode. [@bep](https://github.com/bep) [#4202](https://github.com/gohugoio/hugo/issues/4202) diff --git a/docs/content/variables/page.md b/docs/content/variables/page.md index 76cf0e83b..eb4699a4e 100644 --- a/docs/content/variables/page.md +++ b/docs/content/variables/page.md @@ -191,7 +191,7 @@ Any other value defined in the front matter in a content file, including taxonom ``` --- title: My First Post -date: date: 2017-02-20T15:26:23-06:00 +date: 2017-02-20T15:26:23-06:00 categories: [one] tags: [two,three,four] ``` diff --git a/docs/layouts/shortcodes/imgproc.html b/docs/layouts/shortcodes/imgproc.html new file mode 100644 index 000000000..f0ab4c8ea --- /dev/null +++ b/docs/layouts/shortcodes/imgproc.html @@ -0,0 +1,19 @@ +{{ $original := .Page.Resources.GetByPrefix (.Get 0) }} +{{ $command := .Get 1 }} +{{ $options := .Get 2 }} +{{ if eq $command "Fit"}} +{{ .Scratch.Set "image" ($original.Fit $options) }} +{{ else if eq $command "Resize"}} +{{ .Scratch.Set "image" ($original.Resize $options) }} +{{ else if eq $command "Fill"}} +{{ .Scratch.Set "image" ($original.Fill $options) }} +{{ else }} +{{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize."}} +{{ end }} +{{ $image := .Scratch.Get "image" }} +
+ +
+ .{{ $command }} "{{ $options }}" +
+
\ No newline at end of file diff --git a/docs/netlify.toml b/docs/netlify.toml index c4d592e14..901acdbb1 100644 --- a/docs/netlify.toml +++ b/docs/netlify.toml @@ -3,15 +3,15 @@ command = "hugo" [context.production.environment] - HUGO_VERSION = "0.31.1" + HUGO_VERSION = "0.32.1" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" [context.deploy-preview.environment] - HUGO_VERSION = "0.31.1" + HUGO_VERSION = "0.32.1" [context.branch-deploy.environment] - HUGO_VERSION = "0.31.1" + HUGO_VERSION = "0.32.1" [context.next.environment] HUGO_BASEURL = "https://next--gohugoio.netlify.com/" diff --git a/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_300x0_resize_q10_box_center.jpg b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_300x0_resize_q10_box_center.jpg new file mode 100644 index 000000000..8736f0376 Binary files /dev/null and b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_300x0_resize_q10_box_center.jpg differ diff --git a/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_300x0_resize_q75_box_center.jpg b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_300x0_resize_q75_box_center.jpg new file mode 100644 index 000000000..47d62fce7 Binary files /dev/null and b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_300x0_resize_q75_box_center.jpg differ diff --git a/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_90x120_fill_q75_box_left.jpg b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_90x120_fill_q75_box_left.jpg new file mode 100644 index 000000000..f9e218242 Binary files /dev/null and b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_90x120_fill_q75_box_left.jpg differ diff --git a/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_90x120_fill_q75_box_right.jpg b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_90x120_fill_q75_box_right.jpg new file mode 100644 index 000000000..fb96b61b6 Binary files /dev/null and b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_90x120_fill_q75_box_right.jpg differ diff --git a/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_90x90_fit_q75_box_center.jpg b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_90x90_fit_q75_box_center.jpg new file mode 100644 index 000000000..b8ad2659f Binary files /dev/null and b/docs/resources/_gen/images/about/new-in-032/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_90x90_fit_q75_box_center.jpg differ diff --git a/docs/static/images/blog/sunset.jpg b/docs/static/images/blog/sunset.jpg new file mode 100644 index 000000000..7d7307bed Binary files /dev/null and b/docs/static/images/blog/sunset.jpg differ