Skip to content

Commit db91b0a

Browse files
Add the version to the docs homepage so a document bundle is self identifying without external framing.
1 parent edf05dc commit db91b0a

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

docs/custom_theme/home.html

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
<div class="md-grid md-typeset">
66
<div class="mdx-hero">
77
<div class="mdx-hero__content">
8-
<h1>Welcome to the {{ config.site_name }}</h1>
8+
<h1>
9+
Welcome to the {{ config.site_name }}
10+
<br/>
11+
<span class="h1_subtitle">Version {{ config.extra.planet_sdk_version }}</span>
12+
</h1>
913
<p>{{ config.site_description }}</p>
1014
<a href="./{{ 'get-started/quick-start-guide' | url }}" title="Get Started" class="md-button md-button--primary md-button--teriary">
1115
Get started
@@ -30,11 +34,11 @@ <h1>Welcome to the {{ config.site_name }}</h1>
3034
<div class="md-footer-right">
3135
powered by
3236
<a href="https://www.mkdocs.org" title="MkDocs">MkDocs</a>
33-
and
37+
and
3438
<a href="https://squidfunk.github.io/mkdocs-material/"
3539
title="Material for MkDocs">
3640
Material for MkDocs</a>
37-
</div>
41+
</div>
3842
</div>
3943
</footer>
4044
{% endblock %}

docs/hooks/mkdocs_hooks.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from planet import __version__ as _pl_sdk_version
2+
3+
def on_config(config):
4+
"""
5+
This is for injecting the package version into mkdocs
6+
config so it can be used in templates.
7+
"""
8+
config["extra"]["planet_sdk_version"] = _pl_sdk_version
9+
return config

docs/stylesheets/extra.css

+6-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ section.mdx-container::before{
4747
background-repeat: no-repeat;
4848
background-position: right 10% bottom 45%;
4949
background-size: auto;
50-
50+
5151
}
5252

5353

@@ -75,6 +75,10 @@ section.mdx-container::before{
7575
margin-right: 2.5vw;
7676
}
7777

78+
.h1_subtitle {
79+
font-size: smaller;
80+
}
81+
7882
@media screen and (min-width:76.25em){
7983
section.md-sidebar--primary{display:none}
8084
}
@@ -87,4 +91,4 @@ section.mdx-container::before{
8791

8892
.highlight .gp, .highlight .go { /* Generic.Prompt, Generic.Output */
8993
user-select: none;
90-
}
94+
}

mkdocs.yml

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ plugins:
6464
- planet
6565
- docs/custom_theme/
6666

67+
hooks:
68+
- docs/hooks/mkdocs_hooks.py
69+
6770
nav:
6871
- "Get Started":
6972
- get-started/quick-start-guide.md

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dynamic = ["version"]
3636
test = ["pytest==8.3.3", "anyio", "pytest-cov", "respx>=0.22.0"]
3737
lint = ["flake8", "mypy", "yapf==0.43.0"]
3838
docs = [
39-
"mkdocs==1.3",
39+
"mkdocs==1.4.2",
4040
"mkdocs-click==0.7.0",
4141
"mkdocs-material==8.2.11",
4242
"mkdocstrings==0.18.1",

0 commit comments

Comments
 (0)