Skip to content

Open Graph and social meta tags #11

@engineervix

Description

@engineervix

Summary

Generate Open Graph and Twitter Card <meta> tags in <head> so pages render correctly when shared on social platforms.

Proposed output

<meta property="og:type"        content="article">
<meta property="og:title"       content="Getting Started — kwelea">
<meta property="og:description" content="Up and running in five minutes">
<meta property="og:url"         content="https://engineervix.github.io/kwelea/getting-started/">
<meta property="og:site_name"   content="kwelea">
<meta name="twitter:card"       content="summary">

Implementation notes

  • Data is already available: page.Title, page.Description, page.Path, site.Title, site.BaseURL
  • Requires base_url to be set for the og:url and og:image tags — omit those tags if absent
  • Optional: [site] og_image in config for a default social preview image URL
  • Optional: per-page image: frontmatter field to override the default
  • Render in layout.html <head>, only when base_url is set
  • Pairs well with sitemap.xml (issue Generate sitemap.xml at build time #4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestseoSearch engine optimisation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions