Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix featured alt text not being used. #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions layouts/partials/img-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@

Set the path depending on the value passed through

if path is title then it will use the LinkTitle from the Page variable
if path is date then it will format the directory to year/date i.e. 2006/01
Note: path will be concatenated to the root directory, img

otherwise use the explicit path provided by the user
-->

{{ $src := $.Scratch.Get "path" }}
{{ $alt := $.Scratch.Get "featuredalt" }}
{{ $img := $.Scratch.Get "featured" }}
{{ $structType := $.Scratch.Get "structType" }}

{{ if eq $src "date" }}
Expand Down
4 changes: 1 addition & 3 deletions layouts/post/featured.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
{{ $.Scratch.Set "structType" "page" }}
{{ partial "img-path" . }}
{{ $path := $.Scratch.Get "path" }}
{{ $alt := $.Scratch.Get "alt" }}
{{ $img := $.Scratch.Get "img" }}

<a href="{{ .RelPermalink }}" class="image featured">
<img src="{{ $path | relURL }}/{{ .Params.featured }}" alt="{{ $alt }}">
<img src="{{ $path | relURL }}/{{ .Params.featured }}" alt="{{ .Params.featuredalt }}">
</a>
{{ end }}
{{ end }}