Skip to content

Add Open Graph meta tags and FAIR signposting to HTML templates#32

Draft
Copilot wants to merge 4 commits into
mainfrom
copilot/add-og-meta-tags
Draft

Add Open Graph meta tags and FAIR signposting to HTML templates#32
Copilot wants to merge 4 commits into
mainfrom
copilot/add-og-meta-tags

Conversation

Copilot AI commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

Social media platforms display plain URLs when RO-Crate pages are shared. This adds Open Graph meta tags and FAIR signposting to generate rich preview cards.

Changes

New metadata extraction utility (src/utils/metadata_extractor.py)

  • Parses ro-crate-metadata.json to extract title, description, URL, image, author, and date
  • Resolves author references from JSON-LD @id to Person entities
  • Returns sensible defaults for missing fields

Enhanced HTML templates

  • index.html, dataset_catalogue_index.html, overarching_index.html now include:
    • Open Graph tags: og:title, og:description, og:type, og:url, og:image
    • Twitter Card tags: twitter:card, twitter:title, twitter:description, twitter:image
    • FAIR signposting: rel="describedby", rel="alternate", rel="canonical"
    • Author and publication date metadata

Updated page builder (src/utils/gh_pages_builder.py)

  • Calls metadata extractor for each RO-Crate
  • Constructs page URLs from base_uri + rocrate_name
  • Passes extracted metadata to template kwargs
  • Handles missing/empty base_uri

Result

Before:

https://example.com/dataset

After:

┌────────────────────────────────┐
│  [Preview Image]               │
├────────────────────────────────┤
│  Marine Biodiversity Dataset   │
│  Comprehensive marine data...  │
│  👤 Dr. Jane Smith • 2023-06  │
└────────────────────────────────┘

Works on Facebook, LinkedIn, Twitter, Teams, Slack, Discord.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add og:xxx to header html</issue_title>
<issue_description>Adding og:xxx and other fair signposting data to the index html and subsequent lower level versions of the crate html.

This will make the preview widget on sites like fb, LinkedIn, teams etc more informative for the end-user</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai

coderabbitai Bot commented Oct 29, 2025

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 3 commits October 29, 2025 05:57
Co-authored-by: cedricdcc <30471340+cedricdcc@users.noreply.github.com>
Co-authored-by: cedricdcc <30471340+cedricdcc@users.noreply.github.com>
Co-authored-by: cedricdcc <30471340+cedricdcc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add og:xxx and signposting data to HTML header Add Open Graph meta tags and FAIR signposting to HTML templates Oct 29, 2025
Copilot AI requested a review from cedricdcc October 29, 2025 06:07
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 og:xxx to header html

2 participants