From 37e6da8f4fc93281294495501e22d53ae6e63c1f Mon Sep 17 00:00:00 2001 From: octospacc Date: Sat, 13 Aug 2022 16:20:26 +0200 Subject: [PATCH] Allow a page to be excluded from feeds, + some minor tweaks --- Source/Build.py | 1 - Source/Modules/ActivityPub.py | 3 +-- Source/Modules/Feed.py | 2 +- Source/Modules/Site.py | 2 +- TODO | 5 ++++- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Build.py b/Source/Build.py index 1ab1392..5b2532a 100755 --- a/Source/Build.py +++ b/Source/Build.py @@ -72,7 +72,6 @@ def GetConfMenu(Entries, MarkdownExts): def Main(Args, FeedEntries): HavePages, HavePosts = False, False SiteConf = LoadConfFile('Site.ini') - #TemplatesConf = LoadConfFile('Templates.ini') SiteName = Args.SiteName if Args.SiteName else ReadConf(SiteConf, 'Site', 'Name') if ReadConf(SiteConf, 'Site', 'Name') else '' BlogName = Args.BlogName if Args.BlogName else ReadConf(SiteConf, 'Site', 'BlogName') if ReadConf(SiteConf, 'Site', 'BlogName') else '' diff --git a/Source/Modules/ActivityPub.py b/Source/Modules/ActivityPub.py index 4ab5a37..5285a4c 100644 --- a/Source/Modules/ActivityPub.py +++ b/Source/Modules/ActivityPub.py @@ -51,7 +51,6 @@ def MastodonGetAllLinkPosts(Session, Domain=None): Posts += [Post] return Posts -# TODO: Set a limit/cooldown on how many new posts at a time can be posted, or ignore posts older than date X.. otherwise if someone starts using this after having written 100 blog posts, bad things will happen def MastodonShare(InstanceURL, Token, TypeFilter, CategoryFilter, HoursLimit, Pages, SiteDomain, SiteLang, Locale): SaidPosting = False Session = MastodonGetSession(InstanceURL, Token) @@ -81,7 +80,7 @@ def MastodonShare(InstanceURL, Token, TypeFilter, CategoryFilter, HoursLimit, Pa if not SaidPosting: print("[I] Posting to Mastodon") SaidPosting = True - time.sleep(5) + time.sleep(5) # Prevent flooding Post = MastodonGetLinkFromPost( Post=MastodonDoPost( Session, diff --git a/Source/Modules/Feed.py b/Source/Modules/Feed.py index bccca31..d73580f 100644 --- a/Source/Modules/Feed.py +++ b/Source/Modules/Feed.py @@ -25,7 +25,7 @@ def MakeFeed(CategoryFilter, Pages, SiteName, SiteTagline, SiteDomain, MaxEntrie DoPages = [] for e in Pages: - if FullSite or (not FullSite and MaxEntries != 0 and e[3]['Type'] == 'Post'): # No entry limit if site feed + if FullSite or (not FullSite and MaxEntries != 0 and e[3]['Type'] == 'Post' and e[3]['Feed'] == 'True'): # No entry limit if site feed DoPages += [e] MaxEntries -= 1 DoPages.reverse() diff --git a/Source/Modules/Site.py b/Source/Modules/Site.py index 0bd9a2c..c89b779 100644 --- a/Source/Modules/Site.py +++ b/Source/Modules/Site.py @@ -62,7 +62,7 @@ def MakeContentHeader(Meta, Locale, Categories=''): Header += '{} {} \n'.format(Locale[i], Meta[i]) if Categories: Header += '{}: {} \n'.format(Locale['Categories'], Categories) - return markdown(Header) + return markdown(Header.rstrip()) def MakeCategoryLine(File, Meta): Categories = '' diff --git a/TODO b/TODO index db0146f..a1db31b 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ +- Fix sorting by date for files in different folders - Make alt text for images also be title text - Custom category names showing in header links - Fix arguments - some are only callable from CLI and not Site.ini @@ -10,5 +11,7 @@ - Full XML sitemap - SCSS support - Images in post listings -- Fix HTML and TXT input pages +- Fix HTML (and HTM) and TXT input pages - Fix feed titles and page title ids +- Use filename as page title if it is missing +- Hybrid global+page menu (like on documentation generators)