From ad5665a42ef1459b4c0efb9d7bde76c767466a44 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Wed, 5 Jun 2024 12:35:27 -0700 Subject: [PATCH 1/5] metadata for parallel_read_safe --- src/ablog/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ablog/__init__.py b/src/ablog/__init__.py index e6c295e4..dd6a5a3f 100755 --- a/src/ablog/__init__.py +++ b/src/ablog/__init__.py @@ -164,4 +164,4 @@ def setup(app): pkgdir = os.path.abspath(os.path.dirname(__file__)) locale_dir = os.path.join(pkgdir, "locales") app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir) - return {"version": __version__} # identifies the version of our extension + return {"version": __version__, "parallel_read_safe": True} \ No newline at end of file From e79df4f658603d309f76490ee077ae7a40f8eebd Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Thu, 8 Aug 2024 14:41:38 -0700 Subject: [PATCH 2/5] release notes --- .pre-commit-config.yaml | 4 ++-- docs/release/ablog-v0.11-released.rst | 10 ++++++++++ src/ablog/__init__.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e316179a..71a5b19e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks @@ -26,7 +26,7 @@ repos: - id: check-yaml - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.4.2' + rev: 'v0.5.7' hooks: - id: ruff args: ['--fix'] diff --git a/docs/release/ablog-v0.11-released.rst b/docs/release/ablog-v0.11-released.rst index 7935a927..bd73f55f 100644 --- a/docs/release/ablog-v0.11-released.rst +++ b/docs/release/ablog-v0.11-released.rst @@ -95,3 +95,13 @@ ABlog v0.11.9 released ---------------------- `Make '_strip' function return as list not set. `__ from `Joe Ziminski `__. + +ABlog v0.11.10 released +----------------------- + +Fixed wrong branch in the release process. + +ABlog v0.11.11 released +----------------------- + +Mark Ablog parallel safe. \ No newline at end of file diff --git a/src/ablog/__init__.py b/src/ablog/__init__.py index dd6a5a3f..1fd29ad6 100755 --- a/src/ablog/__init__.py +++ b/src/ablog/__init__.py @@ -164,4 +164,4 @@ def setup(app): pkgdir = os.path.abspath(os.path.dirname(__file__)) locale_dir = os.path.join(pkgdir, "locales") app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir) - return {"version": __version__, "parallel_read_safe": True} \ No newline at end of file + return {"version": __version__, "parallel_read_safe": True} From c8f753d88249e27bf15ea08fc6f3a65f2076f7d7 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Thu, 8 Aug 2024 15:01:44 -0700 Subject: [PATCH 3/5] Changes --- .codecov.yaml | 8 + .github/workflows/ci.yml | 61 ++--- .github/workflows/pythonpublish.yml | 32 +-- .gitignore | 39 +--- .pre-commit-config.yaml | 81 ++++--- .readthedocs.yml | 12 +- .rtd-environment.yml | 2 +- .stylelintrc.json | 2 +- Makefile | 12 +- README.rst | 10 +- ablog-conda-test-env.yml | 5 +- docs/index.rst | 2 +- docs/manual/ablog-commands.rst | 2 +- docs/manual/markdown.md | 6 +- docs/manual/notebook_support.ipynb | 2 +- docs/release/ablog-v0.10-released.rst | 2 +- docs/release/ablog-v0.11-released.rst | 3 +- pyproject.toml | 11 +- roots/test-build/conf.py | 4 +- roots/test-canonical/conf.py | 4 +- roots/test-external/conf.py | 4 +- setup.cfg | 4 +- src/ablog/commands.py | 2 +- src/ablog/templates/ablog/archives.html | 22 +- src/ablog/templates/ablog/authors.html | 18 +- src/ablog/templates/ablog/catalog.html | 33 +-- src/ablog/templates/ablog/categories.html | 22 +- src/ablog/templates/ablog/collection.html | 58 ++--- src/ablog/templates/ablog/languages.html | 20 +- src/ablog/templates/ablog/locations.html | 22 +- src/ablog/templates/ablog/postcard.html | 39 ++-- src/ablog/templates/ablog/postcard2.html | 250 ++++++++------------ src/ablog/templates/ablog/postnavy.html | 17 +- src/ablog/templates/ablog/recentposts.html | 26 +-- src/ablog/templates/ablog/redirect.html | 16 +- src/ablog/templates/ablog/tagcloud.html | 24 +- src/ablog/templates/archives.html | 26 +-- src/ablog/templates/authors.html | 22 +- src/ablog/templates/catalog.html | 62 +++-- src/ablog/templates/categories.html | 26 +-- src/ablog/templates/collection.html | 62 ++--- src/ablog/templates/languages.html | 24 +- src/ablog/templates/locations.html | 26 +-- src/ablog/templates/page.html | 32 ++- src/ablog/templates/postcard.html | 43 ++-- src/ablog/templates/postcard2.html | 253 ++++++++------------- src/ablog/templates/postnavy.html | 20 +- src/ablog/templates/recentposts.html | 30 +-- src/ablog/templates/redirect.html | 19 +- src/ablog/templates/tagcloud.html | 28 +-- tox.ini | 29 +-- 51 files changed, 675 insertions(+), 904 deletions(-) create mode 100644 .codecov.yaml diff --git a/.codecov.yaml b/.codecov.yaml new file mode 100644 index 00000000..12e27d05 --- /dev/null +++ b/.codecov.yaml @@ -0,0 +1,8 @@ +codecov: + token: a0dfd87f-8eb9-4a41-9e4e-a06919f216cd +comment: off +coverage: + status: + project: + default: + threshold: 0.2% diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2423841d..578d4a8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,23 +3,23 @@ name: CI on: push: branches: - - 'main' - - '*.*' - - '!*backport*' + - "main" + - "*.*" + - "!*backport*" tags: - - 'v*' - - '!*dev*' - - '!*pre*' - - '!*post*' + - "v*" + - "!*dev*" + - "!*pre*" + - "!*post*" pull_request: workflow_dispatch: schedule: - # ┌───────── minute (0 - 59) - # │ ┌───────── hour (0 - 23) - # │ │ ┌───────── day of the month (1 - 31) - # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) - - cron: '0 7 * * *' # Every day at 07:00 UTC + # ┌───────── minute (0 - 59) + # │ ┌───────── hour (0 - 23) + # │ │ ┌───────── day of the month (1 - 31) + # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) + - cron: "0 7 * * *" # Every day at 07:00 UTC concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -36,7 +36,7 @@ jobs: - pandoc - graphviz envs: | - - linux: py312-sphinx7 + - linux: py312-sphinx8 secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -57,17 +57,18 @@ jobs: - pandoc - graphviz envs: | - - linux: py311-sphinx6 - - macos: py310-sphinx5 - - windows: py39-sphinx5 + - macos: py311-sphinx7 + - windows: py310-sphinx7 + - linux: py310-sphinx6 + - linux: py312-pydata-sphinx-theme + - linux: py312-devdeps secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - docs: - needs: [core] + extras: + needs: [tests] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: - default_python: '3.9' submodules: false pytest: false libraries: | @@ -76,9 +77,11 @@ jobs: - graphviz envs: | - linux: py312-docs + - linux: pydata-sphinx-theme-dev + - linux: py312-linkcheck conda: - needs: [core] + needs: [tests] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -100,19 +103,3 @@ jobs: conda list pytest -vvv -r a --pyargs ablog make tests - - extras: - needs: [tests] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main - with: - default_python: '3.9' - submodules: false - coverage: codecov - libraries: | - apt: - - pandoc - - graphviz - envs: | - - linux: py312-sphinxdev - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 26518b6c..1458db42 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -8,19 +8,19 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -U --user --force-reinstall pep517 setuptools_scm twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - python -m pep517.build --binary --source --out-dir wheelhouse . - python -m twine upload --skip-existing wheelhouse/* + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -U --user --force-reinstall pep517 setuptools_scm twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + python -m pep517.build --binary --source --out-dir wheelhouse . + python -m twine upload --skip-existing wheelhouse/* diff --git a/.gitignore b/.gitignore index 0bcd7e3b..ff1e26e3 100644 --- a/.gitignore +++ b/.gitignore @@ -63,9 +63,6 @@ instance/ # Scrapy stuff: .scrapy -# Sphinx documentation -docs/_build/ - # PyBuilder target/ @@ -138,24 +135,10 @@ Icon ### MacOS: https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd -.Spotlight-V100 .TemporaryItems -.Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent @@ -195,29 +178,14 @@ $RECYCLE.BIN/ ### VScode: https://raw.githubusercontent.com/github/gitignore/master/Global/VisualStudioCode.gitignore .vscode/* -### Extra Python Items and SunPy Specific -.hypothesis -.pytest_cache -sunpydata.sqlite -sunpydata.sqlite-journal -sunpy/_compiler.c -sunpy/cython_version.py -docs/_build -docs/generated -docs/api/ -docs/whatsnew/latest_changelog.txt -examples/**/*.asdf -# This is incase you run the figure tests -figure_test_images* -tags - ### Pycharm(?) .idea -# Release script +# Ablog .github_cache - +src/ablog/version.py docs/_build/ +docs/api/ docs/.doctrees/ docs/_website/ docs/_latex/ @@ -226,5 +194,4 @@ test/ .history/ pydata-sphinx-theme/ _build -_version.py demo/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 71a5b19e..8b959bc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,47 +1,54 @@ ci: - autofix_prs: false - autoupdate_schedule: "quarterly" + autofix_prs: false + autoupdate_schedule: "quarterly" repos: -- repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 + - repo: https://github.com/PyCQA/docformatter + rev: v1.7.5 hooks: - - id: autoflake - args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] -- repo: https://github.com/PyCQA/isort - rev: 5.13.2 + - id: docformatter + args: ["--in-place", "--pre-summary-newline", "--make-summary-multi"] + - repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 hooks: - - id: isort -- repo: https://github.com/psf/black - rev: 24.8.0 + - id: autoflake + args: + [ + "--in-place", + "--remove-all-unused-imports", + "--remove-unused-variable", + ] + exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.5.0" hooks: - - id: black -- repo: https://github.com/pre-commit/pre-commit-hooks + - id: ruff + args: ["--fix", "--unsafe-fixes"] + - id: ruff-format + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: - - id: check-ast - - id: check-case-conflict - - id: trailing-whitespace - - id: mixed-line-ending - - id: end-of-file-fixer - - id: check-yaml - - id: debug-statements -- repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.5.7' + - id: check-ast + - id: check-case-conflict + - id: trailing-whitespace + exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" + - id: mixed-line-ending + exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" + - id: end-of-file-fixer + exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" + - id: check-yaml + - id: debug-statements + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 hooks: - - id: ruff - args: ['--fix'] -- repo: https://github.com/awebdeveloper/pre-commit-stylelint - rev: '0.0.2' + - id: codespell + additional_dependencies: + - tomli + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.3.3 hooks: - - id: stylelint - additional_dependencies: ['stylelint@14.9.1', 'stylelint-config-standard@26.0.0'] -- repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 + - id: prettier + - repo: https://github.com/Riverside-Healthcare/djLint + rev: v1.34.1 hooks: - - id: prettier - types_or: [css, scss, javascript] -- repo: https://github.com/Riverside-Healthcare/djLint - rev: v1.34.1 - hooks: - - id: djlint-jinja - types_or: ["html"] + - id: djlint-jinja + types_or: ["html"] diff --git a/.readthedocs.yml b/.readthedocs.yml index 358072f1..ba5a3a3c 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,8 +1,8 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-lts-latest tools: - python: "mambaforge-4.10" + python: "mambaforge-latest" jobs: pre_install: - git update-index --assume-unchanged .rtd-environment.yml docs/conf.py @@ -13,9 +13,9 @@ sphinx: configuration: docs/conf.py fail_on_warning: false python: - install: - - method: pip - extra_requirements: + install: + - method: pip + extra_requirements: - all - docs - path: . + path: . diff --git a/.rtd-environment.yml b/.rtd-environment.yml index 4d3fa42e..f2c4dd23 100644 --- a/.rtd-environment.yml +++ b/.rtd-environment.yml @@ -2,7 +2,7 @@ name: rtd_ablog channels: - conda-forge dependencies: - - python=3.10 + - python=3.12 - pip - graphviz - make diff --git a/.stylelintrc.json b/.stylelintrc.json index 7cad7a12..40db42c6 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,3 +1,3 @@ { - "extends": "stylelint-config-standard" + "extends": "stylelint-config-standard" } diff --git a/Makefile b/Makefile index fc86bab1..b8ddd5f0 100644 --- a/Makefile +++ b/Makefile @@ -8,21 +8,21 @@ rebuild: cd docs; watchmedo shell-command --patterns='*.rst' --command='ablog build' --recursive test: - set -e; cd docs; ablog build -T -W; git clean -xfd; cd .. + set -e; cd docs; git clean -xfd; ablog build -T -W; git clean -xfd; cd .. test1: - set -e; cd docs; ablog build -T -W -b json; git clean -xfd; cd .. + set -e; cd docs; git clean -xfd; ablog build -T -W -b json; git clean -xfd; cd .. test2: - set -e; cd docs; ablog build -T -W -b pickle; git clean -xfd; cd .. + set -e; cd docs; git clean -xfd; ablog build -T -W -b pickle; git clean -xfd; cd .. test3: - set -e; mkdir -p test; cd test; printf "\nABlog\nABlog Team\nhttps://ablog.readthedocs.io/" | ablog start; ablog build -W; cd ..; rm -rf test + set -e; mkdir -p test; cd test; git clean -xfd; printf "\nABlog\nABlog Team\nhttps://ablog.readthedocs.io/" | ablog start; ablog build -W; cd ..; rm -rf test test4: - set -e; mkdir -p testablog; cd testablog; printf "\nABlog\nABlog Team\nhttps://ablog.readthedocs.io/" | ablog start; ablog build -W; cd ..; rm -rf testablog + set -e; mkdir -p testablog; cd testablog; git clean -xfd; printf "\nABlog\nABlog Team\nhttps://ablog.readthedocs.io/" | ablog start; ablog build -W; cd ..; rm -rf testablog test5: - set -e; cd docs; ablog build -W -b latex -T -d .doctrees -w _latex; git clean -xfd; cd .. + set -e; cd docs; git clean -xfd; ablog build -W -b latex -T -d .doctrees -w _latex; git clean -xfd; cd .. tests: test test1 test2 test3 test4 test5 diff --git a/README.rst b/README.rst index bbd63a41..34953258 100644 --- a/README.rst +++ b/README.rst @@ -1,10 +1,8 @@ ABlog for Sphinx ================ -|Build Status| - -.. |Build Status| image:: https://dev.azure.com/sunpy/ablog/_apis/build/status/sunpy.ablog?repoName=sunpy%2Fablog&branchName=main - :target: https://dev.azure.com/sunpy/ablog/_build/latest?definitionId=17&repoName=sunpy%2Fablog&branchName=main +[![CI](https://github.com/sunpy/ablog/actions/workflows/ci.yml/badge.svg)](https://github.com/sunpy/ablog/actions/workflows/ci.yml) +[![Upload Python Package](https://github.com/sunpy/ablog/actions/workflows/pythonpublish.yml/badge.svg)](https://github.com/sunpy/ablog/actions/workflows/pythonpublish.yml) ABlog is a Sphinx extension that converts any documentation or personal website project into a full-fledged blog @@ -19,6 +17,6 @@ The original project is no longer maintained and the `SunPy Project `__. -`Fix typo in "extennsion" `__. +`Fix typo `__. `Catalan translation `__. `Fix ablog post `__. diff --git a/docs/release/ablog-v0.11-released.rst b/docs/release/ablog-v0.11-released.rst index bd73f55f..95e113ef 100644 --- a/docs/release/ablog-v0.11-released.rst +++ b/docs/release/ablog-v0.11-released.rst @@ -104,4 +104,5 @@ Fixed wrong branch in the release process. ABlog v0.11.11 released ----------------------- -Mark Ablog parallel safe. \ No newline at end of file +Mark Ablog parallel safe. +Dropped support for Python 3.9, Sphinx less than 6.2. diff --git a/pyproject.toml b/pyproject.toml index 0114f87f..2271d482 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ exclude = ''' | ah_bootstrap.py ) ''' -target-version = ['py39'] +target-version = ['py310'] [tool.ruff] # Enable Pyflakes `E` and `F` codes by default. @@ -51,7 +51,14 @@ exclude = [ # Same as Black. line-length = 120 -target-version = "py39" +target-version = "py310" # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.codespell] +skip = "*cache*,*egg*,*extern*,.git,.idea,.tox,*.svg,.history,*sphinx.po" +ignore-words-list = "THIRDPARTY," + +[tool.djlint] +files=["*.html"] diff --git a/roots/test-build/conf.py b/roots/test-build/conf.py index 8633f6bf..a375b9ab 100644 --- a/roots/test-build/conf.py +++ b/roots/test-build/conf.py @@ -11,8 +11,6 @@ # Create content text suitable posting to micro-bogging "social": { # Format tags as hashtags and append to the content - "content": "{{ title }}{% for tag in post.tags %}" - " #{{ tag.name|trim()|replace(' ', '') }}" - "{% endfor %}", + "content": "{{ title }}{% for tag in post.tags %}" " #{{ tag.name|trim()|replace(' ', '') }}" "{% endfor %}", }, } diff --git a/roots/test-canonical/conf.py b/roots/test-canonical/conf.py index 781e7747..a515a6ea 100644 --- a/roots/test-canonical/conf.py +++ b/roots/test-canonical/conf.py @@ -11,9 +11,7 @@ # Create content text suitable posting to micro-bogging "social": { # Format tags as hashtags and append to the content - "content": "{{ title }}{% for tag in post.tags %}" - " #{{ tag.name|trim()|replace(' ', '') }}" - "{% endfor %}", + "content": "{{ title }}{% for tag in post.tags %}" " #{{ tag.name|trim()|replace(' ', '') }}" "{% endfor %}", }, } # Sphinx creates canonical links pointing to this base URL by default diff --git a/roots/test-external/conf.py b/roots/test-external/conf.py index 8633f6bf..a375b9ab 100644 --- a/roots/test-external/conf.py +++ b/roots/test-external/conf.py @@ -11,8 +11,6 @@ # Create content text suitable posting to micro-bogging "social": { # Format tags as hashtags and append to the content - "content": "{{ title }}{% for tag in post.tags %}" - " #{{ tag.name|trim()|replace(' ', '') }}" - "{% endfor %}", + "content": "{{ title }}{% for tag in post.tags %}" " #{{ tag.name|trim()|replace(' ', '') }}" "{% endfor %}", }, } diff --git a/setup.cfg b/setup.cfg index 32ccaa93..bf036090 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,7 +11,7 @@ edit_on_github = True github_project = sunpy/ablog [options] -python_requires = >=3.9 +python_requires = >=3.10 package_dir= =src packages=find: @@ -24,7 +24,7 @@ install_requires = invoke>=1.6.0 packaging>=19.0 python-dateutil>=2.8.2 - sphinx>=5.0.0 + sphinx>=6.2.0 watchdog>=2.1.0 [options.packages.find] diff --git a/src/ablog/commands.py b/src/ablog/commands.py index 43e7e808..cabb942b 100644 --- a/src/ablog/commands.py +++ b/src/ablog/commands.py @@ -358,7 +358,7 @@ def ablog_post(filename, title=None, **kwargs): dest="push_force", action="store_true", default=False, - help="owerwrite last commit, i.e. `commit --amend; push -f`", + help="overwrite last commit, i.e. `commit --amend; push -f`", ) @arg("-m", dest="message", type=str, help="commit message") @arg("-g", dest="github_pages", type=str, help="GitHub username for deploying to GitHub pages") diff --git a/src/ablog/templates/ablog/archives.html b/src/ablog/templates/ablog/archives.html index d846d137..bfce363b 100644 --- a/src/ablog/templates/ablog/archives.html +++ b/src/ablog/templates/ablog/archives.html @@ -1,16 +1,14 @@ {% if ablog.archive %}
-

- {{ gettext('Archives') }} -

- +

+ {{ gettext('Archives') }} +

+
{% endif %} diff --git a/src/ablog/templates/ablog/authors.html b/src/ablog/templates/ablog/authors.html index fbf0bf5a..76b73682 100644 --- a/src/ablog/templates/ablog/authors.html +++ b/src/ablog/templates/ablog/authors.html @@ -1,12 +1,14 @@ {% if ablog.author %}
-

{{ gettext('Authors') }}

- +

+ {{ gettext('Authors') }} +

+
{% endif %} diff --git a/src/ablog/templates/ablog/catalog.html b/src/ablog/templates/ablog/catalog.html index 7aa0c703..5f746a01 100644 --- a/src/ablog/templates/ablog/catalog.html +++ b/src/ablog/templates/ablog/catalog.html @@ -1,19 +1,13 @@ -{%- extends "page.html" %} -{% macro postlink(post) -%} - {% if post.external_link -%} - {{- post.external_link -}} - {% else %} - {{- pathto(post.docname) }}{{ anchor(post) -}} - {%- endif %} -{%- endmacro %} -{% block body %} -{% for collection in catalog %} -{% if collection %} +{%- extends "page.html" %} {% macro postlink(post) -%} {% if post.external_link +-%} {{- post.external_link -}} {% else %} {{- pathto(post.docname) }}{{ +anchor(post) -}} {%- endif %} {%- endmacro %} {% block body %} {% for collection +in catalog %} {% if collection %}

- {{ header }} - {{ collection }} - + {{ header }} + {{ collection }} +

{% for post in collection %}
@@ -22,15 +16,10 @@

{{ post.date.strftime(ablog.post_date_format) }} {% else %} Draft - {% endif %} - - - {{ post.title }} + {% endif %} - + {{ post.title }}

{% endfor %}
-{% endif %} -{% endfor %} -{% endblock body %} +{% endif %} {% endfor %} {% endblock body %} diff --git a/src/ablog/templates/ablog/categories.html b/src/ablog/templates/ablog/categories.html index 5396b0a4..08016df7 100644 --- a/src/ablog/templates/ablog/categories.html +++ b/src/ablog/templates/ablog/categories.html @@ -1,16 +1,14 @@ {% if ablog.category %}
-

- {{ gettext('Categories') }} -

- +

+ {{ gettext('Categories') }} +

+
{% endif %} diff --git a/src/ablog/templates/ablog/collection.html b/src/ablog/templates/ablog/collection.html index f089604a..6e1bf1a0 100644 --- a/src/ablog/templates/ablog/collection.html +++ b/src/ablog/templates/ablog/collection.html @@ -1,71 +1,57 @@ -{%- extends "page.html" %} -{% block body %} -{% macro postlink(post) -%} - {% if post.external_link -%} - {{- post.external_link -}} - {% else %} - {{- pathto(post.docname) }}{{ anchor(post) -}} - {%- endif %} -{%- endmacro %} +{%- extends "page.html" %} {% block body %} {% macro postlink(post) -%} {% if +post.external_link -%} {{- post.external_link -}} {% else %} {{- +pathto(post.docname) }}{{ anchor(post) -}} {%- endif %} {%- endmacro %}

{% if archive_feed and fa %} - - {% endif %} - {{ header }} - {% if collection.href %} - {{ collection }} - {% else %} - {{ collection }} + {% endif %} - + {{ header }} {% if collection.href %} + {{ collection }} + {% else %} {{ collection }} {% endif %} +

- {% if ablog.blog_archive_titles %} - {% for post in collection %} + {% if ablog.blog_archive_titles %} {% for post in collection %}

{% if post.published %} {{ post.date.strftime(ablog.post_date_format) }} {% else %} Draft - {% endif %} - - + {% endif %} - {{ post.title }}

- {% endfor %} - {% else %} - {% for post in collection %} + {% endfor %} {% else %} {% for post in collection %}

{{ post.title }}

  • - {% if post.published %} - {% if fa %} + {% if post.published %} {% if fa %} {% endif %} {{ post.date.strftime(ablog.post_date_format) }} - {% else %} - {% if fa %} + {% else %} {% if fa %} - {% endif %} - {% if post.date %} + {% endif %} {% if post.date %} {{ post.date.strftime(ablog.post_date_format) }} {% else %} Draft - {% endif %} - {% endif %} + {% endif %} {% endif %}
  • {% include "ablog/postcard2.html" %}
{{ post.to_html(collection.docname) }} -

{{ _("Read more ...") }}

-
+

+ {{ _("Read more ...") }} +

+
- {% endfor %} - {% endif %} + {% endfor %} {% endif %}
{% endblock body %} diff --git a/src/ablog/templates/ablog/languages.html b/src/ablog/templates/ablog/languages.html index ee5c5cef..69f6b0b3 100644 --- a/src/ablog/templates/ablog/languages.html +++ b/src/ablog/templates/ablog/languages.html @@ -1,14 +1,14 @@ {% if ablog.language %}
-

- {{ gettext('Languages') }} -

- +

+ {{ gettext('Languages') }} +

+
{% endif %} diff --git a/src/ablog/templates/ablog/locations.html b/src/ablog/templates/ablog/locations.html index ad7ba184..2ea6b054 100644 --- a/src/ablog/templates/ablog/locations.html +++ b/src/ablog/templates/ablog/locations.html @@ -1,16 +1,14 @@ {% if ablog.location %}
-

- {{ gettext('Locations') }} -

- +

+ {{ gettext('Locations') }} +

+
{% endif %} diff --git a/src/ablog/templates/ablog/postcard.html b/src/ablog/templates/ablog/postcard.html index 56d5650e..cc8eb538 100644 --- a/src/ablog/templates/ablog/postcard.html +++ b/src/ablog/templates/ablog/postcard.html @@ -1,26 +1,21 @@ {% if pagename in ablog %}
-{% set fa = ablog.fontawesome %} -{% set post = ablog[pagename] %} -

- {% if post.published %} - {% if fa %} - - {% endif %} - {{ post.date.strftime(ablog.post_date_format) }} - {% else %} - {% if fa %} - - {% endif %} - {% if post.date %} - {{ post.date.strftime(ablog.post_date_format) }} - {% else %} - Draft - {% endif %} - {% endif %} -

-
    - {% include "ablog/postcard2.html" %} -
+ {% set fa = ablog.fontawesome %} {% set post = ablog[pagename] %} +

+ {% if post.published %} {% if fa %} + + {% endif %} + {{ post.date.strftime(ablog.post_date_format) }} + {% else %} {% if fa %} + + {% endif %} {% if post.date %} + {{ post.date.strftime(ablog.post_date_format) }} + {% else %} + Draft + {% endif %} {% endif %} +

+
    + {% include "ablog/postcard2.html" %} +
{% endif %} diff --git a/src/ablog/templates/ablog/postcard2.html b/src/ablog/templates/ablog/postcard2.html index 9c35461d..16a8337d 100644 --- a/src/ablog/templates/ablog/postcard2.html +++ b/src/ablog/templates/ablog/postcard2.html @@ -1,165 +1,105 @@
-{% if post.published and post.date != post.update %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Update') }}: - {% endif %} + {% if post.published and post.date != post.update %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Update') }}: {% endif %} - {{ post.update.strftime(ablog.post_date_format) }} -
  • -{% endif %} -{% if post.author %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Author') }}: - {% endif %} + {{ post.update.strftime(ablog.post_date_format) }} +
  • + {% endif %} {% if post.author %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Author') }}: {% endif %} - {% for coll in post.author %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.author|length %} - , - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.author|length %} - , - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if post.location %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Location') }}: - {% endif %} + {% for coll in post.author %} {% if coll|length %} + {{ coll }} + {% if loop.index < post.author|length %} , {% endif %} {% else %} {{ coll }} + {% if loop.index < post.author|length %} , {% endif %} {% endif %} {% endfor + %} +
  • + {% endif %} {% if post.location %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Location') }}: {% endif %} - {% for coll in post.location %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.location|length %} - , - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.location|length %} - , - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if post.language %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Language') }}: - {% endif %} + {% for coll in post.location %} {% if coll|length %} + {{ coll }} + {% if loop.index < post.location|length %} , {% endif %} {% else %} {{ coll + }} {% if loop.index < post.location|length %} , {% endif %} {% endif %} {% + endfor %} +
  • + {% endif %} {% if post.language %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Language') }}: {% endif %} - {% for coll in post.language %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.language|length %} - , - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.language|length %} - , - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if post.category %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Category') }}: - {% endif %} + {% for coll in post.language %} {% if coll|length %} + {{ coll }} + {% if loop.index < post.language|length %} , {% endif %} {% else %} {{ coll + }} {% if loop.index < post.language|length %} , {% endif %} {% endif %} {% + endfor %} +
  • + {% endif %} {% if post.category %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Category') }}: {% endif %} - {% for coll in post.category %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.category|length %} - , - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.category|length %} - , - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if post.tags %} -
  • - - {% if post.tags|length > 1 %} - {% if fa %} - - {% else %} - {{ gettext('Tags') }}: - {% endif %} - {% else %} - {% if fa %} - - {% else %} - {{ gettext('Tag') }}: - {% endif %}{% endif %} + {% for coll in post.category %} {% if coll|length %} + {{ coll }} + {% if loop.index < post.category|length %} , {% endif %} {% else %} {{ coll + }} {% if loop.index < post.category|length %} , {% endif %} {% endif %} {% + endfor %} +
  • + {% endif %} {% if post.tags %} +
  • + + {% if post.tags|length > 1 %} {% if fa %} + + {% else %} {{ gettext('Tags') }}: {% endif %} {% else %} {% if fa %} + + {% else %} {{ gettext('Tag') }}: {% endif %}{% endif %} - {% for coll in post.tags %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.tags|length %} - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.tags|length %} - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if ablog.disqus_shortname and (ablog[pagename].published or ablog.disqus_drafts) %} -
  • - - {% if fa %} - - {% endif %} - - {% if not fa %} - Comments + (function () { + var s = document.createElement("script"); + s.async = true; + s.type = "text/javascript"; + s.src = "//" + disqus_shortname + ".disqus.com/count.js"; + ( + document.getElementsByTagName("HEAD")[0] || + document.getElementsByTagName("BODY")[0] + ).appendChild(s); + })(); + + {% if fa %} + {% endif %} - -
  • -{% endif %} + + {% if not fa %} Comments {% endif %} + + + {% endif %}
    diff --git a/src/ablog/templates/ablog/postnavy.html b/src/ablog/templates/ablog/postnavy.html index 34a5f438..6cb11c18 100644 --- a/src/ablog/templates/ablog/postnavy.html +++ b/src/ablog/templates/ablog/postnavy.html @@ -1,11 +1,8 @@ -{# prev/next are not set for drafts #} -{% set post = ablog[pagename] %} -{% if post.published and ablog.post_show_prev_next %} +{# prev/next are not set for drafts #} {% set post = ablog[pagename] %} {% if +post.published and ablog.post_show_prev_next %}
    - {% if post.prev %} - {% if not ablog.fontawesome %} - {{ gettext('Previous') }}: + {% if post.prev %} {% if not ablog.fontawesome %} {{ gettext('Previous') }}: {% endif %} {% if ablog.fontawesome %} @@ -17,14 +14,12 @@   - {% if post.next %} - {% if not ablog.fontawesome %} - {{ gettext('Next') }}: - {% endif %} + {% if post.next %} {% if not ablog.fontawesome %} {{ gettext('Next') }}: {% + endif %} {{ post.next.title }} {% if ablog.fontawesome %} - + {% endif %} {% endif %} diff --git a/src/ablog/templates/ablog/recentposts.html b/src/ablog/templates/ablog/recentposts.html index fe49c7b6..91953bf6 100644 --- a/src/ablog/templates/ablog/recentposts.html +++ b/src/ablog/templates/ablog/recentposts.html @@ -1,17 +1,17 @@ {% if ablog %}
    -

    - {{ gettext('Recent Posts') }} -

    - +

    + {{ gettext('Recent Posts') }} +

    +
    {% endif %} diff --git a/src/ablog/templates/ablog/redirect.html b/src/ablog/templates/ablog/redirect.html index 79f7468e..e2ce7929 100644 --- a/src/ablog/templates/ablog/redirect.html +++ b/src/ablog/templates/ablog/redirect.html @@ -1,8 +1,8 @@ -{%- extends "!layout.html" %} -{%- block extrahead %} -{{ super() }} - -{% endblock extrahead %} -{% block body %} -You are being redirected to {{ post.title }} in {{ ablog.post_redirect_refresh }} seconds; -{% endblock body %} +{%- extends "!layout.html" %} {%- block extrahead %} {{ super() }} + +{% endblock extrahead %} {% block body %} You are being redirected to +{{ post.title }} in {{ +ablog.post_redirect_refresh }} seconds; {% endblock body %} diff --git a/src/ablog/templates/ablog/tagcloud.html b/src/ablog/templates/ablog/tagcloud.html index 3a9eb07c..d88eee48 100644 --- a/src/ablog/templates/ablog/tagcloud.html +++ b/src/ablog/templates/ablog/tagcloud.html @@ -1,15 +1,17 @@ {% if ablog.tags %}
    - -

    {{ gettext('Tags') }}

    -
      - {% for coll in ablog.tags %} - {% if coll %} -
    • - {{ coll }} -
    • - {% endif %} - {% endfor %} -
    + +

    {{ gettext('Tags') }}

    +
      + {% for coll in ablog.tags %} {% if coll %} +
    • + {{ coll }} +
    • + {% endif %} {% endfor %} +
    {% endif %} diff --git a/src/ablog/templates/archives.html b/src/ablog/templates/archives.html index b26e94fe..9a10cdf8 100644 --- a/src/ablog/templates/archives.html +++ b/src/ablog/templates/archives.html @@ -1,17 +1,15 @@ -{{ warning("archives.html is an old template path, that is no longer used by ablog. Please use ablog/archives.html instead.") }} -{% if ablog.archive %} +{{ warning("archives.html is an old template path, that is no longer used by +ablog. Please use ablog/archives.html instead.") }} {% if ablog.archive %}
    -

    - {{ gettext('Archives') }} -

    - +

    + {{ gettext('Archives') }} +

    +
    {% endif %} diff --git a/src/ablog/templates/authors.html b/src/ablog/templates/authors.html index 4ac4ad43..28bc96cc 100644 --- a/src/ablog/templates/authors.html +++ b/src/ablog/templates/authors.html @@ -1,13 +1,15 @@ -{{ warning("authors.html is an old template path, that is no longer used by ablog. Please use ablog/authors.html instead.") }} -{% if ablog.author %} +{{ warning("authors.html is an old template path, that is no longer used by +ablog. Please use ablog/authors.html instead.") }} {% if ablog.author %}
    -

    {{ gettext('Authors') }}

    - +

    + {{ gettext('Authors') }} +

    +
    {% endif %} diff --git a/src/ablog/templates/catalog.html b/src/ablog/templates/catalog.html index dfb5ba16..196a8510 100644 --- a/src/ablog/templates/catalog.html +++ b/src/ablog/templates/catalog.html @@ -1,36 +1,26 @@ -{{ warning("catalog.html is an old template path, that is no longer used by ablog. Please use ablog/catalog.html instead.") }} -{%- extends "page.html" %} -{% macro postlink(post) -%} - {% if post.external_link -%} - {{- post.external_link -}} - {% else %} - {{- pathto(post.docname) }}{{ anchor(post) -}} - {%- endif %} -{%- endmacro %} -{% block body %} -{% for collection in catalog %} -{% if collection %} -
    -

    - {{ header }} - {{ collection }} -

    - {% for post in collection %} -
    -

    - {% if post.published %} - {{ post.date.strftime(ablog.post_date_format) }} - {% else %} - Draft - {% endif %} - - - {{ post.title }} -

    -
    - {% endfor %} -
    -{% endif %} -{% endfor %} -{% endblock body %} +{{ warning("catalog.html is an old template path, that is no longer used by +ablog. Please use ablog/catalog.html instead.") }} {%- extends "page.html" %} {% +macro postlink(post) -%} {% if post.external_link -%} {{- post.external_link -}} +{% else %} {{- pathto(post.docname) }}{{ anchor(post) -}} {%- endif %} {%- +endmacro %} {% block body %} {% for collection in catalog %} {% if collection %} +
    +

    + {{ header }} + {{ collection }} +

    + {% for post in collection %} +
    +

    + {% if post.published %} + {{ post.date.strftime(ablog.post_date_format) }} + {% else %} + Draft + {% endif %} - + {{ post.title }} +

    +
    + {% endfor %} +
    +{% endif %} {% endfor %} {% endblock body %} diff --git a/src/ablog/templates/categories.html b/src/ablog/templates/categories.html index b5d0e9a7..cbf92d90 100644 --- a/src/ablog/templates/categories.html +++ b/src/ablog/templates/categories.html @@ -1,17 +1,15 @@ -{{ warning("category.html is an old template path, that is no longer used by ablog. Please use ablog/category.html instead.") }} -{% if ablog.category %} +{{ warning("category.html is an old template path, that is no longer used by +ablog. Please use ablog/category.html instead.") }} {% if ablog.category %}
    -

    - {{ gettext('Categories') }} -

    - +

    + {{ gettext('Categories') }} +

    +
    {% endif %} diff --git a/src/ablog/templates/collection.html b/src/ablog/templates/collection.html index a7cf5e0e..93b668c7 100644 --- a/src/ablog/templates/collection.html +++ b/src/ablog/templates/collection.html @@ -1,73 +1,59 @@ -{{ warning("collection.html is an old template path, that is no longer used by ablog. Please use ablog/collection.html instead.") }} -{%- extends "page.html" %} -{% block body %} -{% macro postlink(post) -%} - {% if post.external_link -%} - {{- post.external_link -}} - {% else %} - {{- pathto(post.docname) }}{{ anchor(post) -}} - {%- endif %} -{%- endmacro %} -{% endmacro %} +{{ warning("collection.html is an old template path, that is no longer used by +ablog. Please use ablog/collection.html instead.") }} {%- extends "page.html" %} +{% block body %} {% macro postlink(post) -%} {% if post.external_link -%} {{- +post.external_link -}} {% else %} {{- pathto(post.docname) }}{{ anchor(post) -}} +{%- endif %} {%- endmacro %} {% endmacro %}

    {% if archive_feed and fa %} - - {% endif %} - {{ header }} - {% if collection.href %} - {{ collection }} - {% else %} - {{ collection }} + {% endif %} - + {{ header }} {% if collection.href %} + {{ collection }} + {% else %} {{ collection }} {% endif %} +

    - {% if ablog.blog_archive_titles %} - {% for post in collection %} + {% if ablog.blog_archive_titles %} {% for post in collection %}

    {% if post.published %} {{ post.date.strftime(ablog.post_date_format) }} {% else %} Draft - {% endif %} - - + {% endif %} - {{ post.title }}

    - {% endfor %} - {% else %} - {% for post in collection %} + {% endfor %} {% else %} {% for post in collection %}

    {{ post.title }}

    • - {% if post.published %} - {% if fa %} + {% if post.published %} {% if fa %} {% endif %} {{ post.date.strftime(ablog.post_date_format) }} - {% else %} - {% if fa %} + {% else %} {% if fa %} - {% endif %} - {% if post.date %} + {% endif %} {% if post.date %} {{ post.date.strftime(ablog.post_date_format) }} {% else %} Draft - {% endif %} - {% endif %} + {% endif %} {% endif %}
    • {% include "ablog/postcard2.html" %}
    {{ post.to_html(collection.docname) }} -

    {{ _("Read more ...") }}

    -
    +

    + {{ _("Read more ...") }} +

    +
    - {% endfor %} - {% endif %} + {% endfor %} {% endif %}
    {% endblock body %} diff --git a/src/ablog/templates/languages.html b/src/ablog/templates/languages.html index 4f7effd8..7353396d 100644 --- a/src/ablog/templates/languages.html +++ b/src/ablog/templates/languages.html @@ -1,15 +1,15 @@ -{{ warning("languages.html is an old template path, that is no longer used by ablog. Please use ablog/languages.html instead.") }} -{% if ablog.language %} +{{ warning("languages.html is an old template path, that is no longer used by +ablog. Please use ablog/languages.html instead.") }} {% if ablog.language %}
    -

    - {{ gettext('Languages') }} -

    - +

    + {{ gettext('Languages') }} +

    +
    {% endif %} diff --git a/src/ablog/templates/locations.html b/src/ablog/templates/locations.html index 98dc56ff..27600f31 100644 --- a/src/ablog/templates/locations.html +++ b/src/ablog/templates/locations.html @@ -1,17 +1,15 @@ -{{ warning("locations.html is an old template path, that is no longer used by ablog. Please use ablog/locations.html instead.") }} -{% if ablog.location %} +{{ warning("locations.html is an old template path, that is no longer used by +ablog. Please use ablog/locations.html instead.") }} {% if ablog.location %}
    -

    - {{ gettext('Locations') }} -

    - +

    + {{ gettext('Locations') }} +

    +
    {% endif %} diff --git a/src/ablog/templates/page.html b/src/ablog/templates/page.html index f360992c..5ec0ed3d 100644 --- a/src/ablog/templates/page.html +++ b/src/ablog/templates/page.html @@ -1,32 +1,26 @@ -{%- extends "layout.html" %} -{% set fa = ablog.fontawesome %} -{%- block extrahead %} -{{ super() }} -{% if feed_path %} +{%- extends "layout.html" %} {% set fa = ablog.fontawesome %} {%- block +extrahead %} {{ super() }} {% if feed_path %} -{% endif %} -{% if ablog.fontawesome_link_cdn %} - +{% endif %} {% if ablog.fontawesome_link_cdn %} + {% elif ablog.fontawesome_css_file %} -{% endif %} -{% endblock extrahead %} -{% block body %} -{{ body }} +{% endif %} {% endblock extrahead %} {% block body %} {{ body }}
    - {% if pagename in ablog %} - {% include "ablog/postnavy.html" %} - {% endif %} - {% if ablog.disqus_shortname and ablog.blog_baseurl and (not ablog[pagename].nocomments) and ((pagename in ablog and (ablog[pagename].published or ablog.disqus_drafts)) or (not pagename in ablog and ablog.disqus_pages)) %} + {% if pagename in ablog %} {% include "ablog/postnavy.html" %} {% endif %} {% + if ablog.disqus_shortname and ablog.blog_baseurl and (not + ablog[pagename].nocomments) and ((pagename in ablog and + (ablog[pagename].published or ablog.disqus_drafts)) or (not pagename in ablog + and ablog.disqus_pages)) %}

    Comments

    @@ -50,10 +44,12 @@

    Comments

    + comments powered by Disqus. comments powered by Disqus - +
    {% endif %}
    diff --git a/src/ablog/templates/postcard.html b/src/ablog/templates/postcard.html index 137ae98e..5e82b1c5 100644 --- a/src/ablog/templates/postcard.html +++ b/src/ablog/templates/postcard.html @@ -1,27 +1,22 @@ -{{ warning("postcard.html is an old template path, that is no longer used by ablog. Please use ablog/postcard.html instead.") }} -{% if pagename in ablog %} +{{ warning("postcard.html is an old template path, that is no longer used by +ablog. Please use ablog/postcard.html instead.") }} {% if pagename in ablog %}
    -{% set fa = ablog.fontawesome %} -{% set post = ablog[pagename] %} -

    - {% if post.published %} - {% if fa %} - - {% endif %} - {{ post.date.strftime(ablog.post_date_format) }} - {% else %} - {% if fa %} - - {% endif %} - {% if post.date %} - {{ post.date.strftime(ablog.post_date_format) }} - {% else %} - Draft - {% endif %} - {% endif %} -

    -
      - {% include "ablog/postcard2.html" %} -
    + {% set fa = ablog.fontawesome %} {% set post = ablog[pagename] %} +

    + {% if post.published %} {% if fa %} + + {% endif %} + {{ post.date.strftime(ablog.post_date_format) }} + {% else %} {% if fa %} + + {% endif %} {% if post.date %} + {{ post.date.strftime(ablog.post_date_format) }} + {% else %} + Draft + {% endif %} {% endif %} +

    +
      + {% include "ablog/postcard2.html" %} +
    {% endif %} diff --git a/src/ablog/templates/postcard2.html b/src/ablog/templates/postcard2.html index e43f9180..5dbdfb3b 100644 --- a/src/ablog/templates/postcard2.html +++ b/src/ablog/templates/postcard2.html @@ -1,166 +1,107 @@ -{{ warning("postcard2.html is an old template path, that is no longer used by ablog. Please use ablog/postcard2.html instead.") }} +{{ warning("postcard2.html is an old template path, that is no longer used by +ablog. Please use ablog/postcard2.html instead.") }}
    -{% if post.published and post.date != post.update %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Update') }}: - {% endif %} + {% if post.published and post.date != post.update %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Update') }}: {% endif %} - {{ post.update.strftime(ablog.post_date_format) }} -
  • -{% endif %} -{% if post.author %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Author') }}: - {% endif %} + {{ post.update.strftime(ablog.post_date_format) }} +
  • + {% endif %} {% if post.author %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Author') }}: {% endif %} - {% for coll in post.author %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.author|length %} - , - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.author|length %} - , - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if post.location %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Location') }}: - {% endif %} + {% for coll in post.author %} {% if coll|length %} + {{ coll }} + {% if loop.index < post.author|length %} , {% endif %} {% else %} {{ coll }} + {% if loop.index < post.author|length %} , {% endif %} {% endif %} {% endfor + %} +
  • + {% endif %} {% if post.location %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Location') }}: {% endif %} - {% for coll in post.location %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.location|length %} - , - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.location|length %} - , - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if post.language %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Language') }}: - {% endif %} + {% for coll in post.location %} {% if coll|length %} + {{ coll }} + {% if loop.index < post.location|length %} , {% endif %} {% else %} {{ coll + }} {% if loop.index < post.location|length %} , {% endif %} {% endif %} {% + endfor %} +
  • + {% endif %} {% if post.language %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Language') }}: {% endif %} - {% for coll in post.language %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.language|length %} - , - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.language|length %} - , - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if post.category %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Category') }}: - {% endif %} + {% for coll in post.language %} {% if coll|length %} + {{ coll }} + {% if loop.index < post.language|length %} , {% endif %} {% else %} {{ coll + }} {% if loop.index < post.language|length %} , {% endif %} {% endif %} {% + endfor %} +
  • + {% endif %} {% if post.category %} +
  • + + {% if fa %} + + {% else %} {{ gettext('Category') }}: {% endif %} - {% for coll in post.category %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.category|length %} - , - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.category|length %} - , - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if post.tags %} -
  • - - {% if post.tags|length > 1 %} - {% if fa %} - - {% else %} - {{ gettext('Tags') }}: - {% endif %} - {% else %} - {% if fa %} - - {% else %} - {{ gettext('Tag') }}: - {% endif %}{% endif %} + {% for coll in post.category %} {% if coll|length %} + {{ coll }} + {% if loop.index < post.category|length %} , {% endif %} {% else %} {{ coll + }} {% if loop.index < post.category|length %} , {% endif %} {% endif %} {% + endfor %} +
  • + {% endif %} {% if post.tags %} +
  • + + {% if post.tags|length > 1 %} {% if fa %} + + {% else %} {{ gettext('Tags') }}: {% endif %} {% else %} {% if fa %} + + {% else %} {{ gettext('Tag') }}: {% endif %}{% endif %} - {% for coll in post.tags %} - {% if coll|length %} - {{ coll }} - {% if loop.index < post.tags|length %} - {% endif %} - {% else %} - {{ coll }} - {% if loop.index < post.tags|length %} - {% endif %} - {% endif %} - {% endfor %} -
  • -{% endif %} -{% if ablog.disqus_shortname and (ablog[pagename].published or ablog.disqus_drafts) %} -
  • - - {% if fa %} - - {% endif %} - - {% if not fa %} - Comments + (function () { + var s = document.createElement("script"); + s.async = true; + s.type = "text/javascript"; + s.src = "//" + disqus_shortname + ".disqus.com/count.js"; + ( + document.getElementsByTagName("HEAD")[0] || + document.getElementsByTagName("BODY")[0] + ).appendChild(s); + })(); + + {% if fa %} + {% endif %} - -
  • -{% endif %} + + {% if not fa %} Comments {% endif %} + + + {% endif %}
    diff --git a/src/ablog/templates/postnavy.html b/src/ablog/templates/postnavy.html index a8c8978b..099de14f 100644 --- a/src/ablog/templates/postnavy.html +++ b/src/ablog/templates/postnavy.html @@ -1,12 +1,10 @@ -{{ warning("postnavy.html is an old template path, that is no longer used by ablog. Please use ablog/postnavy.html instead.") }} -{# prev/next are not set for drafts #} -{% set post = ablog[pagename] %} -{% if post.published and ablog.post_show_prev_next %} +{{ warning("postnavy.html is an old template path, that is no longer used by +ablog. Please use ablog/postnavy.html instead.") }} {# prev/next are not set for +drafts #} {% set post = ablog[pagename] %} {% if post.published and +ablog.post_show_prev_next %}
    - {% if post.prev %} - {% if not ablog.fontawesome %} - {{ gettext('Previous') }}: + {% if post.prev %} {% if not ablog.fontawesome %} {{ gettext('Previous') }}: {% endif %} {% if ablog.fontawesome %} @@ -18,14 +16,12 @@   - {% if post.next %} - {% if not ablog.fontawesome %} - {{ gettext('Next') }}: - {% endif %} + {% if post.next %} {% if not ablog.fontawesome %} {{ gettext('Next') }}: {% + endif %} {{ post.next.title }} {% if ablog.fontawesome %} - + {% endif %} {% endif %} diff --git a/src/ablog/templates/recentposts.html b/src/ablog/templates/recentposts.html index 5a7dad64..7a8860c5 100644 --- a/src/ablog/templates/recentposts.html +++ b/src/ablog/templates/recentposts.html @@ -1,18 +1,18 @@ -{{ warning("recentposts.html is an old template path, that is no longer used by ablog. Please use ablog/recentposts.html instead.") }} -{% if ablog %} +{{ warning("recentposts.html is an old template path, that is no longer used by +ablog. Please use ablog/recentposts.html instead.") }} {% if ablog %}
    -

    - {{ gettext('Recent Posts') }} -

    - +

    + {{ gettext('Recent Posts') }} +

    +
    {% endif %} diff --git a/src/ablog/templates/redirect.html b/src/ablog/templates/redirect.html index 83ab0032..12304946 100644 --- a/src/ablog/templates/redirect.html +++ b/src/ablog/templates/redirect.html @@ -1,9 +1,10 @@ -{{ warning("redirect.html is an old template path, that is no longer used by ablog. Please use ablog/redirect.html instead.") }} -{%- extends "!layout.html" %} -{%- block extrahead %} -{{ super() }} - -{% endblock extrahead %} -{% block body %} -You are being redirected to {{ post.title }} in {{ ablog.post_redirect_refresh }} seconds; -{% endblock body %} +{{ warning("redirect.html is an old template path, that is no longer used by +ablog. Please use ablog/redirect.html instead.") }} {%- extends "!layout.html" +%} {%- block extrahead %} {{ super() }} + +{% endblock extrahead %} {% block body %} You are being redirected to +{{ post.title }} in {{ +ablog.post_redirect_refresh }} seconds; {% endblock body %} diff --git a/src/ablog/templates/tagcloud.html b/src/ablog/templates/tagcloud.html index c6b3d87f..f317afe1 100644 --- a/src/ablog/templates/tagcloud.html +++ b/src/ablog/templates/tagcloud.html @@ -1,16 +1,18 @@ -{{ warning("tagcloud.html is an old template path, that is no longer used by ablog. Please use ablog/tagcloud.html instead.") }} -{% if ablog.tags %} +{{ warning("tagcloud.html is an old template path, that is no longer used by +ablog. Please use ablog/tagcloud.html instead.") }} {% if ablog.tags %}
    - -

    {{ gettext('Tags') }}

    -
      - {% for coll in ablog.tags %} - {% if coll %} -
    • - {{ coll }} -
    • - {% endif %} - {% endfor %} -
    + +

    {{ gettext('Tags') }}

    +
      + {% for coll in ablog.tags %} {% if coll %} +
    • + {{ coll }} +
    • + {% endif %} {% endfor %} +
    {% endif %} diff --git a/tox.ini b/tox.ini index cbffc463..9992337c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,33 +1,33 @@ [tox] envlist = - py{39,310,311,312}{-sphinx5,-sphinx6,-sphinx7,-sphinx8,-sphinxdev,-docs,-linkcheck} + py{39,310,311,312}{-sphinx6,-sphinx7,-sphinx8,-sphinx9,-devdeps,-docs,-linkcheck,-pydata-sphinx-theme} [testenv] allowlist_externals = make git -deps = - pytest-cov extras = dev commands = # Have to do this here as myst-parser in the install step forces the version. - sphinx5: pip install -U "sphinx>=5.0,<6.0" sphinx6: pip install -U "sphinx>=6.0,<7.0" sphinx7: pip install -U "sphinx>=7.0,<8.0" sphinx8: pip install -U "sphinx>=8.0,<9.0" - sphinxdev: pip install -U git+https://github.com/docutils/docutils.git - sphinxdev: pip install -U git+https://github.com/sphinx-doc/sphinx + sphinx9: pip install -U "sphinx>=9.0,<10.0" + devdeps: pip install -U "docutils @ git+https://github.com/docutils/docutils.git\#\&subdirectory=docutils" + devdeps: pip install -U "git+https://github.com/sphinx-doc/sphinx" pip freeze --all --no-input pytest -vvv -r a --pyargs ablog make tests +[testenv:docs] +changedir = docs +description = Invoke sphinx-build to build the HTML docs +commands = + sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs} + python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))' + [testenv:pydata-sphinx-theme] -deps = - git+https://github.com/pydata/pydata-sphinx-theme.git - pytest-cov -extras = - dev commands = rm -rf pydata-sphinx-theme || true git clone git@github.com:pydata/pydata-sphinx-theme.git --depth 1 pydata-sphinx-theme @@ -35,13 +35,6 @@ commands = pip freeze --all --no-input sphinx-build --color -W --keep-going -b html -d _build/.doctrees pydata-sphinx-theme/docs pydata-sphinx-theme/docs/_build/html {posargs} -[testenv:docs] -changedir = docs -description = Invoke sphinx-build to build the HTML docs -commands = - sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs} - python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))' - [testenv:linkcheck] changedir = docs description = Invoke sphinx-build to check linkcheck works From 4f9ae64579c831d5ceca390e36e5c70a190ad4b9 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Thu, 8 Aug 2024 15:57:18 -0700 Subject: [PATCH 4/5] Downgrade alavbaster --- setup.cfg | 2 +- src/ablog/__init__.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index bf036090..9d84bf9c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ notebook = markdown = myst-parser>=0.17.0 docs = - alabaster + alabaster<1.0.0 sphinx-automodapi tests = pytest diff --git a/src/ablog/__init__.py b/src/ablog/__init__.py index 1fd29ad6..ce5a9640 100755 --- a/src/ablog/__init__.py +++ b/src/ablog/__init__.py @@ -141,6 +141,7 @@ def setup(app): """ Setup ABlog extension. """ + app.require_sphinx("6.2") for args in CONFIG: app.add_config_value(*args[:3]) app.add_directive("post", PostDirective) @@ -164,4 +165,8 @@ def setup(app): pkgdir = os.path.abspath(os.path.dirname(__file__)) locale_dir = os.path.join(pkgdir, "locales") app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir) - return {"version": __version__, "parallel_read_safe": True} + return { + "version": __version__, + "parallel_read_safe": True, + "parallel_write_safe": True, + } From 183f6ff651fe4e689e5cdce18827ad8126b046ba Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Thu, 8 Aug 2024 16:04:47 -0700 Subject: [PATCH 5/5] undo pin --- docs/conf.py | 5 ++--- docs/release/ablog-v0.11-released.rst | 2 ++ setup.cfg | 2 +- src/ablog/start.py | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6756d03d..ad4463ca 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -68,11 +68,11 @@ disqus_shortname = "https-ablog-readthedocs-io" disqus_pages = True fontawesome_link_cdn = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" -html_style = "alabaster.css" html_theme = "alabaster" html_sidebars = { "**": [ - "about.html", + "about.html", # Comes from alabaster + "searchfield.html", # Comes from alabaster "ablog/postcard.html", "ablog/recentposts.html", "ablog/tagcloud.html", @@ -81,7 +81,6 @@ "ablog/authors.html", "ablog/languages.html", "ablog/locations.html", - "searchbox.html", ] } html_theme_options = { diff --git a/docs/release/ablog-v0.11-released.rst b/docs/release/ablog-v0.11-released.rst index 95e113ef..e0abf247 100644 --- a/docs/release/ablog-v0.11-released.rst +++ b/docs/release/ablog-v0.11-released.rst @@ -105,4 +105,6 @@ ABlog v0.11.11 released ----------------------- Mark Ablog parallel safe. + Dropped support for Python 3.9, Sphinx less than 6.2. +This mirrors the requirements for alabaster 1.0.0. diff --git a/setup.cfg b/setup.cfg index 9d84bf9c..8b465a78 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ notebook = markdown = myst-parser>=0.17.0 docs = - alabaster<1.0.0 + alabaster>=1.0.0 sphinx-automodapi tests = pytest diff --git a/src/ablog/start.py b/src/ablog/start.py index 7bd92d68..cc17e942 100644 --- a/src/ablog/start.py +++ b/src/ablog/start.py @@ -128,10 +128,10 @@ def w(t, ls=80): # In addition, there are authors.html, languages.html, and locations.html # sidebars that link to author and location archive pages. html_sidebars = {{ - '**': [ 'ablog/postcard.html', 'navigation.html', +'**': [ 'ablog/postcard.html', 'navigation.html', 'ablog/recentposts.html', 'ablog/tagcloud.html', 'ablog/categories.html', 'ablog/archives.html', - 'searchbox.html', + 'searchfield.html', ], }}