Skip to content

Commit

Permalink
github links
Browse files Browse the repository at this point in the history
  • Loading branch information
Robpol86 committed Sep 28, 2024
1 parent 8ed91cc commit ced51d8
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Sphinx configuration file."""

import os
import re
import time
from pathlib import Path
Expand All @@ -8,6 +9,9 @@

from robpol86_com import __license__, __version__ as version

GIT_BRANCH = os.environ.get("SPHINX_GITHUB_BRANCH", "") or os.environ.get("GITHUB_REF_NAME", None)
GIT_URL = f'https://github.com/{os.environ["GITHUB_REPOSITORY"]}' if os.environ.get("GITHUB_REPOSITORY", "") else None


# General configuration.
author = "Robpol86"
Expand All @@ -24,17 +28,17 @@
]
language = "en"
project = "Robpol86.com"
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}
pygments_style = "vs"
release = version
templates_path = ["_templates"]


# Options for HTML output.
html_baseurl = os.environ.get("SPHINX_HTML_BASEURL", "") or "http://localhost:8000/"
html_copy_source = False
html_domain_indices = False
html_favicon = "_static/favicon.ico"
html_logo = "_static/logo.png"
html_logo = "_static/logo.svg"
html_show_sourcelink = True
html_sidebars = {
"**": [
Expand All @@ -50,6 +54,14 @@
}
html_static_path = ["_static"]
html_theme = "sphinx_book_theme"
html_theme_options = {
"path_to_docs": "docs",
"repository_branch": GIT_BRANCH,
"repository_url": GIT_URL,
"use_download_button": False,
"use_edit_page_button": not not GIT_URL, # pylint: disable=unneeded-not
"use_fullscreen_button": False,
}
html_title = project
html_use_index = True

Expand Down Expand Up @@ -96,7 +108,7 @@
ablog_builder = "dirhtml"
ablog_website = "_website"
blog_title = "ABlog"
blog_baseurl = "https://ablog.readthedocs.io/"
blog_baseurl = html_baseurl
blog_locations = {
"Pittsburgh": ("Pittsburgh, PA", "https://en.wikipedia.org/wiki/Pittsburgh"),
"San Fran": ("San Francisco, CA", "https://en.wikipedia.org/wiki/San_Francisco"),
Expand Down Expand Up @@ -185,7 +197,6 @@ def setup(app):

"""
TODOs:
* verify summaries in /blog/category/todo.html
* Decide upon tags, categories, and locations for all my pages
* Remove placeholder pages
* Ensure post dates are accurrate
Expand Down

0 comments on commit ced51d8

Please sign in to comment.