Skip to content

Commit

Permalink
Merge branch 'master' into support/use-no-jekyll-flag-ghp-import
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmayer authored Jan 15, 2024
2 parents 4d93609 + 5e6dba7 commit 5319001
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
python: "3.9"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -52,10 +52,10 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v3
with:
python-version: 3.9
python-version: "3.11"
cache: true
cache-dependency-path: ./pyproject.toml
- name: Install dependencies
Expand All @@ -70,10 +70,10 @@ jobs:
name: Test build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v3
with:
python-version: 3.9
python-version: "3.11"
cache: true
cache-dependency-path: ./pyproject.toml
- name: Install dependencies
Expand All @@ -88,11 +88,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"
cache: "pip"
cache-dependency-path: "**/requirements/*"
- name: Install tox
Expand All @@ -117,14 +117,14 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"

- name: Check release
id: check_release
Expand Down
2 changes: 1 addition & 1 deletion docs/content.rst
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ are not included by default in tag, category, and author indexes, nor in the
main article feed. This has the effect of creating an "unlisted" post.

.. _W3C ISO 8601: https://www.w3.org/TR/NOTE-datetime
.. _AsciiDoc: https://www.methods.co.nz/asciidoc/
.. _AsciiDoc: https://asciidoc.org
.. _Pelican Plugins: https://github.com/pelican-plugins
.. _pelican-plugins: https://github.com/getpelican/pelican-plugins
.. _Python-Markdown: https://github.com/Python-Markdown/markdown
Expand Down
15 changes: 15 additions & 0 deletions docs/importer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ not be converted (as Pelican also supports Markdown).
manually, or use a plugin such as `More Categories`_ that enables multiple
categories per article.

.. note::

Imported pages may contain links to images that still point to the original site.
So you might want to download those images into your local content and manually
re-link them from the relevant pages of your site.

Dependencies
============

Expand Down Expand Up @@ -121,6 +127,15 @@ For WordPress::

$ pelican-import --wpfile -o ~/output ~/posts.xml

For Medium (an example of using an RSS feed):

$ python -m pip install feedparser
$ pelican-import --feed https://medium.com/feed/@username

.. note::

The RSS feed may only return the most recent posts — not all of them.

Tests
=====

Expand Down
6 changes: 4 additions & 2 deletions pelican/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ class FatalLogger(LimitLogger):
warnings_fatal = False
errors_fatal = False

# adding `stacklevel=2` means that the displayed filename and line number
# will match the "original" calling location, rather than the wrapper here
def warning(self, *args, **kwargs):
super().warning(*args, **kwargs)
super().warning(*args, stacklevel=2, **kwargs)
if FatalLogger.warnings_fatal:
raise RuntimeError("Warning encountered")

def error(self, *args, **kwargs):
super().error(*args, **kwargs)
super().error(*args, stacklevel=2, **kwargs)
if FatalLogger.errors_fatal:
raise RuntimeError("Error encountered")

Expand Down
3 changes: 2 additions & 1 deletion pelican/tools/templates/Makefile.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ DROPBOX_DIR={{dropbox_dir}}
{% endif %}
{% if github %}
GITHUB_PAGES_BRANCH={{github_pages_branch}}
GITHUB_PAGES_COMMIT_MESSAGE=Generate Pelican site

{% endif %}

Expand Down Expand Up @@ -161,7 +162,7 @@ cf_upload: publish
{% if github %}
{% set upload = upload + ["github"] %}
github: publish
ghp-import -m "Generate Pelican site" -b $(GITHUB_PAGES_BRANCH) "$(OUTPUTDIR)" --no-jekyll
ghp-import -m "$(GITHUB_PAGES_COMMIT_MESSAGE)" -b $(GITHUB_PAGES_BRANCH) "$(OUTPUTDIR)" --no-jekyll
git push origin $(GITHUB_PAGES_BRANCH)

{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{3.8,3.9,3.10,3.11.3.12},docs
envlist = py{3.8,3.9,3.10,3.11,3.12},docs

[testenv]
basepython =
Expand All @@ -18,7 +18,7 @@ commands =
pytest -s --cov=pelican pelican

[testenv:docs]
basepython = python3.9
basepython = python3.11
deps =
-rrequirements/docs.pip
changedir = docs
Expand Down

0 comments on commit 5319001

Please sign in to comment.