diff --git a/src/technote/config.py b/src/technote/config.py index 97db4ed..b6bc13d 100644 --- a/src/technote/config.py +++ b/src/technote/config.py @@ -644,6 +644,11 @@ def date_updated_iso(self) -> Optional[str]: else: return None + @property + def version(self) -> Optional[str]: + """The version, as a string if available.""" + return self.toml.technote.version + def set_content_title(self, title: str) -> None: """Set the title from the content nodes.""" self._content_title = title diff --git a/src/technote/theme/components/sidebar-version.html b/src/technote/theme/components/sidebar-version.html index eac103e..b366ec6 100644 --- a/src/technote/theme/components/sidebar-version.html +++ b/src/technote/theme/components/sidebar-version.html @@ -1,5 +1,15 @@
+

Version

+ + {% block version %} + {% if technote.version %} +

Version {{technote.version}}

+ {% endif %} + {% endblock version %} + + {% block date_updated %} {% if technote.date_updated_iso %} - +

Updated

{% endif %} + {% endblock date_updated %}
\ No newline at end of file