Merge branch 'master' into fix_3216

This commit is contained in:
Justin Mayer 2024-05-30 07:37:05 +02:00 committed by GitHub
commit 7d434c7ba0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 25 additions and 11 deletions

View file

@ -1,3 +1,4 @@
# Workflow for publishing to GitHub Pages. **NO OFFICIAL SUPPORT PROVIDED.**
name: Deploy to GitHub Pages
on:
workflow_call:

View file

@ -1008,6 +1008,11 @@ the ``TAG_FEED_ATOM`` and ``TAG_FEED_RSS`` settings:
to ``False``, the full content will be included instead. This setting
doesn't affect Atom feeds, only RSS ones.
.. data:: FEED_APPEND_REF = False
If set to ``True``, ``?ref=feed`` will be appended to links in generated
feeds for the purpose of referrer tracking.
If you don't want to generate some or any of these feeds, set the above
variables to ``None``.

View file

@ -126,8 +126,9 @@ branch of your GitHub repository::
Publishing to GitHub Pages Using a Custom GitHub Actions Workflow
-----------------------------------------------------------------
Pelican comes with a `custom workflow <https://github.com/getpelican/pelican/blob/master/.github/workflows/github_pages.yml>`_
for publishing a Pelican site. To use it:
Pelican-powered sites can be published to GitHub Pages via a `custom workflow
<https://github.com/getpelican/pelican/blob/master/.github/workflows/github_pages.yml>`_.
**No official support is provided** for this community-submitted workflow. To use it:
1. Enable GitHub Pages in your repo: go to **Settings → Pages** and choose
**GitHub Actions** for the **Source** setting.

View file

@ -52,6 +52,7 @@ DEFAULT_CONFIG = {
"TRANSLATION_FEED_ATOM": "feeds/all-{lang}.atom.xml",
"FEED_MAX_ITEMS": 100,
"RSS_FEED_SUMMARY_ONLY": True,
"FEED_APPEND_REF": False,
"SITEURL": "",
"SITENAME": "A Pelican Blog",
"DISPLAY_PAGES_ON_MENU": True,

View file

@ -23,9 +23,17 @@ from pelican.tests.support import (
from pelican.writers import Writer
class TestUtils(LoggedTestCase):
class ClassDeprAttr:
_new_attribute = "new_value"
@utils.deprecated_attribute(
old="_old_attribute", new="_new_attribute", since=(3, 1, 0), remove=(4, 1, 3)
)
def _old_attribute():
return None
class TestUtils(LoggedTestCase):
def setUp(self):
super().setUp()
self.temp_output = mkdtemp(prefix="pelicantests.")
@ -34,15 +42,10 @@ class TestUtils(LoggedTestCase):
super().tearDown()
shutil.rmtree(self.temp_output)
@utils.deprecated_attribute(
old="_old_attribute", new="_new_attribute", since=(3, 1, 0), remove=(4, 1, 3)
)
def _old_attribute():
return None
def test_deprecated_attribute(self):
value = self._old_attribute
self.assertEqual(value, self._new_attribute)
test_class = ClassDeprAttr()
value = test_class._old_attribute
self.assertEqual(value, test_class._new_attribute)
self.assertLogCountEqual(
count=1,
msg=(

View file

@ -52,6 +52,9 @@ class Writer:
title = Markup(item.title).striptags()
link = self.urljoiner(self.site_url, item.url)
if self.settings["FEED_APPEND_REF"]:
link = link + "?ref=feed"
if isinstance(feed, Rss201rev2Feed):
# RSS feeds use a single tag called 'description' for both the full
# content and the summary