Skip to content

Feature Request: Add Page Bundle / relative path support for Open Graph images #872

@moritz1000

Description

@moritz1000

Feature Description

Previously I was using the https://github.com/adityatelange/hugo-PaperMod theme.
Over there you could use:

---
title: test_post
cover:
  image: "og-image.png"
# [...]
  relative: true # To use relative path for cover image, used in hugo Page-bundles
---

to add an Open Graph image to a post.
I found this feature to be very helpful, because the relative part allowed me to put all ALL files for a blog post in one folder:

Image

Problem/Solution

Problem:
Hextra does not allow relative paths for Open Graph images. You have to place them in e.g.: /static/images/og-image.png and call them with

---
title: test_post
params:
  images:
    - "/images/og-image.png"
---

Solution:
Add the same feature as in PaperMod: https://github.com/adityatelange/hugo-PaperMod/wiki/Features#post-cover-image
(I think) here is their implementation: https://github.com/adityatelange/hugo-PaperMod/blob/1cf53273c3ba58f0593ecb7c2befe11274f51a4e/layouts/partials/templates/opengraph.html#L38

Alternatives Considered

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions