Skip to content

Commit

Permalink
Update theme to be compatible with pst~=0.13 (#3)
Browse files Browse the repository at this point in the history
* Update version to match major.minor in pst

* Update publish action

* update edit_this_page to pst 0.13

* Update versions of dependencies

* update edit page button condition
  • Loading branch information
OriolAbril authored Mar 29, 2023
1 parent 2f7430f commit 8ddc57a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: "3.10"
- name: Install build dependencies
run: python -m pip install build
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.4
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create GitHub release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ classifiers = [
]
dynamic = ["version", "description"]
dependencies = [
"pydata-sphinx-theme>=0.12.0,<0.13",
"sphinx>=4,<6",
"docutils==0.17.1",
"pydata-sphinx-theme>=0.13.0,<0.14",
"sphinx>=5,<7",
]

[tool.flit.module]
Expand Down
2 changes: 1 addition & 1 deletion src/pymc_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A thin sphinx theme to customize pydata-sphinx-theme consistently cross PyMC websites."""

__version__ = "0.1"
__version__ = "0.13.0"

from pathlib import Path

Expand Down
18 changes: 13 additions & 5 deletions src/pymc_sphinx_theme/components/edit-this-page.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{% if sourcename is defined and page_source_suffix and "generated" not in sourcename %}
{% set src = sourcename.split('.') %}
<div class="tocsection editthispage">
<a href="{{ get_edit_url() }}">
<i class="fas fa-pencil-alt"></i> {{ _("Edit this page") }}
{% set src = sourcename.split('.') %}
<div class="tocsection editthispage">
<a href="{{ get_edit_provider_and_url()[1] }}">
<i class="fa-solid fa-pencil"></i>
{% set provider = get_edit_provider_and_url()[0] %}
{% block edit_this_page_text %}
{% if provider %}
{% trans provider=provider %}Edit on {{ provider }}{% endtrans %}
{% else %}
{% trans %}Edit{% endtrans %}
{% endif %}
{% endblock %}
</a>
</div>
</div>
{% endif %}

0 comments on commit 8ddc57a

Please sign in to comment.