Skip to content

Commit 28dac1b

Browse files
committed
add theme & https://ogp.me metadata
- fixes #63 - fixes #12 - work-around for executablebooks/sphinx-book-theme#182
1 parent fab340a commit 28dac1b

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

_config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ sphinx:
9898
badges: .
9999
committers: .
100100
bibliography: .
101+
prem_theme: .
101102
config:
103+
html_theme: prem_theme
102104
myst_heading_anchors: 4
103105
html_js_files:
104106
- [https://analytics.prem.ninja/js/script.js, {defer: defer, data-domain: book.premai.io}]

prem_theme/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from os import path
2+
3+
def setup(app):
4+
app.add_html_theme('prem_theme', path.abspath(path.dirname(__file__)))

prem_theme/layout.html

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% extends "sphinx_book_theme/layout.html" %}
2+
{% block extrahead %}
3+
<meta property="og:site_name" content="The State of Open Source AI" />
4+
<meta property="og:title" content="{{ title }}" />
5+
<meta property="og:type" content="book" />
6+
<meta property="og:image" content="https://static.premai.io/book/book-cover.jpg" />
7+
<meta property="og:url" content="https://book.premai.io/state-of-open-source-ai/{{ '' if pagename == 'index' else pagename }}" />
8+
<meta property="og:description" content="Clarity in the current fast-paced mess of Open Source innovation" />
9+
<meta property="og:locale" content="en_GB" />
10+
<meta property="og:book:author" content="Prem" />
11+
{%- if last_updated %}
12+
<meta property="og:book:release_date" content="{{ last_updated }}" />
13+
{%- endif %}
14+
<meta property="og:book:tag" content="open-source" />
15+
<meta property="og:book:tag" content="AI" />
16+
<meta property="og:book:tag" content="book" />
17+
<meta property="og:book:tag" content="ML" />
18+
<meta property="og:book:tag" content="MLOps" />
19+
<meta property="og:book:tag" content="Jupyter-Book" />
20+
{{ super() }}
21+
{% endblock extrahead %}

prem_theme/theme.conf

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[theme]
2+
inherit = sphinx_book_theme

0 commit comments

Comments
 (0)