diff --git a/make-post.py b/make-post.py index 67288f84..a53b93dd 100644 --- a/make-post.py +++ b/make-post.py @@ -5,6 +5,13 @@ from os.path import isfile, join import random +def post_photo(): + # get the current year as variable + year = str(datetime.datetime.now().year) + name = input("Give me the title\n") + os.system(f"hugo new photos/{year}/{name.replace(' ','-').replace(',','').lower()}/index.md") + + def post_fc(): # get the current year as variable year = str(datetime.datetime.now().year) @@ -26,12 +33,12 @@ def quiet_fc(): print(f"Generated {generated}.md") -ANSWER = {"post": post_fc, "quiet": quiet_fc} +ANSWER = {"post": post_fc, "quiet": quiet_fc, 'photo': post_photo} def main_checker(): - # text = input("You need a new [post] or a new [quiet]\n") # Python 3 - text = "post" + text = input("You need a new [post], a new [photo] or a new [quiet]\n") # Python 3 + # text = "post" ANSWER.get(text, main_checker)() diff --git a/themes/fugu/archetypes/photos.md b/themes/fugu/archetypes/photos.md new file mode 100644 index 00000000..51d7492e --- /dev/null +++ b/themes/fugu/archetypes/photos.md @@ -0,0 +1,14 @@ +--- +title: "Routine" +date: "2023-09-28T07:57:25+01:00" +tags: +- challenge +- blackandwhite +description: "A black and white photo of a level crossing with barriers down across the road. A train coming from left to right across the image has just entered the crossing. On the far side of the tracks, brick building line the railway. On the near side, a bike rests against the warning lights." +resources: +- title: Routine + src: '_D0A7928-2.jpg' +--- + +## Challenge +Example of the photo diff --git a/themes/fugu/layouts/photos/list.html b/themes/fugu/layouts/photos/list.html new file mode 100644 index 00000000..3c816045 --- /dev/null +++ b/themes/fugu/layouts/photos/list.html @@ -0,0 +1,40 @@ + +{{ define "main" }} + +
+

{{ .Title }}

+ {{.Content}} +
+
+
+ {{ range .Pages.GroupByDate "Jan 2006" }} +

{{ .Key }}

+ {{ range .Pages }} +
+ {{ $banner := index (.Resources.ByType "image") 0 }} + + {{ $tiny := ($banner.Fill "webp 400x300 q90") }} + {{ $small := ($banner.Fill "webp 600x450 q90") }} + {{ $medium := ($banner.Fill "webp 800x600 q90") }} + {{ $large := ($banner.Fill "webp 1200x700 q90") }} + + {{ .Description }} + +
+ {{ end }} + {{ end }} +
+
+ +{{- end }} + +{{ define "header" }} +{{- partial "header" . -}} +{{ end }} diff --git a/themes/fugu/layouts/photos/single.html b/themes/fugu/layouts/photos/single.html new file mode 100644 index 00000000..a34b6fc1 --- /dev/null +++ b/themes/fugu/layouts/photos/single.html @@ -0,0 +1,183 @@ +{{ define "main" }} + + +
+
+
+

+ {{ .Title }} +

+
+
+ +
+ +
+ {{ $dataFormat := .Site.Params.dateFormat | default "2006-01-02" }} + + {{ if (and .Site.Params.showUpdated (ne .Lastmod .Date)) }} + (Updated: ) + {{ end }} + + {{ with (.GetTerms "tags") }} +
+ {{ range . }} + + {{ .LinkTitle}} + + {{ end }} +
+
+ {{ end }} +
+ + {{ with .Resources.ByType "image" }} + {{ range . }} + {{ $image := .Fit "1024x1024" }} +
+ +
+ {{ $.Description }} +
{{ $.Description }}
+
+ +
+ +
+ + {{ if isset .Params "license" }} + {{ partial "cc-license.html" (dict "license" .Params.license "title" $image.Title "workURL" $.Page.Permalink "author" $.Site.Params.Author "authorURL" $.Site.BaseURL) }} + {{ else }} + {{ with $.Site.Params.photolicense }} + {{ partial "cc-license.html" (dict "license" $.Site.Params.photolicense "title" $image.Title "workURL" $.Page.Permalink "author" $.Site.Params.Author "authorURL" $.Site.BaseURL) }} + {{ end }} + {{ end }} + + {{ with .Exif }} +

Metadata

+ + {{ with $image.Title }} + + + + + {{ end }} + {{ with .Date }} + + + + + {{ end }} + {{ if isset .Tags "Model" }} + + + + + {{ end }} + {{ if isset .Tags "LensModel" }} + + + + + {{ end }} + {{ if isset .Tags "ExposureTime" }} + + + + + {{ end }} + {{ if isset .Tags "FNumber" }} + + + + + {{ end }} + {{ if isset .Tags "ISOSpeedRatings" }} + + + + + {{ end }} + {{ if isset .Tags "FocalLength" }} + + + + + {{ end }} + {{ if isset .Tags "ExposureMode" }} + + + + + {{ end }} + {{ if isset .Tags "ExposureProgram" }} + + + + + {{ end }} + {{ with .Tags.ExposureBiasValue }} + + + + + {{ end }} + {{ if isset .Tags "WhiteBalance" }} + + + + + {{ end }} + {{ if isset .Tags "MeteringMode" }} + + + + + {{ end }} +
Title{{ . }}
Date{{ . }}
Camera{{ .Tags.Model }}
Lens{{ .Tags.LensModel }}
Exposure Time{{ .Tags.ExposureTime }}
F Number{{ .Tags.FNumber }}
ISO{{ .Tags.ISOSpeedRatings }}
Focal Length{{ .Tags.FocalLength }}
Exposure Mode + {{ with (eq .Tags.ExposureMode 1) }}Manual{{ end }} + {{ with (eq .Tags.ExposureMode 0) }}Auto{{ end }} +
Exposure Program + {{ with (eq .Tags.WhiteBalance 1) }}Manual{{ end }} + {{ with (eq .Tags.WhiteBalance 0) }}Auto{{ end }} +
Exposure Compensation{{ . }}
White Balance + {{ with (eq .Tags.WhiteBalance 1) }}Manual{{ end }} + {{ with (eq .Tags.WhiteBalance 0) }}Auto{{ end }} +
Metering Mode + {{ with (eq .Tags.MeteringMode 0) }}Unknown{{ end }} + {{ with (eq .Tags.MeteringMode 1) }}Average{{ end }} + {{ with (eq .Tags.MeteringMode 2) }}Center Weighted Average{{ end }} + {{ with (eq .Tags.MeteringMode 3) }}Spot{{ end }} + {{ with (eq .Tags.MeteringMode 4) }}MultiSpot{{ end }} + {{ with (eq .Tags.MeteringMode 5) }}Pattern{{ end }} + {{ with (eq .Tags.MeteringMode 6) }}Partial{{ end }} + {{ with (eq .Tags.MeteringMode 255) }}other{{ end }} +
+ {{ end }} + + {{ end }} + {{ end }} + + {{ block "content" . }} {{- .Content }} {{- end }} +
+ +
+ {{- partial "webmention.html" . -}} +
+ + {{ $related := .Site.RegularPages.Related . | first 4 }} + {{ with $related }} +
+

See Also

+ {{ range . }} + {{ .Render "summary" }} + {{ end }} + {{ end }} + +
+
+{{- end }} + +{{ define "header" }} +{{- partial "header" . -}} +{{ end }} diff --git a/themes/fugu/layouts/photos/summary.html b/themes/fugu/layouts/photos/summary.html new file mode 100644 index 00000000..9f409174 --- /dev/null +++ b/themes/fugu/layouts/photos/summary.html @@ -0,0 +1,35 @@ + +
+
+ + {{ $banner := index (.Resources.ByType "image") 0 }} +
+ + {{ $tiny := ($banner.Fill "webp 400x300 q90") }} + {{ $small := ($banner.Fill "webp 600x450 q90") }} + {{ $medium := ($banner.Fill "webp 800x600 q90") }} + {{ $large := ($banner.Fill "webp 1200x700 q90") }} + + {{ .Description }} + +
+ +
+ + +

{{ .Title }}

+
+ +

{{ .Description }}

+ + +
+