From 315fe6a8d9b31b527b47d6506ead7f0ee97799a9 Mon Sep 17 00:00:00 2001 From: zwbetz Date: Wed, 2 Oct 2019 20:03:16 -0500 Subject: rename figure shortcode to figureCupper --- .../content/post/cupper-shortcodes/index.md | 6 ++--- exampleSite/content/post/nasa-images/index.md | 6 ++--- layouts/shortcodes/figure.html | 28 ---------------------- layouts/shortcodes/figureCupper.html | 28 ++++++++++++++++++++++ 4 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 layouts/shortcodes/figure.html create mode 100644 layouts/shortcodes/figureCupper.html diff --git a/exampleSite/content/post/cupper-shortcodes/index.md b/exampleSite/content/post/cupper-shortcodes/index.md index 31b4200..7b957ce 100644 --- a/exampleSite/content/post/cupper-shortcodes/index.md +++ b/exampleSite/content/post/cupper-shortcodes/index.md @@ -198,17 +198,17 @@ Here is some markdown including [a link](https://twitter.com/heydonworks). Donec * Selling point three {{% /ticks %}} -## figure +## figureCupper ``` -{{}} ``` -{{< figure +{{< figureCupper img="sun.jpg" caption="The Sun is the star at the center of the Solar System. It is a nearly perfect sphere of hot plasma, with internal convective motion that generates a magnetic field via a dynamo process. It is by far the most important source of energy for life on Earth. [Credits](https://images.nasa.gov/details-GSFC_20171208_Archive_e000393.html)." command="Resize" diff --git a/exampleSite/content/post/nasa-images/index.md b/exampleSite/content/post/nasa-images/index.md index 6457a91..5609713 100644 --- a/exampleSite/content/post/nasa-images/index.md +++ b/exampleSite/content/post/nasa-images/index.md @@ -6,19 +6,19 @@ tags: ["nasa"] The below images are from the [NASA Image and Video Library](https://images.nasa.gov/) -- indulge yourself, revel in their beauty. -{{< figure +{{< figureCupper img="sun.jpg" caption="The Sun is the star at the center of the Solar System. It is a nearly perfect sphere of hot plasma, with internal convective motion that generates a magnetic field via a dynamo process. It is by far the most important source of energy for life on Earth. [Credits](https://images.nasa.gov/details-GSFC_20171208_Archive_e000393.html)." command="Resize" options="700x" >}} -{{< figure +{{< figureCupper img="moon.jpg" caption="The Moon is an astronomical body that orbits planet Earth and is Earth's only permanent natural satellite. It is the fifth-largest natural satellite in the Solar System, and the largest among planetary satellites relative to the size of the planet that it orbits (its primary). The Moon is after Jupiter's satellite Io the second-densest satellite in the Solar System among those whose densities are known. [Credits](https://images.nasa.gov/details-GSFC_20171208_Archive_e001861.html)." command="Resize" options="700x" >}} -{{< figure +{{< figureCupper img="earth.jpg" caption="Earth is the third planet from the Sun and the only astronomical object known to harbor life. According to radiometric dating and other sources of evidence, Earth formed over 4.5 billion years ago. Earth's gravity interacts with other objects in space, especially the Sun and the Moon, Earth's only natural satellite. Earth revolves around the Sun in 365.26 days, a period known as an Earth year. During this time, Earth rotates about its axis about 366.26 times. [Credits](https://images.nasa.gov/details-PIA18033.html)." command="Resize" diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html deleted file mode 100644 index 90bf2e6..0000000 --- a/layouts/shortcodes/figure.html +++ /dev/null @@ -1,28 +0,0 @@ -{{ $img := .Get "img" }} -{{ $caption := .Get "caption" }} -{{ $command := .Get "command" }} -{{ $options := .Get "options" }} - -{{ $original := .Page.Resources.GetMatch (printf "*%s*" $img) }} -{{ $new := "" }} - -{{ if eq $command "Fit" }} - {{ $new = $original.Fit $options }} -{{ else if eq $command "Fill" }} - {{ $new = $original.Fill $options }} -{{ else if eq $command "Resize" }} - {{ $new = $original.Resize $options }} -{{ else if eq $command "Original" }} - {{ $new = $original }} -{{ else }} - {{ errorf "Invalid image processing command: Must be one of Fit, Fill, Resize, Original." }} -{{ end }} - -
- - - -
- {{ $caption | markdownify }} -
-
diff --git a/layouts/shortcodes/figureCupper.html b/layouts/shortcodes/figureCupper.html new file mode 100644 index 0000000..90bf2e6 --- /dev/null +++ b/layouts/shortcodes/figureCupper.html @@ -0,0 +1,28 @@ +{{ $img := .Get "img" }} +{{ $caption := .Get "caption" }} +{{ $command := .Get "command" }} +{{ $options := .Get "options" }} + +{{ $original := .Page.Resources.GetMatch (printf "*%s*" $img) }} +{{ $new := "" }} + +{{ if eq $command "Fit" }} + {{ $new = $original.Fit $options }} +{{ else if eq $command "Fill" }} + {{ $new = $original.Fill $options }} +{{ else if eq $command "Resize" }} + {{ $new = $original.Resize $options }} +{{ else if eq $command "Original" }} + {{ $new = $original }} +{{ else }} + {{ errorf "Invalid image processing command: Must be one of Fit, Fill, Resize, Original." }} +{{ end }} + +
+ + + +
+ {{ $caption | markdownify }} +
+
-- cgit v1.2.3