diff --git a/config.toml b/config.toml index b3c0a6e..e7f7c5f 100644 --- a/config.toml +++ b/config.toml @@ -5,6 +5,11 @@ title = 'Pranav Karawale' [taxonomies] tag = 'tags' +[Params] +# This should be the same as baseURL. This is used in some places because +# during development using `hugo server`, the baseURL changes to localhost. +realBaseURL = 'https://karawale.in/staging' + [Params.indieweb] micropub = 'https://karawale.in/lilac/micropub' authorization_endpoint = 'https://indieauth.com/auth' diff --git a/layouts/notes/single.html b/layouts/notes/single.html new file mode 100644 index 0000000..4549663 --- /dev/null +++ b/layouts/notes/single.html @@ -0,0 +1,5 @@ +{{- define "main" }} +{{ partial "post-start" . }} +
{{ .Content }}
+{{ partial "post-end" . }} +{{- end }} diff --git a/layouts/partials/post-end.html b/layouts/partials/post-end.html index c05f84e..e050ec0 100644 --- a/layouts/partials/post-end.html +++ b/layouts/partials/post-end.html @@ -1,21 +1,35 @@ {{- /* Continued from post-start.html */ -}} - - Published on - {{ if .Lastmod | and (.Lastmod.After .Date) }} - , edited - {{ end }} +{{ if .Param "photo" }} +{{ range $photo := .Param "photo" }} + {{ $image := resources.Get (strings.TrimPrefix $.Site.Params.RealBaseURL $photo.value) }} + {{ if eq $image nil }} + {{ $image = resources.GetRemote $photo.value }} + {{ end }} + {{ $image := $image.Fit "800x600" }} + + {{ $photo.alt }} - - + {{ end }} +{{ end }} + + + Published on + {{ if .Lastmod | and (.Lastmod.After .Date) }} + , edited + {{ end }} + + + diff --git a/layouts/partials/post-start.html b/layouts/partials/post-start.html index 94125cb..e678fe6 100644 --- a/layouts/partials/post-start.html +++ b/layouts/partials/post-start.html @@ -1,10 +1,10 @@ {{- $me := .Site.Params.Me -}} -
-
- A close-up photo of my face. - - {{ $me.Name }} - -
-{{- /* Continued in ./post-end.html */ -}} +
+
+ A close-up photo of my face. + + {{ $me.Name }} + +
+ {{- /* Continued in ./post-end.html */ -}}