mirror of https://gitlab.com/octtspacc/staticoso
Allow a page to be excluded from feeds, + some minor tweaks
This commit is contained in:
parent
b5fe32a2a0
commit
37e6da8f4f
|
@ -72,7 +72,6 @@ def GetConfMenu(Entries, MarkdownExts):
|
||||||
def Main(Args, FeedEntries):
|
def Main(Args, FeedEntries):
|
||||||
HavePages, HavePosts = False, False
|
HavePages, HavePosts = False, False
|
||||||
SiteConf = LoadConfFile('Site.ini')
|
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 ''
|
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 ''
|
BlogName = Args.BlogName if Args.BlogName else ReadConf(SiteConf, 'Site', 'BlogName') if ReadConf(SiteConf, 'Site', 'BlogName') else ''
|
||||||
|
|
|
@ -51,7 +51,6 @@ def MastodonGetAllLinkPosts(Session, Domain=None):
|
||||||
Posts += [Post]
|
Posts += [Post]
|
||||||
return Posts
|
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):
|
def MastodonShare(InstanceURL, Token, TypeFilter, CategoryFilter, HoursLimit, Pages, SiteDomain, SiteLang, Locale):
|
||||||
SaidPosting = False
|
SaidPosting = False
|
||||||
Session = MastodonGetSession(InstanceURL, Token)
|
Session = MastodonGetSession(InstanceURL, Token)
|
||||||
|
@ -81,7 +80,7 @@ def MastodonShare(InstanceURL, Token, TypeFilter, CategoryFilter, HoursLimit, Pa
|
||||||
if not SaidPosting:
|
if not SaidPosting:
|
||||||
print("[I] Posting to Mastodon")
|
print("[I] Posting to Mastodon")
|
||||||
SaidPosting = True
|
SaidPosting = True
|
||||||
time.sleep(5)
|
time.sleep(5) # Prevent flooding
|
||||||
Post = MastodonGetLinkFromPost(
|
Post = MastodonGetLinkFromPost(
|
||||||
Post=MastodonDoPost(
|
Post=MastodonDoPost(
|
||||||
Session,
|
Session,
|
||||||
|
|
|
@ -25,7 +25,7 @@ def MakeFeed(CategoryFilter, Pages, SiteName, SiteTagline, SiteDomain, MaxEntrie
|
||||||
|
|
||||||
DoPages = []
|
DoPages = []
|
||||||
for e in Pages:
|
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]
|
DoPages += [e]
|
||||||
MaxEntries -= 1
|
MaxEntries -= 1
|
||||||
DoPages.reverse()
|
DoPages.reverse()
|
||||||
|
|
|
@ -62,7 +62,7 @@ def MakeContentHeader(Meta, Locale, Categories=''):
|
||||||
Header += '{} {} \n'.format(Locale[i], Meta[i])
|
Header += '{} {} \n'.format(Locale[i], Meta[i])
|
||||||
if Categories:
|
if Categories:
|
||||||
Header += '{}: {} \n'.format(Locale['Categories'], Categories)
|
Header += '{}: {} \n'.format(Locale['Categories'], Categories)
|
||||||
return markdown(Header)
|
return markdown(Header.rstrip())
|
||||||
|
|
||||||
def MakeCategoryLine(File, Meta):
|
def MakeCategoryLine(File, Meta):
|
||||||
Categories = ''
|
Categories = ''
|
||||||
|
|
5
TODO
5
TODO
|
@ -1,3 +1,4 @@
|
||||||
|
- Fix sorting by date for files in different folders
|
||||||
- Make alt text for images also be title text
|
- Make alt text for images also be title text
|
||||||
- Custom category names showing in header links
|
- Custom category names showing in header links
|
||||||
- Fix arguments - some are only callable from CLI and not Site.ini
|
- Fix arguments - some are only callable from CLI and not Site.ini
|
||||||
|
@ -10,5 +11,7 @@
|
||||||
- Full XML sitemap
|
- Full XML sitemap
|
||||||
- SCSS support
|
- SCSS support
|
||||||
- Images in post listings
|
- 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
|
- Fix feed titles and page title ids
|
||||||
|
- Use filename as page title if it is missing
|
||||||
|
- Hybrid global+page menu (like on documentation generators)
|
||||||
|
|
Loading…
Reference in New Issue