Skip to content

Commit

Permalink
docs: Only enable extension when running in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverRainZ committed Aug 15, 2022
1 parent 11863e2 commit ea2b556
Showing 1 changed file with 42 additions and 40 deletions.
82 changes: 42 additions & 40 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

# -- Enviroment information -----------------------------------------------------

CI = os.environ.get('CI') is not None

# -- General configuration ------------------------------------------------

Expand All @@ -34,7 +37,6 @@
extensions = [
'sphinx.ext.githubpages',
'sphinx.ext.intersphinx',
'sphinxnotes.strike',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -79,9 +81,6 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

Expand All @@ -95,10 +94,10 @@
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'repository_url': 'https://github.com/SrainApp/srain',
"use_repository_button": True,
"use_download_button": False,
"show_toc_level": 2,
'repository_url': 'https://github.com/SrainApp/srain',
"use_repository_button": True,
"use_download_button": False,
"show_toc_level": 2,
}

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down Expand Up @@ -200,34 +199,37 @@
'ghrepo': ('https://github.com/%s', '⛺'),
}

extensions.append('ablog')
blog_path = 'blog'
blog_title = project
blog_baseurl = baseurl
blog_authors = {
author: (author, blog_baseurl),
}
blog_languages = {
language: ('English', None),
}
blog_default_author = author
blog_default_language = language
post_auto_image = 1
blog_feed_fulltext = True
fontawesome_included = True
html_css_files.append('ablog-custom.css')

extensions.append('sphinxnotes.mock')
mock_directives = []
mock_directives.append('contents') # Theme has built-in local-toc, see html_theme

extensions.append('sphinx_sitemap')
sitemap_filename = "sitemap.xml"
sitemap_url_scheme = "{link}"

extensions.append('sphinxcontrib.gtagjs')
gtagjs_ids = ['G-6DC73T8933']

extensions.append('sphinxext.opengraph')
ogp_site_url = baseurl
ogp_site_name = project
if CI:
extensions.append('sphinxnotes.strike')

extensions.append('ablog')
blog_path = 'blog'
blog_title = project
blog_baseurl = baseurl
blog_authors = {
author: (author, blog_baseurl),
}
blog_languages = {
language: ('English', None),
}
blog_default_author = author
blog_default_language = language
post_auto_image = 1
blog_feed_fulltext = True
fontawesome_included = True
html_css_files.append('ablog-custom.css')

extensions.append('sphinxnotes.mock')
mock_directives = []
mock_directives.append('contents') # Theme has built-in local-toc, see html_theme

extensions.append('sphinx_sitemap')
sitemap_filename = "sitemap.xml"
sitemap_url_scheme = "{link}"

extensions.append('sphinxcontrib.gtagjs')
gtagjs_ids = ['G-6DC73T8933']

extensions.append('sphinxext.opengraph')
ogp_site_url = baseurl
ogp_site_name = project

0 comments on commit ea2b556

Please sign in to comment.