mirror of https://gitlab.com/octtspacc/staticoso
Feed exclusion for ActivityPub, chage category line spacing
This commit is contained in:
parent
a1239d676b
commit
933061f33f
|
@ -76,7 +76,7 @@ def MastodonShare(InstanceURL, Token, TypeFilter, CategoryFilter, HoursLimit, Pa
|
||||||
if p['Link'] == URL:
|
if p['Link'] == URL:
|
||||||
DoPost = False
|
DoPost = False
|
||||||
break
|
break
|
||||||
if DoPost and (not HoursLimit or (Meta['CreatedOn'] and time.time() - time.mktime(date_parse(Meta['CreatedOn']).timetuple()) < 60*60*HoursLimit)):
|
if DoPost and Meta['Feed'] == 'True' and (not HoursLimit or (Meta['CreatedOn'] and time.time() - time.mktime(date_parse(Meta['CreatedOn']).timetuple()) < 60*60*HoursLimit)):
|
||||||
if not SaidPosting:
|
if not SaidPosting:
|
||||||
print("[I] Posting to Mastodon")
|
print("[I] Posting to Mastodon")
|
||||||
SaidPosting = True
|
SaidPosting = True
|
||||||
|
|
|
@ -68,7 +68,7 @@ def MakeCategoryLine(File, Meta):
|
||||||
Categories = ''
|
Categories = ''
|
||||||
if Meta['Categories']:
|
if Meta['Categories']:
|
||||||
for i in Meta['Categories']:
|
for i in Meta['Categories']:
|
||||||
Categories += '[{}]({}{}.html) '.format(i, GetPathLevels(File) + 'Categories/', i)
|
Categories += ' [{}]({}{}.html) '.format(i, GetPathLevels(File) + 'Categories/', i)
|
||||||
return Categories
|
return Categories
|
||||||
|
|
||||||
def GetHTMLPagesList(Pages, BlogName, SiteRoot, PathPrefix, Unite=[], Type='Page', Category=None, For='Menu', MarkdownExts=(), MenuStyle='Default'):
|
def GetHTMLPagesList(Pages, BlogName, SiteRoot, PathPrefix, Unite=[], Type='Page', Category=None, For='Menu', MarkdownExts=(), MenuStyle='Default'):
|
||||||
|
@ -371,10 +371,10 @@ def MakeSite(TemplatesText, StaticPartsText, DynamicParts, DynamicPartsText, Con
|
||||||
|
|
||||||
PagesPaths = FileNameDateSort(PagesPaths)
|
PagesPaths = FileNameDateSort(PagesPaths)
|
||||||
if Sorting['Pages'] == 'Inverse':
|
if Sorting['Pages'] == 'Inverse':
|
||||||
PagesPaths.reverse() #= RevSort(PagesPaths)
|
PagesPaths.reverse()
|
||||||
PostsPaths = FileNameDateSort(PostsPaths)
|
PostsPaths = FileNameDateSort(PostsPaths)
|
||||||
if Sorting['Posts'] == 'Inverse':
|
if Sorting['Posts'] == 'Inverse':
|
||||||
PostsPaths.reverse() #= RevSort(PostsPaths)
|
PostsPaths.reverse()
|
||||||
|
|
||||||
print("[I] Preprocessing Source Pages")
|
print("[I] Preprocessing Source Pages")
|
||||||
for Type in ['Page', 'Post']:
|
for Type in ['Page', 'Post']:
|
||||||
|
|
|
@ -100,9 +100,6 @@ def NumsFromFileName(Path):
|
||||||
for i,e in enumerate(Name):
|
for i,e in enumerate(Name):
|
||||||
if e.lower() in 'qwfpbjluyarstgmneiozxcdvkh':
|
if e.lower() in 'qwfpbjluyarstgmneiozxcdvkh':
|
||||||
return Name[:i]
|
return Name[:i]
|
||||||
#Split = i
|
|
||||||
#break
|
|
||||||
#return Name[:Split]
|
|
||||||
return Path
|
return Path
|
||||||
|
|
||||||
def RevSort(List):
|
def RevSort(List):
|
||||||
|
@ -110,34 +107,21 @@ def RevSort(List):
|
||||||
List.reverse()
|
List.reverse()
|
||||||
return List
|
return List
|
||||||
|
|
||||||
def FileNameDateSort(Old):
|
def FileNameDateSort(Old): # TODO: Test this for files not starting with date, and dated folders
|
||||||
New = []
|
New = []
|
||||||
Old.sort()
|
Old.sort()
|
||||||
New.insert(0, Old[0])
|
New.insert(0, Old[0])
|
||||||
#print(Old)
|
|
||||||
for i,e in enumerate(Old):
|
for i,e in enumerate(Old):
|
||||||
if i == 0:
|
if i == 0:
|
||||||
continue
|
continue
|
||||||
#print(e)
|
|
||||||
Done = False
|
Done = False
|
||||||
for j,f in enumerate(New):
|
for j,f in enumerate(New):
|
||||||
#print(f)
|
|
||||||
#if NumsFromFileName(e) > NumsFromFileName(f):
|
|
||||||
#print(j, e, f)
|
|
||||||
#print(j, NumsFromFileName(e), NumsFromFileName(f))
|
|
||||||
|
|
||||||
#if NumsFromFileName(e) != e and NumsFromFileName(f) != f and NumsFromFileName(e) > NumsFromFileName(f):
|
|
||||||
if NumsFromFileName(e) != e and NumsFromFileName(f) != f and NumsFromFileName(e) < NumsFromFileName(f):
|
if NumsFromFileName(e) != e and NumsFromFileName(f) != f and NumsFromFileName(e) < NumsFromFileName(f):
|
||||||
#if e.split('/')[-1] > f.split('/')[-1]:
|
|
||||||
#New.insert(j+1, e)
|
|
||||||
New.insert(j, e)
|
New.insert(j, e)
|
||||||
Done = True
|
Done = True
|
||||||
break
|
break
|
||||||
if not Done:
|
if not Done:
|
||||||
#New.insert(0, e)
|
|
||||||
New += [e]
|
New += [e]
|
||||||
#New.reverse()
|
|
||||||
print(New)
|
|
||||||
return New
|
return New
|
||||||
|
|
||||||
def FirstRealItem(List):
|
def FirstRealItem(List):
|
||||||
|
|
Loading…
Reference in New Issue