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

Recent posts not showing thumbnails if using page bundles #155

Open
ckoehler opened this issue May 27, 2020 · 1 comment
Open

Recent posts not showing thumbnails if using page bundles #155

ckoehler opened this issue May 27, 2020 · 1 comment

Comments

@ckoehler
Copy link

The thumbnail is just the baseURL plus the thumbnail string, which is wrong when the image isn't in /static but in a page bundle. I fixed it (probably hacky) by changing the related partial. I don't know enough about Hugo to make it more generic, but maybe it's helpful to get a solution.

{{ $related := .Site.RegularPages.Related . | first 6 }}
{{ with $related }}
<section class="p-related">
  <h3>See Also</h3>
  <ul id="slider" class="p-related__list">
    {{ range . }}
    {{ $page :=  . }}
    <li class="p-related__item js-related__item">
      <a href="{{ .RelPermalink }}"
        {{ with .Params.thumbnail }}
         style="background-image: url({{ $page.Permalink }}{{ . }});"
        {{ end }}>
        <span>{{ .Title }}</span>
      </a>
    </li>
    {{ end }}
  </ul>
</section>
{{ end }}
@ckoehler
Copy link
Author

Same issue for the open graph meta tags. The thumbnail image link is relative to the site root, not bundle root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant