瀏覽代碼

Reduce the number of items in the feed to 30

Hopefully a good compromise when you discover it
master
David Larlet 3 年之前
父節點
當前提交
c970575e3f
共有 2 個檔案被更改,包括 3 行新增2273 行删除
  1. 0
    2272
      david/log/index.xml
  2. 3
    1
      site.py

+ 0
- 2272
david/log/index.xml
文件差異過大導致無法顯示
查看文件


+ 3
- 1
site.py 查看文件

@@ -32,6 +32,7 @@ LOCAL_DOMAIN = "http://larlet.test:3579"
NORMALIZED_STRFTIME = "%Y-%m-%dT12:00:00+01:00"
TODAY = datetime.today() + timedelta(hours=6)
PUBLICATION_BUFFER = TODAY - timedelta(days=7)
NB_ITEMS_IN_FEED = 30


class MarkParser(mistune.InlineParser):
@@ -297,8 +298,9 @@ def home():
def feed():
"""Generate a feed from last published items."""
template = environment.get_template("feed.xml")
page_list = Page.all(source=DAVID / "2021" / "sources", with_h2_anchors=False)
content = template.render(
page_list=Page.all(source=DAVID / "2021" / "sources", with_h2_anchors=False),
page_list=page_list[:NB_ITEMS_IN_FEED],
current_dt=TODAY.strftime(NORMALIZED_STRFTIME),
BASE_URL=f"{DOMAIN}/david/",
)

Loading…
取消
儲存