diff --git a/docs/conf.py b/docs/conf.py index a32d735..1b93b9a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,10 +3,17 @@ from datetime import date +import setuptools_scm + # -- Project information ------------------------------------------------------ project = "docstub" -copyright = f"{date.today().year}, docstub contributors" + +version = setuptools_scm.get_version(search_parent_directories=True) +version = f"v{version}" +version = version.replace("+", "+") # Insert wrapping hint for long dev version + +copyright = f"{date.today().year} docstub contributors." templates_path = ["templates"] @@ -62,6 +69,7 @@ html_sidebars = { "**": [ "sidebar/brand.html", + "version.html", "sidebar/search.html", "sidebar/scroll-start.html", "sidebar/navigation.html", diff --git a/docs/static/furo_overrides.css b/docs/static/furo_overrides.css index 3a93e66..2d5dd17 100644 --- a/docs/static/furo_overrides.css +++ b/docs/static/furo_overrides.css @@ -8,6 +8,29 @@ article .align-default { margin-right: unset; } +/* Apply the same padding to the ad as other items in the sidebar */ .ethical-ad-padding { padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal); } + +/* Account for margin-bottom of a preceeding sidebar-tree's to keep spacing + between items consistent. */ +.sidebar-tree + .sidebar-tree { + margin-top: calc(var(--sidebar-tree-space-above) - var(--sidebar-item-spacing-vertical)); +} + +/* Style and align inserted version in sidebar. */ +.sidebar-version { + font-family: var(--font-stack--monospace); + font-size: var(--font-size--small); + color: var(--color-foreground-secondary); + padding-inline: var(--sidebar-item-spacing-horizontal); + padding-bottom: var(--sidebar-item-spacing-vertical) ; + margin-bottom: var(--sidebar-item-spacing-vertical); + overflow-wrap: break-word; +} +/* Remove bottom margin of brand so that version info is closer and better aligned. */ +.sidebar-brand-text { + margin-bottom: 0; + +} \ No newline at end of file diff --git a/docs/templates/ethical-ads.html b/docs/templates/ethical-ads.html index d484c3d..5c813f5 100644 --- a/docs/templates/ethical-ads.html +++ b/docs/templates/ethical-ads.html @@ -1,3 +1,5 @@ +{#- Indicate ad placement to Read the Docs. -#} + \ No newline at end of file diff --git a/docs/templates/external-links.html b/docs/templates/external-links.html index 54dd0ea..3e691b5 100644 --- a/docs/templates/external-links.html +++ b/docs/templates/external-links.html @@ -1,3 +1,5 @@ +{#- Insert external project links into the sidebar. -#} +