another bugfix, as article.tags is no longer valid

This commit is contained in:
Tobias Schmidl 2024-10-15 09:01:15 +02:00
parent 0c0bce3688
commit 604f9ff8f2

View file

@ -106,7 +106,7 @@ def ap_article(generator: pelican.ArticlesGenerator, writer: pelican.writers.Wri
path = os.path.join(writer.output_path, 'activitypub/tags', t.slug) path = os.path.join(writer.output_path, 'activitypub/tags', t.slug)
articles = [] articles = []
for article in generator.articles: for article in generator.articles:
if t.name not in article.tags: if t.name not in article.metadata['tags']:
continue continue
articles.append( articles.append(
os.path.join(generator.settings['SITEURL'], 'activitypub/posts', article.slug) os.path.join(generator.settings['SITEURL'], 'activitypub/posts', article.slug)
@ -126,7 +126,7 @@ def ap_article(generator: pelican.ArticlesGenerator, writer: pelican.writers.Wri
aurl = os.path.join(generator.settings['SITEURL'], 'activitypub/posts', article.slug) aurl = os.path.join(generator.settings['SITEURL'], 'activitypub/posts', article.slug)
apath = os.path.join(writer.output_path, 'activitypub/posts', article.slug) apath = os.path.join(writer.output_path, 'activitypub/posts', article.slug)
tags = [] tags = []
for tag in article.tags: for tag in article.metadata.get('tags', []):
tags.append({ tags.append({
'type': 'Hashtag', 'type': 'Hashtag',
'name': '#' + tag.slug, 'name': '#' + tag.slug,