Skip to content

Commit

Permalink
build: update favicons and opengraph banner
Browse files Browse the repository at this point in the history
Signed-off-by: Akshay "XA" Mestry <[email protected]>
  • Loading branch information
xames3 committed Feb 16, 2024
1 parent 6e7e874 commit 8d71b6e
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Author: Akshay Mestry <[email protected]>
Created on: Wednesday, April 12 2023
Last updated on: Monday, February 12 2024
Last updated on: Friday, February 16 2024
This file contains the configuration settings for building the L.E.A.R.N
documentation using Sphinx, a popular Python documentation tool. Sphinx
Expand Down Expand Up @@ -49,6 +49,7 @@
import sys
import typing as t
import warnings
from datetime import date
from os import path as p

from docutils import nodes
Expand Down Expand Up @@ -80,6 +81,9 @@ def build_module() -> ModuleType:
return module


learn = build_module()


def load_extension(self, app: Sphinx, extname: str) -> None:
"""Monkey-patched ``SphinxComponentRegistry.load_extension``."""
if extname in app.extensions:
Expand All @@ -97,7 +101,7 @@ def load_extension(self, app: Sphinx, extname: str) -> None:
with prefixed_warnings(prefix):
try:
if extname == "sphinx.ext.learn":
mod = build_module()
mod = learn
else:
mod = import_module(extname)
except ImportError as err:
Expand Down Expand Up @@ -225,10 +229,10 @@ class LearnProject(t.NamedTuple):
# Project metadata
alt_title: str = "L.E.A.R.N"
author: str = "Akshay Mestry"
copyright: str = "2024, Akshay Mestry"
copyright: str = f"{date.today().year}, Akshay Mestry"
default_language: str = "en"
main_title: str = "Learning the Essence of AI, Research, and Notations"
release: str = build_module().__version__
release: str = learn.__version__
short_title: str = "Home"
theme: str = "sphinx_book_theme"
url: str = "https://github.com/xames3/learn"
Expand Down Expand Up @@ -286,22 +290,26 @@ class LearnProject(t.NamedTuple):
# The theme to use for HTML and HTML help pages along with page-wide
# settings.
favicons = [
"img/android-chrome-192x192.png",
"img/android-chrome-512x512.png",
"img/apple-touch-icon.png",
"img/favicon-16x16.png",
"img/favicon-16x16.png",
"img/favicon-32x32.png",
"img/favicon.ico",
]
html_context = {"default_mode": "light"}
html_show_sourcelink = False
html_theme = _project.theme
html_title = _project.short_title
html_theme_options = {
"article_header_end": ["search-button"],
"article_header_end": [],
"footer_center": ["theme-version"],
"footer_end": ["last-updated"],
"footer_start": ["copyright"],
"navigation_with_keys": True,
"repository_url": _project.url,
"secondary_sidebar_items": [],
"show_prev_next": False,
"footer_start": ["copyright"],
"footer_center": ["theme-version"],
"footer_end": ["last-updated"],
}
language = _project.default_language

Expand Down Expand Up @@ -358,11 +366,10 @@ class LearnProject(t.NamedTuple):
ogp_description_length = 300
ogp_enable_meta_description = True
ogp_image = (
"https://raw.githubusercontent.com/xames3/learn/"
"6473fd1f3a77992ab8d7b2988b9adcf6d26403c8/docs/"
"source/_static/img/learn-banner.png"
"https://raw.githubusercontent.com/xames3/learn/main/docs/"
"source/_static/assets/learn-opengraph-home-banner.png"
)
ogp_image_alt = _project.alt_title
ogp_image_alt = _project.alt_title + " Home Banner"
ogp_site_name = _project.alt_title
ogp_site_url = "https://learn.mes3.dev"
ogp_type = "website"
Expand Down

0 comments on commit 8d71b6e

Please sign in to comment.