Skip to content

feat: Add OpenGraph - #1056

Merged
pajlada merged 4 commits into
Chatterino:mainfrom
Wissididom:oembed-opengraph
Sep 5, 2026
Merged

pajlada merged 4 commits into
Chatterino:mainfrom
Wissididom:oembed-opengraph

Conversation

@Wissididom

@Wissididom Wissididom commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

I also looked into oEmbed but that requires a query parameter called url that says which page is called, so I think that doesn't really make sense for a static page.
What we could think about is to render an oembed file per page with a dummy url, like /changelog.oembed.json?url=dummy or /changelog/oembed.json?url=dummy and as said that file for every site where the content changes.

The json would be something like:

{
  "version": "1.0",
  "type": "link",
  "title": "Changelog - Chatterino",
  "provider_name": "Chatterino",
  "provider_url": "https://chatterino.com"
}

in j2 maybe something like:

{
  "version": "1.0",
  "type": "link",
  "title": "{{ page_title | trim }}",
  "provider_name": "Chatterino",
  "provider_url": "https://chatterino.com"
}

where we then would need to update the title property depending on the url query parameter. If we do it with different files I think we'd need to add a link tag with a different value for each page to base.j2 and have different json files built with a different content while ignoring the url query parameter, which also seems overly complex.

This PR only implements the OpenGraph part, if we decide against adding oEmbed then this PR also solves #477

PS:
image
Closes #477

@Wissididom

Copy link
Copy Markdown
Contributor Author

@jprochazk I think it would make sense if you review it as well. This is my first time working with j2 files.

@jprochazk jprochazk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.rs/minijinja/latest/minijinja/syntax/index.html#-block-

If you want to print a block multiple times, you can, however, use the special self variable and call the block with that name

Comment thread templates/base.j2 Outdated
Comment thread templates/base.j2 Outdated
Comment thread templates/base.j2 Outdated
Co-authored-by: jprochazk <pjanv42@gmail.com>
@Wissididom
Wissididom requested a review from jprochazk August 30, 2026 20:13
@Wissididom Wissididom changed the title Add OpenGraph feat: Add OpenGraph Sep 2, 2026
@pajlada
pajlada merged commit d24b3f0 into Chatterino:main Sep 5, 2026
2 of 3 checks passed
@Wissididom
Wissididom deleted the oembed-opengraph branch September 5, 2026 10:08
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

Successfully merging this pull request may close these issues.

Add oembed/opengraph tags

3 participants