diff --git a/.circleci/config.yml b/.circleci/config.yml index 88b4b96c..e3e55631 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,13 +2,13 @@ version: 2 jobs: twine-check: docker: - - image: circleci/python:3.8 + - image: circleci/python:3.11 steps: - checkout - - run: python setup.py sdist - - run: python -m pip install -U --user --force-reinstall twine + - run: python -m pip install -U --user build + - run: python -m build . --sdist + - run: python -m pip install -U --user twine - run: python -m twine check dist/* - workflows: version: 2 twine-check: diff --git a/.djlintrc b/.djlintrc deleted file mode 100644 index 04396935..00000000 --- a/.djlintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "profile": "jinja", - "extension": "html", - "indent": "2", - "max_line_length": "120", - "use_gitignore": "True", - "format_js": "True", - "format_css": "True", - "ignore": "H006,J018,T003,H025" -} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e36af018..e95c6c99 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 }} @@ -67,7 +67,7 @@ jobs: needs: [test] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: - default_python: '3.9' + default_python: "3.9" submodules: false pytest: false envs: | @@ -77,7 +77,7 @@ jobs: needs: [test] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: - default_python: '3.9' + default_python: "3.9" submodules: false coverage: codecov libraries: | 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/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5abd21da..5310f643 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ ci: - autofix_prs: false - autoupdate_schedule: "quarterly" + autofix_prs: false + autoupdate_schedule: "quarterly" repos: - repo: https://github.com/myint/docformatter rev: v1.7.5 @@ -11,26 +11,28 @@ repos: rev: v2.2.1 hooks: - id: autoflake - args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] - exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$" + args: + [ + "--in-place", + "--remove-all-unused-imports", + "--remove-unused-variable", + ] - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.1.11' + rev: "v0.1.11" hooks: - id: ruff - args: ['--fix', '--unsafe-fixes'] - - repo: https://github.com/psf/black - rev: 23.12.1 - hooks: + args: ["--fix", "--unsafe-fixes"] + - repo: https://github.com/psf/black + rev: 23.12.1 + hooks: - id: black - exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" - - repo: https://github.com/PyCQA/isort - rev: 5.13.2 - hooks: + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 + hooks: - id: isort - exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: - id: check-ast - id: check-case-conflict - id: trailing-whitespace @@ -48,17 +50,18 @@ repos: additional_dependencies: - tomli - repo: https://github.com/awebdeveloper/pre-commit-stylelint - rev: '0.0.2' + rev: "0.0.2" + 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 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 - hooks: - - id: prettier - types_or: [css, scss, javascript] + - id: prettier + exclude_types: [html] - repo: https://github.com/Riverside-Healthcare/djLint rev: v1.34.1 hooks: - id: djlint-jinja - types_or: ["html"] + types: [html] diff --git a/.readthedocs.yml b/.readthedocs.yml index 358072f1..c23f52cc 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -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/.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/docs/conf.py b/docs/conf.py index 5001e64b..60e3d957 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ version = str(_parse(ablog.__version__)) project = "ABlog" -copyright = "2014-2022, ABlog Team" +copyright = "2014-2022, ABlog Team" # NOQA: A001 master_doc = "index" source_suffix = { ".rst": "restructuredtext", diff --git a/docs/index.rst b/docs/index.rst index 522c80fe..407451f9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -59,7 +59,7 @@ Once you have content (in ``.rst`` files), you can post *any page* using the :rs :location: SF :language: en -An alterative method is: +An alternative method is: .. code-block:: rst diff --git a/docs/manual/ablog-commands.rst b/docs/manual/ablog-commands.rst index 1dce494c..c50cbd7d 100644 --- a/docs/manual/ablog-commands.rst +++ b/docs/manual/ablog-commands.rst @@ -126,7 +126,7 @@ Running ``ablog deploy`` will push your website to GitHub:: `conf.py` -g GITHUB_PAGES GitHub username for deploying to GitHub pages -m MESSAGE commit message - -f owerwrite last commit, i.e. `commit --amend; push -f` + -f overwrite last commit, i.e. `commit --amend; push -f` --push-quietly be more quiet when pushing changes --github-branch GITHUB_BRANCH Branch to use. Default is 'master'. diff --git a/docs/manual/markdown.md b/docs/manual/markdown.md index 1a6df656..63a38aac 100644 --- a/docs/manual/markdown.md +++ b/docs/manual/markdown.md @@ -15,7 +15,7 @@ This page is a markdown file underneath. You will need to do a few things to get setup. 1. Install [myst-parser](https://pypi.org/project/myst-parser/) -2. Add these options to your config, ``conf.py`` +2. Add these options to your config, `conf.py` ```python extensions = [ @@ -27,6 +27,7 @@ myst_update_mathjax = False ``` Then use the new blogpost metadata format (with a slight twist): + ``` --- blogpost: true @@ -41,7 +42,8 @@ language: English Notice here we do not have a ":" at the start since the markdown metadata format is different from rst. Please be aware that adding "myst-parser" will mean it will read all markdown files and try to parse them. -You will need to use the following in your ``conf.py`` to prevent this: +You will need to use the following in your `conf.py` to prevent this: + ```python exclude_patterns = [ "posts/*/.ipynb_checkpoints/*", diff --git a/docs/manual/notebook_support.ipynb b/docs/manual/notebook_support.ipynb index 04e12e1d..0a5b023c 100644 --- a/docs/manual/notebook_support.ipynb +++ b/docs/manual/notebook_support.ipynb @@ -23,7 +23,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "To add support for Notebooks to your Ablog instance, you need to configure your `docs/conf.py` (or whereever your `conf.py` is located.\n", + "To add support for Notebooks to your Ablog instance, you need to configure your `docs/conf.py` (or wherever your `conf.py` is located.\n", "\n", "You will need to add\n", "\n", diff --git a/docs/release/ablog-v0.10-released.rst b/docs/release/ablog-v0.10-released.rst index 9d060495..1da21add 100644 --- a/docs/release/ablog-v0.10-released.rst +++ b/docs/release/ablog-v0.10-released.rst @@ -178,7 +178,7 @@ ABlog v0.10.20 released Pull Requests merged in: `fix documentation typo in blog-drafts `__. -`Fix typo in "extennsion" `__. +`Fix typo in "extension" `__. `Catalan translation `__. `Fix ablog post `__. diff --git a/pyproject.toml b/pyproject.toml index 8781cac6..0f30b7c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,21 +3,21 @@ requires = [ "setuptools", "setuptools_scm[toml]", "wheel", - "oldest-supported-numpy", ] build-backend = 'setuptools.build_meta' [project] -name = "irispy-lmsal" +name = "ablog" dynamic = ["version"] -description = "Provides tools to read and analyze data from the IRIS solar-observing satellite." +description = "A Sphinx extension that converts any documentation or personal website project into a full-fledged blog." readme = "README.rst" requires-python = ">=3.9" -license = {file = "LICENSE.txt"} -keywords = ["solar physics", "solar", "science", "NASA", "iris", "spectra", "lmsal"] +license = {file = "LICENSE.rst"} +keywords = ["sphinx", "blogging", "ablog"] authors = [ - {email = "freij@baeri.org"}, - {name = "Nabil Freij"} + {email = "sunpy@googlegroups.com"}, + {name = "The SunPy Community"}, + ] classifiers = [ "Development Status :: 3 - Alpha", @@ -34,52 +34,43 @@ classifiers = [ "Topic :: Scientific/Engineering :: Physics", ] dependencies = [ - 'dkist>=1.0.0', - 'ndcube>=2.1.2', - 'pandas>=1.3.3', - 'scipy>=1.7.0', - 'sunpy>=5.0.0', - 'sunraster>=0.4.0', + "docutils>=0.18", + "feedgen>=0.9.0", + "invoke>=1.6.0", + "packaging>=19.0", + "python-dateutil>=2.8.2", + "sphinx>=5.0.0", + "watchdog>=2.1.0", ] [project.urls] -changelog = "https://irispy-lmsal.readthedocs.io/en/stable/changelog" -documentation = "https://irispy-lmsal.readthedocs.io/en/stable/" -homepage = "https://iris.lmsal.com/" -issue_tracker = "https://github.com/LM-SAL/irispy-lmsal/issues" -repository = "https://github.com/LM-SAL/irispy-lmsal" +changelog = "https://ablog.readthedocs.io/en/stable/blog/category/release.html" +documentation = "https://ablog.readthedocs.io/en/stable/" +homepage = "https://github.com/sunpy/ablog" +issue_tracker = "https://github.com/sunpy/ablog/issues" +repository = "https://github.com/sunpy/ablog" [project.optional-dependencies] -all = ["irispy-lmsal"] -tests = [ - "irispy-lmsal[all]", - 'pytest-astropy', -] -docs = [ - "irispy-lmsal[all]", - 'aiapy', - 'pooch', - 'sphinx', - 'sphinx-automodapi', - 'sphinx-changelog', - 'sphinx-copybutton', - 'sphinx-design', - 'sphinx-gallery', - 'sphinx-hoverxref', - 'sunpy-sphinx-theme', -] -dev = ["irispy-lmsal[tests,docs]"] +all = ["ablog[markdown, notebook]"] +notebook =["ipython>=7.30.0", + "nbsphinx>=0.8.0"] +markdown =[ "myst-parser>=0.17.0"] +docs =[ "alabaster", + "sphinx-automodapi"] +tests =[ "pytest"] -[tool.setuptools_scm] -write_to = "irispy/_version.py" +[project.scripts] +ablog = "ablog.commands:ablog_main" -[tool.setuptools.exclude-package-data] -muse = ["irispy._dev"] +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools_scm] +write_to = "src/ablog/version.py" [tool.pytest.ini_options] testpaths = [ - "irispy", - "docs" + "tests", ] norecursedirs = [ ".tox", @@ -87,27 +78,17 @@ norecursedirs = [ '''docs[\/]_build''', '''docs[\/]generated''', "*.egg-info", - "examples", - '''irispy[/\]_dev''', - ".jupyter", ".history", ] -doctest_plus = "enabled" -doctest_optionflags = "NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS" -addopts = "--doctest-rst --doctest-ignore-import-errors -p no:unraisableexception -p no:threadexception" -markers = [ - "remote_data: marks this test function as needing remote data.", -] -remote_data_strict = "True" +addopts = "-p no:unraisableexception -p no:threadexception" filterwarnings = [ "error", + # Do not fail on pytest config issues (i.e. missing plugins) but do show them "always::pytest.PytestConfigWarning", + # Sphinx and other packages raise these "ignore:.*deprecated and slated for removal in Python 3.13", - "ignore:numpy.ufunc size changed:RuntimeWarning", - "ignore:numpy.ndarray size changed:RuntimeWarning", - "ignore:.*unitfix.*", - "ignore::erfa.core.ErfaWarning", - "ignore:invalid value encountered in sqrt", + # python-datetuil + "ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning", ] [tool.black] @@ -190,5 +171,7 @@ extend-ignore = [ convention = "numpy" [tool.codespell] -skip = "*.asdf,*.fits,*.fts,*.header,*.json,*.xsh,*cache*,*egg*,*extern*,.git,.idea,.tox,_build,*truncated,*.svg,.asv_env,.history,*sphinx.po" -ignore-words-list = "sav," +skip = "*cache*,*egg*,*extern*,.git,.idea,.tox,*.svg,.history,*sphinx.po" + +[tool.djlint] +files=["*.html"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e54595f8..00000000 --- a/setup.cfg +++ /dev/null @@ -1,80 +0,0 @@ -[metadata] -name = ablog -author = The SunPy Community -author_email = sunpy@googlegroups.com -description = A Sphinx extension that converts any documentation or personal website project into a full-fledged blog. -long_description = file: README.rst -long_description_content_type = text/x-rst -license = MIT -url = https://ablog.readthedocs.io/ -edit_on_github = True -github_project = sunpy/ablog - -[options] -python_requires = >=3.9 -package_dir= - =src -packages=find: -include_package_data = True -setup_requires = - setuptools_scm -install_requires = - docutils>=0.18 - feedgen>=0.9.0 - invoke>=1.6.0 - packaging>=19.0 - python-dateutil>=2.8.2 - sphinx>=5.0.0 - watchdog>=2.1.0 - -[options.packages.find] -where=src - -[options.extras_require] -notebook = - ipython>=7.30.0 - nbsphinx>=0.8.0 -markdown = - myst-parser>=0.17.0 -docs = - alabaster - sphinx-automodapi -tests = - pytest - -[options.entry_points] -console_scripts = - ablog = ablog.commands:ablog_main - -[tool:pytest] -testpaths = "tests" -norecursedirs = ".tox" "build" "docs[\/]_build" "docs[\/]generated" "*.egg-info" ".history" -markers = - sphinx -addopts = -p no:unraisableexception -p no:threadexception -filterwarnings = - error - # Do not fail on pytest config issues (i.e. missing plugins) but do show them - always::pytest.PytestConfigWarning - # Sphinx and other packages raise these - ignore:'imghdr' is deprecated and slated for removal in Python 3.13:DeprecationWarning - # python-datetuil - ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning - -[pycodestyle] -max_line_length = 120 - -[flake8] -max-line-length = 120 - -[isort] -default_section = THIRDPARTY -force_grid_wrap = 0 -include_trailing_comma = true -known_first_party = ablog -length_sort = False -length_sort_sections = stdlib -line_length = 120 -multi_line_output = 3 -skip = .history -sections = FUTURE, STDLIB, THIRDPARTY, FIRSTPARTY, LOCALFOLDER diff --git a/setup.py b/setup.py index 24662f37..310223ba 100644 --- a/setup.py +++ b/setup.py @@ -1,30 +1,5 @@ -#!/usr/bin/env python -from setuptools import setup # isort:skip -import os -from itertools import chain +from setuptools import setup -try: - # Recommended for setuptools 61.0.0+ - # (though may disappear in the future) - from setuptools.config.setupcfg import read_configuration -except ImportError: - from setuptools.config import read_configuration - -################################################################################ -# Programmatically generate some extras combos. -################################################################################ -extras = read_configuration("setup.cfg")["options"]["extras_require"] - -# Dev is everything -extras["dev"] = list(chain(*extras.values())) - -# All is everything but tests and docs -exclude_keys = ("tests", "docs", "dev") -ex_extras = dict(filter(lambda i: i[0] not in exclude_keys, extras.items())) -# Concatenate all the values together for 'all' -extras["all"] = list(chain.from_iterable(ex_extras.values())) - -setup( - extras_require=extras, - use_scm_version={"write_to": os.path.join("src", "ablog", "_version.py")}, -) +# We keep this around as of time of writing, I do not know how to avoid +# having this if we want to run extract_messages for the translations +setup() \ No newline at end of file diff --git a/src/ablog/commands.py b/src/ablog/commands.py index 6181e9bd..26f8300f 100644 --- a/src/ablog/commands.py +++ b/src/ablog/commands.py @@ -353,7 +353,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..9e966d36 100644 --- a/src/ablog/templates/ablog/archives.html +++ b/src/ablog/templates/ablog/archives.html @@ -1,16 +1,16 @@ {% 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..802edf16 100644 --- a/src/ablog/templates/ablog/authors.html +++ b/src/ablog/templates/ablog/authors.html @@ -1,12 +1,16 @@ {% 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..f1bb8ebb 100644 --- a/src/ablog/templates/ablog/catalog.html +++ b/src/ablog/templates/ablog/catalog.html @@ -1,36 +1,34 @@ {%- 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 %} + {% 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/ablog/categories.html b/src/ablog/templates/ablog/categories.html index 5396b0a4..7ee05b56 100644 --- a/src/ablog/templates/ablog/categories.html +++ b/src/ablog/templates/ablog/categories.html @@ -1,16 +1,16 @@ {% 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..540011cb 100644 --- a/src/ablog/templates/ablog/collection.html +++ b/src/ablog/templates/ablog/collection.html @@ -1,71 +1,71 @@ {%- 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 %} - -

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

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

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

- {{ post.title }} -

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

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

-
-
- {% endfor %} - {% endif %} -
-{% endblock body %} + {{- pathto(post.docname) }}{{ anchor(post) -}} {%- endif %} {%- endmacro %} +
+

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

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

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

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

+ {{ post.title }} +

+
    +
  • + {% 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" %} +
+ {{ post.to_html(collection.docname) }} +

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

+
+
+ {% endfor %} + {% endif %} +
+ {% endblock body %} diff --git a/src/ablog/templates/ablog/languages.html b/src/ablog/templates/ablog/languages.html index ee5c5cef..5f8d0ae5 100644 --- a/src/ablog/templates/ablog/languages.html +++ b/src/ablog/templates/ablog/languages.html @@ -1,14 +1,16 @@ {% 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..8b89c1bc 100644 --- a/src/ablog/templates/ablog/locations.html +++ b/src/ablog/templates/ablog/locations.html @@ -1,16 +1,16 @@ {% 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..fb517bf3 100644 --- a/src/ablog/templates/ablog/postcard.html +++ b/src/ablog/templates/ablog/postcard.html @@ -1,26 +1,22 @@ {% 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..b3d7480f 100644 --- a/src/ablog/templates/ablog/postcard2.html +++ b/src/ablog/templates/ablog/postcard2.html @@ -1,165 +1,151 @@
-{% if post.published and post.date != post.update %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Update') }}: + {% if post.published and post.date != post.update %} +
  • + + {% if fa %} + + {% else %} + {{ gettext("Update") }}: + {% endif %} + + {{ post.update.strftime(ablog.post_date_format) }} +
  • {% endif %} - - {{ post.update.strftime(ablog.post_date_format) }} - -{% endif %} -{% if post.author %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Author') }}: + {% 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 %} - - {% 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') }}: + {% 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 %} - - {% 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') }}: + {% 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 %} - - {% 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') }}: + {% 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 %} - - {% 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 %} - + {% 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 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 - {% endif %} - -
  • + (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 %} + + {% if not fa %}Comments{% endif %} + + {% endif %}
    diff --git a/src/ablog/templates/ablog/postnavy.html b/src/ablog/templates/ablog/postnavy.html index 34a5f438..c6d0c42c 100644 --- a/src/ablog/templates/ablog/postnavy.html +++ b/src/ablog/templates/ablog/postnavy.html @@ -1,33 +1,36 @@ -{# 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') }}: +{# 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") + }}: + {% endif %} + + {% if ablog.fontawesome %} + + {% endif + %} + {{ post.prev.title }} + + {% endif %} + +   + + {% if post.next %} + {% if not ablog.fontawesome %} + {{ gettext("Next") }}: {% + endif %} + + {{ post.next.title }} + {% if ablog.fontawesome %} + + {% endif + %} + + {% endif %} + +
    {% endif %} - - {% if ablog.fontawesome %} - - {% endif %} - {{ post.prev.title }} - - {% endif %} -
    -   - - {% if post.next %} - {% if not ablog.fontawesome %} - {{ gettext('Next') }}: - {% endif %} - - {{ post.next.title }} - {% if ablog.fontawesome %} - - {% endif %} - - {% endif %} - -
    -{% endif %} diff --git a/src/ablog/templates/ablog/recentposts.html b/src/ablog/templates/ablog/recentposts.html index fe49c7b6..9113b576 100644 --- a/src/ablog/templates/ablog/recentposts.html +++ b/src/ablog/templates/ablog/recentposts.html @@ -1,17 +1,18 @@ {% 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..5e49613e 100644 --- a/src/ablog/templates/ablog/redirect.html +++ b/src/ablog/templates/ablog/redirect.html @@ -1,8 +1,9 @@ -{%- extends "!layout.html" %} -{%- block extrahead %} -{{ super() }} - +{%- extends "!layout.html" %} {%- block extrahead %} {{ super() }} + {% endblock extrahead %} {% block body %} -You are being redirected to {{ post.title }} in {{ ablog.post_redirect_refresh }} seconds; + 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..6fbb7941 100644 --- a/src/ablog/templates/ablog/tagcloud.html +++ b/src/ablog/templates/ablog/tagcloud.html @@ -1,15 +1,19 @@ {% 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..fa6a35da 100644 --- a/src/ablog/templates/archives.html +++ b/src/ablog/templates/archives.html @@ -1,17 +1,18 @@ -{{ warning("archives.html is an old template path, that is no longer used by ablog. Please use ablog/archives.html instead.") }} +{{ 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..16c1615e 100644 --- a/src/ablog/templates/authors.html +++ b/src/ablog/templates/authors.html @@ -1,13 +1,18 @@ -{{ warning("authors.html is an old template path, that is no longer used by ablog. Please use ablog/authors.html instead.") }} +{{ 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..3e6156f6 100644 --- a/src/ablog/templates/catalog.html +++ b/src/ablog/templates/catalog.html @@ -1,36 +1,33 @@ -{{ 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..654885c1 100644 --- a/src/ablog/templates/categories.html +++ b/src/ablog/templates/categories.html @@ -1,17 +1,18 @@ -{{ warning("category.html is an old template path, that is no longer used by ablog. Please use ablog/category.html instead.") }} +{{ 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..cc498a2a 100644 --- a/src/ablog/templates/collection.html +++ b/src/ablog/templates/collection.html @@ -1,73 +1,74 @@ -{{ warning("collection.html is an old template path, that is no longer used by ablog. Please use ablog/collection.html instead.") }} -{%- extends "page.html" %} +{{ 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 %} - -

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

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

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

    - {{ post.title }} -

    -
      -
    • - {% if post.published %} - {% if fa %} - - {% endif %} - {{ post.date.strftime(ablog.post_date_format) }} + {% macro postlink(post) -%} + {% if post.external_link -%} + {{- + post.external_link -}} {% else %} - {% if fa %} - - {% endif %} - {% if post.date %} - {{ post.date.strftime(ablog.post_date_format) }} + {{- pathto(post.docname) }}{{ anchor(post) -}} + {%- endif %} {%- endmacro %} + {% endmacro %} +
      +

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

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

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

      +
      + {% endfor %} {% else %} - Draft - {% endif %} - {% endif %} -
    • - {% include "ablog/postcard2.html" %} -
    - {{ post.to_html(collection.docname) }} -

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

    -
    -
    - {% endfor %} - {% endif %} -
    -{% endblock body %} + {% for post in collection %} +
    +

    + {{ post.title }} +

    +
      +
    • + {% 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" %} +
    + {{ post.to_html(collection.docname) }} +

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

    +
    +
    + {% endfor %} + {% endif %} + + {% endblock body %} diff --git a/src/ablog/templates/languages.html b/src/ablog/templates/languages.html index 4f7effd8..93575a64 100644 --- a/src/ablog/templates/languages.html +++ b/src/ablog/templates/languages.html @@ -1,15 +1,18 @@ -{{ warning("languages.html is an old template path, that is no longer used by ablog. Please use ablog/languages.html instead.") }} +{{ 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..10181bc2 100644 --- a/src/ablog/templates/locations.html +++ b/src/ablog/templates/locations.html @@ -1,17 +1,18 @@ -{{ warning("locations.html is an old template path, that is no longer used by ablog. Please use ablog/locations.html instead.") }} +{{ 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..73875c67 100644 --- a/src/ablog/templates/page.html +++ b/src/ablog/templates/page.html @@ -1,36 +1,34 @@ -{%- extends "layout.html" %} -{% set fa = ablog.fontawesome %} -{%- block extrahead %} -{{ super() }} +{%- extends "layout.html" %} {% set fa = ablog.fontawesome %} {%- block +extrahead %} {{ super() }} {% if feed_path %} - + {% endif %} {% if ablog.fontawesome_link_cdn %} - + {% elif ablog.fontawesome_css_file %} - + {% 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)) %} -
    -

    Comments

    -
    - - - - comments powered by Disqus - -
    - {% endif %} + + + + comments powered by Disqus + +
    + {% endif %} {% endblock body %} diff --git a/src/ablog/templates/postcard.html b/src/ablog/templates/postcard.html index 137ae98e..f6af5266 100644 --- a/src/ablog/templates/postcard.html +++ b/src/ablog/templates/postcard.html @@ -1,27 +1,24 @@ -{{ warning("postcard.html is an old template path, that is no longer used by ablog. Please use ablog/postcard.html instead.") }} +{{ 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..d5db8b5b 100644 --- a/src/ablog/templates/postcard2.html +++ b/src/ablog/templates/postcard2.html @@ -1,166 +1,153 @@ -{{ 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') }}: + {% if post.published and post.date != post.update %} +
  • + + {% if fa %} + + {% else %} + {{ gettext("Update") }}: + {% endif %} + + {{ post.update.strftime(ablog.post_date_format) }} +
  • {% endif %} - - {{ post.update.strftime(ablog.post_date_format) }} - -{% endif %} -{% if post.author %} -
  • - - {% if fa %} - - {% else %} - {{ gettext('Author') }}: + {% 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 %} - - {% 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') }}: + {% 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 %} - - {% 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') }}: + {% 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 %} - - {% 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') }}: + {% 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 %} - - {% 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 %} - + {% 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 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 - {% endif %} - -
  • + (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 %} + + {% if not fa %}Comments{% endif %} + + {% endif %}
    diff --git a/src/ablog/templates/postnavy.html b/src/ablog/templates/postnavy.html index a8c8978b..5aefdc31 100644 --- a/src/ablog/templates/postnavy.html +++ b/src/ablog/templates/postnavy.html @@ -1,34 +1,38 @@ -{{ 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') }}: +{{ 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") + }}: + {% endif %} + + {% if ablog.fontawesome %} + + {% endif + %} + {{ post.prev.title }} + + {% endif %} + +   + + {% if post.next %} + {% if not ablog.fontawesome %} + {{ gettext("Next") }}: {% + endif %} + + {{ post.next.title }} + {% if ablog.fontawesome %} + + {% endif + %} + + {% endif %} + +
    {% endif %} - - {% if ablog.fontawesome %} - - {% endif %} - {{ post.prev.title }} - - {% endif %} -
    -   - - {% if post.next %} - {% if not ablog.fontawesome %} - {{ gettext('Next') }}: - {% endif %} - - {{ post.next.title }} - {% if ablog.fontawesome %} - - {% endif %} - - {% endif %} - -
    -{% endif %} diff --git a/src/ablog/templates/recentposts.html b/src/ablog/templates/recentposts.html index 5a7dad64..d49a55ea 100644 --- a/src/ablog/templates/recentposts.html +++ b/src/ablog/templates/recentposts.html @@ -1,18 +1,20 @@ -{{ warning("recentposts.html is an old template path, that is no longer used by ablog. Please use ablog/recentposts.html instead.") }} +{{ 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..8c8f2c09 100644 --- a/src/ablog/templates/redirect.html +++ b/src/ablog/templates/redirect.html @@ -1,9 +1,11 @@ -{{ 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() }} - +{{ 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; + 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..c59af642 100644 --- a/src/ablog/templates/tagcloud.html +++ b/src/ablog/templates/tagcloud.html @@ -1,16 +1,21 @@ -{{ warning("tagcloud.html is an old template path, that is no longer used by ablog. Please use ablog/tagcloud.html instead.") }} +{{ 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/src/ablog/version.py b/src/ablog/version.py index e86557ff..cade827b 100644 --- a/src/ablog/version.py +++ b/src/ablog/version.py @@ -1,17 +1,17 @@ -try: - from ._version import version -except Exception: - import warnings +# file generated by setuptools_scm +# don't change, don't track in version control +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Union - warnings.warn(f'could not determine {__name__.split(".")[0]} package version; this indicates a broken installation') - del warnings + VERSION_TUPLE = tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object - version = "0.0.0" +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE -from packaging.version import parse as _parse - -_version = _parse(version) -major, minor, bugfix = [*_version.release, 0][:3] -release = not _version.is_devrelease - -__all__ = ["version", "major", "minor", "bugfix", "release"] +__version__ = version = "0.11.7.dev15+g26028be.d20240107" +__version_tuple__ = version_tuple = (0, 11, 7, "dev15", "g26028be.d20240107")