mirror of https://gitlab.com/octtspacc/staticoso
Bugfixes
This commit is contained in:
parent
b71525223b
commit
2a8f563a63
|
@ -28,6 +28,7 @@ try:
|
||||||
from Modules.ActivityPub import *
|
from Modules.ActivityPub import *
|
||||||
ActivityPub = True
|
ActivityPub = True
|
||||||
except:
|
except:
|
||||||
|
print("[E] Can't load the ActivityPub module. Its use is disabled. Make sure the 'requests' library is installed.")
|
||||||
ActivityPub = False
|
ActivityPub = False
|
||||||
|
|
||||||
from Modules.Gemini import *
|
from Modules.Gemini import *
|
||||||
|
@ -96,10 +97,9 @@ def MakeListTitle(File, Meta, Titles, Prefer, SiteRoot, PathPrefix=''):
|
||||||
Title = '[{}]({})'.format(
|
Title = '[{}]({})'.format(
|
||||||
Title,
|
Title,
|
||||||
'{}{}.html'.format(PathPrefix, StripExt(File)))
|
'{}{}.html'.format(PathPrefix, StripExt(File)))
|
||||||
if Meta['Type'] == 'Post' and Meta['CreatedOn']:
|
if Meta['Type'] == 'Post':
|
||||||
Title = '[{}] {}'.format(
|
CreatedOn = Meta['CreatedOn'] if Meta['CreatedOn'] else '?'
|
||||||
Meta['CreatedOn'],
|
Title = '[{}] {}'.format(CreatedOn, Title)
|
||||||
Title)
|
|
||||||
return Title
|
return Title
|
||||||
|
|
||||||
def FormatTitles(Titles):
|
def FormatTitles(Titles):
|
||||||
|
@ -381,20 +381,14 @@ def MakeSite(TemplatesText, PartsText, ContextParts, ContextPartsText, SiteName,
|
||||||
if Categories:
|
if Categories:
|
||||||
print("[I] Generating Category Lists")
|
print("[I] Generating Category Lists")
|
||||||
for Category in Categories:
|
for Category in Categories:
|
||||||
Categories[Category] = GetHTMLPagesList(
|
for Type in ('Page', 'Post'):
|
||||||
Pages=Pages,
|
Categories[Category] += GetHTMLPagesList(
|
||||||
SiteRoot=SiteRoot,
|
Pages=Pages,
|
||||||
PathPrefix=GetLevels('Categories/'),
|
SiteRoot=SiteRoot,
|
||||||
Type='Page',
|
PathPrefix=GetLevels('Categories/'),
|
||||||
Category=Category,
|
Type=Type,
|
||||||
For='Categories')
|
Category=Category,
|
||||||
Categories[Category] += GetHTMLPagesList(
|
For='Categories')
|
||||||
Pages=Pages,
|
|
||||||
SiteRoot=SiteRoot,
|
|
||||||
PathPrefix=GetLevels('Categories/'),
|
|
||||||
Type='Post',
|
|
||||||
Category=Category,
|
|
||||||
For='Categories')
|
|
||||||
|
|
||||||
print("[I] Writing Pages")
|
print("[I] Writing Pages")
|
||||||
for File, Content, Titles, Meta in Pages:
|
for File, Content, Titles, Meta in Pages:
|
||||||
|
@ -539,6 +533,7 @@ if __name__ == '__main__':
|
||||||
Parser.add_argument('--MarkdownExts', type=str)
|
Parser.add_argument('--MarkdownExts', type=str)
|
||||||
Parser.add_argument('--MastodonURL', type=str)
|
Parser.add_argument('--MastodonURL', type=str)
|
||||||
Parser.add_argument('--MastodonToken', type=str)
|
Parser.add_argument('--MastodonToken', type=str)
|
||||||
|
Parser.add_argument('--AutoCategories', type=bool)
|
||||||
Args = Parser.parse_args()
|
Args = Parser.parse_args()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -546,7 +541,7 @@ if __name__ == '__main__':
|
||||||
from Modules.Feed import *
|
from Modules.Feed import *
|
||||||
FeedEntries = Args.FeedEntries if Args.FeedEntries or Args.FeedEntries == 0 else 10
|
FeedEntries = Args.FeedEntries if Args.FeedEntries or Args.FeedEntries == 0 else 10
|
||||||
except:
|
except:
|
||||||
print("[E] Can't load the Atom/RSS feed libraries. Their generation is disabled.")
|
print("[E] Can't load the Atom/RSS feed libraries. Their generation is disabled. Make sure the 'lxml' library is installed.")
|
||||||
FeedEntries = 0
|
FeedEntries = 0
|
||||||
|
|
||||||
Main(
|
Main(
|
||||||
|
|
|
@ -40,7 +40,7 @@ def StripExt(Path):
|
||||||
|
|
||||||
def UndupeStr(Str, Known, Split):
|
def UndupeStr(Str, Known, Split):
|
||||||
while Str in Known:
|
while Str in Known:
|
||||||
Sections = Title.split(Split)
|
Sections = Str.split(Split)
|
||||||
try:
|
try:
|
||||||
Sections[-1] = str(int(Sections[-1]) + 1)
|
Sections[-1] = str(int(Sections[-1]) + 1)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
Loading…
Reference in New Issue