Browse Source

hopefully now photos with alts are rendered with alts and those without are not

master
jk 4 years ago
parent
commit
445c2e3d6d
  1. 12
      content/photo/5f173ea5/index.md
  2. 12
      content/photo/5f174ae1/index.md
  3. 5
      layouts/_default/section.html
  4. 4
      themes/nipponalba/layouts/_default/list.html
  5. 6
      themes/nipponalba/layouts/_default/single.html
  6. 4
      themes/nipponalba/layouts/index.html

12
content/photo/5f173ea5/index.md

@ -1,12 +0,0 @@
---
date: '2020-07-21 20:14:45'
draft: false
photo:
- {value: 'https://micropub.rocks/media/sunset.jpg', alt: 'Photo of a sunset'}
posttype: photo
slug: 5f173ea5
thumbnail:
- 'https://micropub.rocks/media/sunset.jpg'
title: photo
---
Micropub test of creating a photo referenced by URL with alt text. This post should include a photo of a sunset.

12
content/photo/5f174ae1/index.md

@ -1,12 +0,0 @@
---
date: '2020-07-21 21:06:57'
draft: false
photo:
- { value: 'https://jon.kelbie.scot/media/file-20200721210530-6416.png', alt: test }
posttype: photo
slug: 5f174ae1
thumbnail:
- Array
title: photo
---
testing

5
layouts/_default/section.html

@ -21,8 +21,11 @@
{{$link := .Permalink}}
{{$summary := .Content}}
{{ range .Page.Params.Photo }}
{{ if isset . "value" }}
<a href="{{ $link }}" class="u-url"><img class="u-photo thumb" src="{{ replace .value "800." "300."}}" title="{{ $summary }}" alt="{{ .alt }}"/></a>
{{end}}
{{ else }}
<a href="{{ $link }}" class="u-url"><img class="u-photo thumb" src="{{ replace . "800." "300."}}" title="{{ $summary }}" alt="Alt not yet added, will fix!"/></a>
{{end}}{{end}}
</section>
{{end}}
</section><br/>

4
themes/nipponalba/layouts/_default/list.html

@ -40,7 +40,11 @@
<section class="e-content">
<section class="photos">
{{ range first 1 .Page.Params.Photo }}
{{ if isset . "value" }}
<img class="u-photo thumb" src="{{ replace .value "800." "300."}}" alt="{{ .alt }}"/>
{{ else }}
<img class="u-photo thumb" src="{{ replace . "800." "300."}}" alt="Alt not yet added, will fix!"/>
{{ end }}
{{end}}
</section>

6
themes/nipponalba/layouts/_default/single.html

@ -15,7 +15,11 @@
{{ if eq .Type "photo"}}
<section class="photogrid">
{{ range .Page.Params.Photo }}
<a href="{{ . }}"><img class="u-photo" src="{{ .value }}" alt="{{ .alt }}"/></a>
{{ if in . "value" }}
<a href="{{ .value }}"><img class="u-photo" src="{{ .value }}" alt="{{ .alt }}"/></a>
{{ else }}
<a href="{{ . }}"><img class="u-photo" src="{{ . }}" alt="Alt not yet added, will fix!"/></a>
{{end}}
{{end}}
</section>
{{end}}

4
themes/nipponalba/layouts/index.html

@ -34,7 +34,11 @@
<section class="photos">
{{ $summary := .Content }}
{{ range first 1 .Page.Params.Photo }}
{{ if isset . "value" }}
<img class="u-photo thumb" src="{{ replace .value "800." "300."}}" title="{{$summary}}" alt="{{ .alt }}"/>
{{ else }}
<img class="u-photo thumb" src="{{ replace . "800." "300."}}" title="{{$summary}}" alt="Alt not yet added, will fix!"/>
{{ end }}
{{end}}
</section>
{{end}}

Loading…
Cancel
Save