diff --git a/Source/Build.py b/Source/Build.py index e3ea86f..1cdfb35 100755 --- a/Source/Build.py +++ b/Source/Build.py @@ -177,10 +177,6 @@ def Main(Args, FeedEntries): FullSite=FeedType, Minify=Minify) - if SitemapOut: - print("[I] Generating Sitemap") - MakeSitemap(OutputDir, Pages, SiteDomain) - if ActivityPub and MastodonURL and MastodonToken and SiteDomain: print("[I] Mastodon Stuff") MastodonPosts = MastodonShare( @@ -217,6 +213,10 @@ def Main(Args, FeedEntries): print("[I] Cleaning Temporary Files") DelTmp(OutputDir) + if SitemapOut: + print("[I] Generating Sitemap") + MakeSitemap(OutputDir, Pages, SiteDomain) + print("[I] Copying Assets") os.system(f"cp -R Assets/* {OutputDir}/") diff --git a/Source/Libs/markdown/core.py b/Source/Libs/markdown/core.py index e89351d..f676907 100644 --- a/Source/Libs/markdown/core.py +++ b/Source/Libs/markdown/core.py @@ -133,21 +133,15 @@ class Markdown: """ Build extension from a string name, then return an instance. - First attempt to load an entry point. The string name must be registered as an entry point in the - `markdown.extensions` group which points to a subclass of the `markdown.extensions.Extension` class. - If multiple distributions have registered the same name, the first one found is returned. - - If no entry point is found, assume dot notation (`path.to.module:ClassName`). Load the specified class and - return an instance. If no class is specified, import the module and call a `makeExtension` function and return - the Extension instance returned by that function. + Don't attempt to load any entrypoint, + as it conflicts with an already installed Python-Markdown. + Assume dot notation (`path.to.module:ClassName`). + Load the specified class and return an instance. If no class is specified, + import the module and call a `makeExtension` function + and return the Extension instance returned by that function. """ configs = dict(configs) - entry_points = [ep for ep in util.INSTALLED_EXTENSIONS if ep.name == ext_name] - if entry_points: - ext = entry_points[0].load() - return ext(**configs) - # Get class name (if provided): `path.to.module:ClassName` ext_name, class_name = ext_name.split(':', 1) if ':' in ext_name else (ext_name, '') diff --git a/Source/Modules/Markdown.py b/Source/Modules/Markdown.py index 18123dd..ec44c78 100644 --- a/Source/Modules/Markdown.py +++ b/Source/Modules/Markdown.py @@ -7,11 +7,7 @@ | Copyright (C) 2022, OctoSpacc | | ================================= """ -# Our local Markdown patches conflict if the module is installed on the system, so first try to import from system -try: - from markdown import markdown -except ModuleNotFoundError: - from Libs.markdown import markdown +from Libs.markdown import markdown MarkdownExtsDefault = ('attr_list', 'def_list', 'footnotes', 'md_in_html', 'tables') diff --git a/Source/Modules/Site.py b/Source/Modules/Site.py index d9d7551..3fe7e6c 100644 --- a/Source/Modules/Site.py +++ b/Source/Modules/Site.py @@ -22,10 +22,10 @@ def DashifyTitle(Title, Done=[]): def MakeLinkableTitle(Line, Title, DashTitle, Type): if Type == 'md': Index = Title.split(' ')[0].count('#') - return f'>> {Title[Index+1:]}' + return f'» {Title[Index+1:]}' elif Type == 'pug': Index = Line.find('h') - return f"{Line[:Index]}{Line[Index:Index+2]}(id='{DashTitle}' class='SectionTitle') #[span(class='SectionLink') #[a(href='#{DashTitle}') #[span >>]] ]{Line[Index+2:]}" + return f"{Line[:Index]}{Line[Index:Index+2]}(id='{DashTitle}' class='SectionTitle') #[span(class='SectionLink') #[a(href='#{DashTitle}') #[span »]] ]{Line[Index+2:]}" def GetTitle(FileName, Meta, Titles, Prefer='MetaTitle', BlogName=None): if Prefer == 'BodyTitle': diff --git a/Source/Modules/Utils.py b/Source/Modules/Utils.py index ff27de6..52ddfff 100644 --- a/Source/Modules/Utils.py +++ b/Source/Modules/Utils.py @@ -95,6 +95,7 @@ def ReplWithEsc(Str, Find, Repl, Esc='\\'): New = New[:-1] New += Repl + e elif Sects[i-1].endswith(Esc): + New = New[:-1] New += Find + e else: New += Repl + e diff --git a/TODO b/TODO index a8ab0f3..cd82e77 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,6 @@ +- Specify input folder(s) and files (idea is Makefile compatibility too) +- Show page size/words/time in meta line +- Add feed support for diary-like pages - Fix excess whitespace in some section/menu titles - Change staticoso service tag enclosure from [] to <> - Investigate a strange bug with Macros @@ -7,7 +10,6 @@ - Accept Macros as CLI arguments - Deprecate FolderRoots (Macros make it redundant) - Fix ordering menu in Site.ini (not working for inner pages) -- Fix Python-Markdown is installed problem (to load our modules) - Feed generation without native libraries - JSON feeds - Full XML sitemap @@ -20,4 +22,5 @@ - Automatic guessing of .htm/.html extension for declarations of templates and stuff - Exporting sites to different formats (?) (single-page HTML, PDF, EPUB, ...) - Disable only ActivityPub feed for a page -- Override ActivityPub URL +- Automatic redirects/symlinks for making pages work without .html suffix +- Override URL for a page / Add custom redirects for it