Skip to content

Commit e7884f8

Browse files
authored
update: add og images and metadata to docs (#2248)
## Issue Link / Problem Description <!-- Link to related issue or describe the problem this PR solves --> - Docs preview sometimes shows random images. ## Changes Made <!-- Describe what you changed and why --> - Add og images and metadata - Page-specific titles, descriptions - Add db and twitter card tags.
1 parent b0d25d2 commit e7884f8

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

docs/extra/overrides/main.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
{% extends "base.html" %}
22

3+
{% block extrahead %}
4+
{{ super() }}
5+
<!-- Open Graph / Facebook -->
6+
<meta property="og:type" content="website">
7+
{% if page and page.canonical_url %}<meta property="og:url" content="{{ page.canonical_url }}">{% endif %}
8+
<meta property="og:title" content="{% if page and page.title %}{{ page.title }} - {{ config.site_name }}{% else %}{{ config.site_name }}{% endif %}">
9+
<meta property="og:description" content="{% if page and page.meta and page.meta.description %}{{ page.meta.description }}{% else %}{{ config.site_description }}{% endif %}">
10+
<meta property="og:image" content="{% if config.site_url %}{{ config.site_url }}{% endif %}{% if page and page.meta and page.meta.og_image %}{{ page.meta.og_image }}{% else %}_static/imgs/ragas-logo.png{% endif %}">
11+
<meta property="og:image:alt" content="Ragas - Evaluation framework for RAG pipelines">
12+
<meta property="og:site_name" content="{{ config.site_name }}">
13+
14+
<!-- Twitter -->
15+
<meta property="twitter:card" content="summary_large_image">
16+
{% if page and page.canonical_url %}<meta property="twitter:url" content="{{ page.canonical_url }}">{% endif %}
17+
<meta property="twitter:title" content="{% if page and page.title %}{{ page.title }} - {{ config.site_name }}{% else %}{{ config.site_name }}{% endif %}">
18+
<meta property="twitter:description" content="{% if page and page.meta and page.meta.description %}{{ page.meta.description }}{% else %}{{ config.site_description }}{% endif %}">
19+
<meta property="twitter:image" content="{% if config.site_url %}{{ config.site_url }}{% endif %}{% if page and page.meta and page.meta.og_image %}{{ page.meta.og_image }}{% else %}_static/imgs/ragas-logo.png{% endif %}">
20+
<meta property="twitter:site" content="@ragas_io">
21+
<meta property="twitter:creator" content="@ragas_io">
22+
23+
<!-- Additional SEO meta tags -->
24+
<meta name="description" content="{% if page and page.meta and page.meta.description %}{{ page.meta.description }}{% else %}{{ config.site_description }}{% endif %}">
25+
<meta name="keywords" content="{% if page and page.meta and page.meta.keywords %}{{ page.meta.keywords }}{% else %}RAG evaluation, LLM evaluation, retrieval augmented generation, AI evaluation, machine learning metrics{% endif %}">
26+
<meta name="author" content="Exploding Gradients">
27+
28+
<!-- Canonical URL -->
29+
{% if page and page.canonical_url %}
30+
<link rel="canonical" href="{{ page.canonical_url }}">
31+
{% endif %}
32+
{% endblock %}
33+
334
{% block announce %}
435
<!-- Add announcement here, including arbitrary HTML -->
536
<div class="announce">

mkdocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
site_name: Ragas
2+
site_description: Evaluation framework for your Retrieval Augmented Generation (RAG) pipelines
23
site_url: !ENV READTHEDOCS_CANONICAL_URL
34
repo_name: explodinggradients/ragas
45
repo_url: https://github.com/explodinggradients/ragas
@@ -245,6 +246,13 @@ extra:
245246
analytics:
246247
provider: google
247248
property: !ENV GOOGLE_ANALYTICS_KEY
249+
social:
250+
- icon: fontawesome/brands/github
251+
link: https://github.com/explodinggradients/ragas
252+
- icon: fontawesome/brands/x-twitter
253+
link: https://x.com/ragas_io
254+
- icon: fontawesome/brands/discord
255+
link: https://discord.gg/5qGUJ6mh7C
248256
plugins:
249257
- search
250258
- git-revision-date-localized:

0 commit comments

Comments
 (0)