Skip to content

Commit ec3383d

Browse files
Switch title and author to avoid cutting off post title
1 parent 51e7bd4 commit ec3383d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/reddit/compile.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ export async function postToHtml(post: RedditPost): Promise<HTMLElement> {
5757
const originalUrl = `https://www.reddit.com${post.permalink}`;
5858
const authorName = `u/${post.author} on r/${post.subreddit}`;
5959

60-
head.meta('og:title', post.title);
61-
head.meta('twitter:title', post.title);
62-
head.meta('twitter:creator', authorName);
60+
head.meta('og:title', authorName);
61+
head.meta('twitter:title', authorName);
62+
head.meta('twitter:creator', post.title);
6363

6464
const oembed = head.appendChild(new HTMLElement('link', {}));
6565
oembed.setAttribute('rel', 'alternate');
6666
oembed.setAttribute('type', 'application/json+oembed');
67-
oembed.setAttribute('title', post.author);
67+
oembed.setAttribute('title', authorName);
6868
oembed.setAttribute('href', encodeOEmbed({
6969
type: 'link',
70-
author_name: authorName,
70+
author_name: post.title,
7171
author_url: originalUrl,
7272
provider_name: 'rxddit.com',
7373
version: '1.0',

0 commit comments

Comments
 (0)