Add photos to notes
parent
553dced539
commit
aad43efe3e
|
@ -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'
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{{- define "main" }}
|
||||
{{ partial "post-start" . }}
|
||||
<section class="e-content">{{ .Content }}</section>
|
||||
{{ partial "post-end" . }}
|
||||
{{- end }}
|
|
@ -1,21 +1,35 @@
|
|||
{{- /* Continued from post-start.html */ -}}
|
||||
<a href="{{ .Permalink }}">
|
||||
Published on <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z" }}">
|
||||
{{ .Date.Format "02 January, 2006" }}
|
||||
</time>
|
||||
{{ if .Lastmod | and (.Lastmod.After .Date) }}
|
||||
, edited <time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z" }}">
|
||||
{{ .Lastmod.Format "02 January, 2006" }}
|
||||
</time>
|
||||
{{ 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" }}
|
||||
<a href="{{ $photo.value }}">
|
||||
<img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ $photo.alt }}"
|
||||
class="u-photo" />
|
||||
</a>
|
||||
<ul>
|
||||
{{ range $tag := .Param "tags" }}
|
||||
<li>
|
||||
<a href="/tags/{{ $tag }}">
|
||||
#<span class="p-category">{{ $tag }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<a class="u-url" href="{{ .Permalink }}">
|
||||
Published on <time class="dt-published" datetime="{{ .Date.Format " 2006-01-02T15:04:05Z" }}">
|
||||
{{ .Date.Format "02 January, 2006" }}
|
||||
</time>
|
||||
{{ if .Lastmod | and (.Lastmod.After .Date) }}
|
||||
, edited <time class="dt-updated" datetime="{{ .Lastmod.Format " 2006-01-02T15:04:05Z" }}">
|
||||
{{ .Lastmod.Format "02 January, 2006" }}
|
||||
</time>
|
||||
{{ end }}
|
||||
</a>
|
||||
<ul>
|
||||
{{ range $tag := .Param "tags" }}
|
||||
<li>
|
||||
<a href="/tags/{{ $tag }}">
|
||||
#<span class="p-category">{{ $tag }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</article>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{{- $me := .Site.Params.Me -}}
|
||||
|
||||
<div class="h-entry">
|
||||
<div class="h-card">
|
||||
<img src="{{ $me.photo }}" height="48" width="48" alt="A close-up photo of my face.">
|
||||
<a href="{{ .Site.BaseURL }}" class="u-name u-url">
|
||||
{{ $me.Name }}
|
||||
</a>
|
||||
</div>
|
||||
{{- /* Continued in ./post-end.html */ -}}
|
||||
<article class="h-entry">
|
||||
<section class="h-card">
|
||||
<img class="u-photo" src="{{ $me.photo }}" height="48" width="48" alt="A close-up photo of my face." />
|
||||
<a href="{{ .Site.BaseURL }}" class="u-name u-url">
|
||||
{{ $me.Name }}
|
||||
</a>
|
||||
</section>
|
||||
{{- /* Continued in ./post-end.html */ -}}
|
||||
|
|
Loading…
Reference in New Issue