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 meta tags #37

Merged
merged 7 commits into from
Jul 10, 2024
Merged

Fix meta tags #37

merged 7 commits into from
Jul 10, 2024

Conversation

aaccioly
Copy link
Contributor

@aaccioly aaccioly commented Jun 24, 2024

Fixes #36

With this fix users can set their X / Twitter handle for the website, as well as custom metadata per page e.g.:

// Rewrite meta tags for specific pages
// Use the Notion page ID as the key
pageMetadata: {
  'NOTION_PAGE_ID': {
    title: 'My Custom Page Title',
    description: 'My custom page description',
    image: 'https://imagehosting.com/images/page_preview.jpg',
  },
},

It also sets og:url and twitter:url to the slug if one is available, using pageId as a fallback.

With this change I can get my proxied page properly indexed on search engines.

- Add support for article:author in meta tags
- Use Notion's Page Title without "| Notion" as fallback
- Only use siteDescription for root  page
- Only use siteImage for root page
@aaccioly
Copy link
Contributor Author

aaccioly commented Jul 9, 2024

@velsa, @DudeThatsErin would you mind having a look? It has neen working very well for me.

Copy link
Owner

@velsa velsa left a comment

Choose a reason for hiding this comment

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

Did small code refactor.

@velsa velsa merged commit c24bd16 into velsa:main Jul 10, 2024
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.

MetaRewriter is no longer correctly replacing title and description
2 participants