Skip to content

Commit

Permalink
docs: social cards and broken link fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Romain Bezut <[email protected]>
  • Loading branch information
morian committed Sep 29, 2024
1 parent fa8d296 commit 698125a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Participants must uphold the `code of conduct`_.
.. _issue: https://github.com/morian/aio-ld2410/issues/new
.. _pull request: https://github.com/morian/aio-ld2410/compare/
.. _start a discussion: https://github.com/morian/aio-ld2410/discussions
.. _code of conduct: https://github.com/python-websockets/websockets/blob/main/CODE_OF_CONDUCT.md
.. _code of conduct: https://github.com/morian/aio-ld2410/blob/master/CODE_OF_CONDUCT.md

``aio-ld2410`` is released under the `MIT license`_.

.. _MIT license: https://github.com/morian/aio-ld2410/blob/main/LICENSE
.. _MIT license: https://github.com/morian/aio-ld2410/blob/master/LICENSE
15 changes: 10 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
'sphinx_copybutton',
'sphinx_inline_tabs',
'sphinx_autodoc_typehints',
'sphinxext.opengraph',
]

templates_path = ['_templates']
Expand Down Expand Up @@ -80,8 +81,10 @@
# Define the canonical URL if you are using a custom domain on Read the Docs
html_baseurl = os.environ.get('READTHEDOCS_CANONICAL_URL', '')

ogp_site_url = 'https://aio-ld2410.readthedocs.io/en/latest/'

# Tell Jinja2 templates the build is running on Read the Docs
if os.environ.get('READTHEDOCS') == 'True' or True:
if os.environ.get('READTHEDOCS') == 'True':
if 'html_context' not in globals():
html_context = {}

Expand Down Expand Up @@ -114,7 +117,8 @@ def get_current_commit() -> str:


commit = get_current_commit()
code_url = f'https://github.com/morian/aio-ld2410/blob/{commit}'
# branch = get_current_branch()
repo_url = 'https://github.com/morian/aio-ld2410/'


def linkcode_resolve(domain, info):
Expand Down Expand Up @@ -148,7 +152,7 @@ def linkcode_resolve(domain, info):
return None

start, end = lines[1], lines[1] + len(lines[0]) - 1
return f'{code_url}/{file}#L{start}-L{end}'
return f'{repo_url}/blob/{commit}/{file}#L{start}-L{end}'


# -- Options for HTML output -------------------------------------------------
Expand All @@ -157,8 +161,8 @@ def linkcode_resolve(domain, info):
html_theme = 'furo'

html_theme_options = {
'source_repository': 'https://github.com/morian/aio-ld2410/',
'source_branch': 'master',
'source_repository': repo_url,
'source_branch': commit,
'source_directory': 'docs/',
'light_css_variables': {
'color-brand-primary': '#306998', # blue from logo
Expand All @@ -169,6 +173,7 @@ def linkcode_resolve(domain, info):
'color-brand-content': '#ffd43bd9', # yellow from logo, transparent like text
},
'sidebar_hide_name': True,
'top_of_page_buttons': ['view'],
}

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
furo==2024.8.6
sphinx==8.0.2
sphinx_autodoc_typehints==2.4.4
sphinx_inline_tabs==2023.4.21
sphinx_copybutton==0.5.2
sphinx_inline_tabs==2023.4.21
sphinxext_opengraph==0.9.1
typing_extensions==4.12.2

0 comments on commit 698125a

Please sign in to comment.