mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit 'd276e901b36d2576ef8350ed96b17f66254eac1b'
This commit is contained in:
@@ -17,9 +17,9 @@
|
||||
{{ $recent := ($byLastMod | last 30).Reverse }}
|
||||
{{ $leastRecent := $byLastMod | first 10 }}
|
||||
<h2 id="last-updated">Last Updated</h2>
|
||||
{{ partial "maintenance-pages-table" $recent }}
|
||||
{{ partial "maintenance-pages-table.html" $recent }}
|
||||
<h2 id="least-recently-updated">Least Recently Updated</h2>
|
||||
{{ partial "maintenance-pages-table" $leastRecent }}
|
||||
{{ partial "maintenance-pages-table.html" $leastRecent }}
|
||||
|
||||
{{/* Don't think this is possible with where directly. Should investigate. */}}
|
||||
{{ .Scratch.Set "todos" slice }}
|
||||
@@ -29,7 +29,7 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<h2 id="todos">Pages marked with TODO</h2>
|
||||
{{ partial "maintenance-pages-table" (.Scratch.Get "todos") }}
|
||||
{{ partial "maintenance-pages-table.html" (.Scratch.Get "todos") }}
|
||||
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<table class="collapse ba br2 b--black-10 pv2 ph3">
|
||||
|
@@ -1,27 +1,26 @@
|
||||
{{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
|
||||
{{ $img := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }}
|
||||
{{ $command := .Get 1 }}
|
||||
{{ $options := .Get 2 }}
|
||||
{{ if eq $command "Fit"}}
|
||||
{{ .Scratch.Set "image" ($original.Fit $options) }}
|
||||
{{ $img = $img.Fit $options }}
|
||||
{{ else if eq $command "Resize"}}
|
||||
{{ .Scratch.Set "image" ($original.Resize $options) }}
|
||||
{{ $img = $img.Resize $options }}
|
||||
{{ else if eq $command "Fill"}}
|
||||
{{ .Scratch.Set "image" ($original.Fill $options) }}
|
||||
{{ $img = $img.Fill $options }}
|
||||
{{ else if eq $command "Crop"}}
|
||||
{{ .Scratch.Set "image" ($original.Crop $options) }}
|
||||
{{ $img = $img.Crop $options }}
|
||||
{{ else }}
|
||||
{{ errorf "Invalid image processing command: Must be one of Crop, Fit, Fill or Resize."}}
|
||||
{{ errorf "Invalid image processing command: Must be one of Crop, Fit, Fill or Resize."}}
|
||||
{{ end }}
|
||||
{{ $image := .Scratch.Get "image" }}
|
||||
<figure style="padding: 0.25rem; margin: 2rem 0; background-color: #cccc">
|
||||
<img style="max-width: 100%; width: auto; height: auto;" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
|
||||
<figcaption>
|
||||
<small>
|
||||
{{ with .Inner }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
.{{ $command }} "{{ $options }}"
|
||||
{{ end }}
|
||||
</small>
|
||||
</figcaption>
|
||||
</figure>
|
||||
<img style="max-width: 100%; width: auto; height: auto;" src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
|
||||
<figcaption>
|
||||
<small>
|
||||
{{ with .Inner }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
.{{ $command }} "{{ $options }}"
|
||||
{{ end }}
|
||||
</small>
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
Reference in New Issue
Block a user