diff --git a/doc/changelog.d/1443.added.md b/doc/changelog.d/1443.added.md new file mode 100644 index 0000000000..7f32787356 --- /dev/null +++ b/doc/changelog.d/1443.added.md @@ -0,0 +1 @@ +Add secondary sidebar diff --git a/doc/source/_templates/latest_news_sidebar.html b/doc/source/_templates/latest_news_sidebar.html new file mode 100644 index 0000000000..64f4621eb5 --- /dev/null +++ b/doc/source/_templates/latest_news_sidebar.html @@ -0,0 +1,187 @@ +{# + Latest News Sidebar + Displays a box with latest news items in the sidebar if configured. + Supports both internal links and external URLs. + Optimized to work without external CSS files. +#} +{% if latest_news %} + {% set latest_news_config = latest_news %} + {% set latest_news_title = latest_news_config.get('title', 'Latest News') %} + {% set latest_news_items = latest_news_config.get('items', []) %} + {% set latest_news_show_date = latest_news_config.get('show_date', true) %} + {% set latest_news_max_items = latest_news_config.get('max_items', 5) %} + +
+{% endif %} \ No newline at end of file diff --git a/doc/source/_templates/layout.html b/doc/source/_templates/layout.html index afaf8cbb92..1555c6872d 100644 --- a/doc/source/_templates/layout.html +++ b/doc/source/_templates/layout.html @@ -3,4 +3,4 @@ {%- block extrahead %} {{ super() }} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/doc/source/conf.py b/doc/source/conf.py index 48585f2a85..cd50dfa808 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -213,6 +213,39 @@ "github_version": "main", "doc_path": "doc/source", "pyansys_tags": ["Structures"], + "latest_news": { + "title": "Latest News & related articles", + "show_date": True, + "max_items": 5, + "items": [ + { + "title": "[Video] PyMechanical Tutorial", + "date": "2024-12-15", + "url": "https://www.youtube.com/watch?v=9OZckJ36DFM", + "excerpt": "Watch this video tutorial to learn PyMechanical basics and workflows.", + }, + { + "title": "[News] Mechanical 26R1 is Released", + "date": "2024-12-15", + "url": "https://github.com/ansys/pymechanical/releases/tag/v0.11.0", + "excerpt": "Download new Ansys Mechanical 26R1", + }, + { + "title": "[Blog] Getting Started with PyMechanical", + "date": "2024-11-20", + "url": "https://blog.ozeninc.com/resources/getting-started-with-pyansys-a-pymechanical-workflow-for-beginners", + "excerpt": "Learn the basics of PyMechanical with this beginner-friendly workflow guide.", + }, + { + "title": "[Blog] First Steps with PyAnsys Using an End-to-End Example", + "date": "2024-11-15", + "url": "https://blog.cadfem.net/en/first-steps-with-pyansys-using-an-end-to-end-example", + "excerpt": "Explore PyAnsys through a comprehensive end-to-end example.", + }, + ], + "more_url": "https://github.com/ansys/pymechanical/releases", + "more_text": "View all releases", + }, } html_theme_options = { "logo": "pyansys", @@ -242,6 +275,9 @@ "changelog_file_name": "changelog.rst", "sidebar_pages": ["changelog", "index"], }, + "secondary_sidebar_items": { + "index": ["latest_news_sidebar"], + }, "ansys_sphinx_theme_autoapi": {"project": project, "templates": "_templates/autoapi"}, }