Browse Source

Automatically compress images

- added a shortcode 'img' to compress/resize images
- pages/screaming-bridge is now under 1mb :D
main
CPunch 7 months ago
parent
commit
b673e4900c
  1. 3
      .gitignore
  2. BIN
      content/places/screaming-bridge/fall-min.jpg
  3. BIN
      content/places/screaming-bridge/fall.jpg
  4. BIN
      content/places/screaming-bridge/from-gate-min.jpg
  5. BIN
      content/places/screaming-bridge/from-gate.jpg
  6. BIN
      content/places/screaming-bridge/from_gate.jpg
  7. BIN
      content/places/screaming-bridge/ghost-min.jpg
  8. BIN
      content/places/screaming-bridge/ghost.jpg
  9. BIN
      content/places/screaming-bridge/gir-min.jpg
  10. BIN
      content/places/screaming-bridge/gir.jpg
  11. 10
      content/places/screaming-bridge/index.md
  12. BIN
      content/places/screaming-bridge/river-min.jpg
  13. BIN
      content/places/screaming-bridge/river.jpg
  14. 6
      layouts/shortcodes/img.html

3
.gitignore vendored

@ -1 +1,2 @@
.hugo_build.lock
.hugo_build.lock
resources

BIN
content/places/screaming-bridge/fall-min.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 834 KiB

BIN
content/places/screaming-bridge/fall.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 MiB

After

Width:  |  Height:  |  Size: 14 MiB

BIN
content/places/screaming-bridge/from-gate-min.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 KiB

BIN
content/places/screaming-bridge/from-gate.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 MiB

BIN
content/places/screaming-bridge/from_gate.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 MiB

BIN
content/places/screaming-bridge/ghost-min.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 946 KiB

BIN
content/places/screaming-bridge/ghost.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 MiB

After

Width:  |  Height:  |  Size: 15 MiB

BIN
content/places/screaming-bridge/gir-min.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 KiB

BIN
content/places/screaming-bridge/gir.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 MiB

After

Width:  |  Height:  |  Size: 10 MiB

10
content/places/screaming-bridge.md → content/places/screaming-bridge/index.md

@ -7,17 +7,17 @@ location: "1630 Greenbelt Rd, Arlington, TX 76012, USA"
draft: false
---
![](from-gate-min.jpg)
{{< img from-gate.jpg "900x q50" "From the entrance" >}}
> Some locals call this 'screaming bridge', an urban legend from 1978 about four tragic deaths involving a burned down bridge and four Arlington High School football players failing to see the bridge was out before falling into the river below
![](gir-min.jpg)
{{< img gir.jpg "900x q50" "Bridge with graffiti of Gir" >}}
> 'It's not your fault, we love you'
![](fall-min.jpg)
{{< img fall.jpg "900x q50" "A steep drop from the opposite side of the bridge where the road caved in" >}}
> This picture doesn't quite do it justice, mostly because I didn't want to lean over to get a better shot LOL
![](river-min.jpg)
{{< img river.jpg "900x q50" "Overlooking the bridge with a murky river below" >}}
> The bridge crosses over the Trinity River... well, used to since you can't actually cross over now
![](ghost-min.jpg)
{{< img ghost.jpg "900x q50" "A halloween ghost decoration was fitted to the outside gate of the bridge" >}}
> Boo!

BIN
content/places/screaming-bridge/river-min.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 KiB

BIN
content/places/screaming-bridge/river.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 7.8 MiB

6
layouts/shortcodes/img.html

@ -0,0 +1,6 @@
{{ $original := .Page.Resources.GetMatch (.Get 0) }}
{{ $options := .Get 1 }}
{{ .Scratch.Set "image" ($original.Resize $options) }}
{{ $image := .Scratch.Get "image" }}
{{ $title := .Get 2 }}
<img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ $title }}">
Loading…
Cancel
Save