diff --git a/README.md b/README.md index b8fb4a3..1465247 100644 --- a/README.md +++ b/README.md @@ -42,5 +42,5 @@ Feel free to experiment with all of this stuff! - [x] Generation of titles in right sidebar with clickable links - [x] Detections of titles in a page - [x] Custom static page parts by template -- [x] Extended Markdown + Pug support for pages +- [x] _HTML_, _Extended Markdown_, and _Pug_ supported for input page files - [x] Ready for use diff --git a/Source/Modules/Pug.py b/Source/Modules/Pug.py index b2418d2..0b8133d 100644 --- a/Source/Modules/Pug.py +++ b/Source/Modules/Pug.py @@ -20,4 +20,5 @@ def PugCompileList(Pages): Path = 'public/{}'.format(File) WriteFile(Path, Content) Paths += '"{}" '.format(Path) - os.system('pug -P {} > /dev/null'.format(Paths)) + if Paths: + os.system('pug -P {} > /dev/null'.format(Paths)) diff --git a/Source/Modules/Site.py b/Source/Modules/Site.py index b43464a..57f4733 100644 --- a/Source/Modules/Site.py +++ b/Source/Modules/Site.py @@ -117,6 +117,7 @@ def Preprocessor(Path, SiteRoot): 'Style': '', 'Type': '', 'Index': 'True', + 'Feed': 'True', 'Title': '', 'HTMLTitle': '', 'Description': '', @@ -129,7 +130,7 @@ def Preprocessor(Path, SiteRoot): ls = l.lstrip() if ls.startswith('// '): lss = ls[3:] - for Item in ('Template', 'Type', 'Index', 'Title', 'HTMLTitle', 'Description', 'Image', 'CreatedOn', 'EditedOn'): + for Item in ('Template', 'Type', 'Index', 'Feed', 'Title', 'HTMLTitle', 'Description', 'Image', 'CreatedOn', 'EditedOn'): ItemText = '{}: '.format(Item) if lss.startswith(ItemText): Meta[Item] = lss[len(ItemText):] @@ -147,7 +148,6 @@ def Preprocessor(Path, SiteRoot): if Path.endswith('.html') and not HTMLTitlesFound: Soup = BeautifulSoup(File, 'html.parser') Tags = Soup.find_all() - #for t in Soup.find_all(Headings): for t in Tags: if t.name in Headings: Title = '#'*int(t.name[1]) + ' ' + str(t.text) @@ -155,9 +155,7 @@ def Preprocessor(Path, SiteRoot): DashyTitles += [DashTitle] Titles += [Title] t.replace_with(MakeLinkableTitle(None, Title, DashTitle, 'md')) - print(Titles) - Content = str(Soup) - print(Content) + Content = str(Soup.prettify(formatter=None)) HTMLTitlesFound = True elif Path.endswith('.md'): if ls.startswith('#'): @@ -399,7 +397,7 @@ def MakeSite(TemplatesText, PartsText, ContextParts, ContextPartsText, ConfMenu, PagePath = 'public/{}.html'.format(StripExt(File)) if File.endswith('.md'): Content = markdown(Content, extensions=MarkdownExts) - elif File.endswith(('.html','.pug')): + elif File.endswith(('.pug')): Content = ReadFile(PagePath) HTML, ContentHTML, SlimHTML, Description, Image = PatchHTML( File=File, diff --git a/TODO b/TODO index b9e2b31..2166a20 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,2 @@ - Fix arguments - some are only callable from CLI and not Site.ini -- Accept HTML files as input pages - Optionally disabling nesting and folder listing for page lists