mirror of
				https://gitlab.com/octtspacc/staticoso
				synced 2025-06-05 22:09:23 +02:00 
			
		
		
		
	Some fixes
This commit is contained in:
		| @@ -88,7 +88,8 @@ def Main(Args, FeedEntries): | |||||||
| 	AutoCategories = StringBoolChoose(False, Args.AutoCategories, ReadConf(SiteConf, 'Site', 'AutoCategories')) | 	AutoCategories = StringBoolChoose(False, Args.AutoCategories, ReadConf(SiteConf, 'Site', 'AutoCategories')) | ||||||
| 	NoScripts = StringBoolChoose(False, Args.NoScripts, ReadConf(SiteConf, 'Site', 'NoScripts')) | 	NoScripts = StringBoolChoose(False, Args.NoScripts, ReadConf(SiteConf, 'Site', 'NoScripts')) | ||||||
| 	GemtextOut = StringBoolChoose(False, Args.GemtextOut, ReadConf(SiteConf, 'Site', 'GemtextOut')) | 	GemtextOut = StringBoolChoose(False, Args.GemtextOut, ReadConf(SiteConf, 'Site', 'GemtextOut')) | ||||||
| 	SitemapOut = StringBoolChoose(False, Args.SitemapOut, ReadConf(SiteConf, 'Site', 'SitemapOut')) | 	SitemapOut = StringBoolChoose(True, Args.SitemapOut, ReadConf(SiteConf, 'Site', 'SitemapOut')) | ||||||
|  | 	FeedEntries = int(FeedEntries) if FeedEntries and FeedEntries != 'Default' else int(ReadConf(SiteConf, 'Site', 'FeedEntries')) if ReadConf(SiteConf, 'Site', 'FeedEntries') else 10 | ||||||
|  |  | ||||||
| 	MenuEntries = ReadConf(SiteConf, 'Menu') | 	MenuEntries = ReadConf(SiteConf, 'Menu') | ||||||
| 	if MenuEntries: | 	if MenuEntries: | ||||||
| @@ -111,7 +112,7 @@ def Main(Args, FeedEntries): | |||||||
|  |  | ||||||
| 	if not HavePages and not HavePosts: | 	if not HavePages and not HavePosts: | ||||||
| 		print("[E] No Pages or posts found. Nothing to do, exiting!") | 		print("[E] No Pages or posts found. Nothing to do, exiting!") | ||||||
| 		exit() | 		exit(1) | ||||||
|  |  | ||||||
| 	print("[I] Generating HTML") | 	print("[I] Generating HTML") | ||||||
| 	Pages = MakeSite( | 	Pages = MakeSite( | ||||||
| @@ -210,7 +211,7 @@ if __name__ == '__main__': | |||||||
| 	Parser.add_argument('--GemtextHeader', type=str) | 	Parser.add_argument('--GemtextHeader', type=str) | ||||||
| 	Parser.add_argument('--SiteTagline', type=str) | 	Parser.add_argument('--SiteTagline', type=str) | ||||||
| 	Parser.add_argument('--SitemapOut', type=str) | 	Parser.add_argument('--SitemapOut', type=str) | ||||||
| 	Parser.add_argument('--FeedEntries', type=int) | 	Parser.add_argument('--FeedEntries', type=str) | ||||||
| 	Parser.add_argument('--FolderRoots', type=str) | 	Parser.add_argument('--FolderRoots', type=str) | ||||||
| 	Parser.add_argument('--DynamicParts', type=str) | 	Parser.add_argument('--DynamicParts', type=str) | ||||||
| 	Parser.add_argument('--MarkdownExts', type=str) | 	Parser.add_argument('--MarkdownExts', type=str) | ||||||
| @@ -225,7 +226,7 @@ if __name__ == '__main__': | |||||||
| 	try: | 	try: | ||||||
| 		import lxml | 		import lxml | ||||||
| 		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 else 'Default' | ||||||
| 	except: | 	except: | ||||||
| 		print("[E] Can't load the XML libraries. XML Feeds Generation is Disabled. Make sure the 'lxml' library is installed.") | 		print("[E] Can't load the XML libraries. XML Feeds Generation is Disabled. Make sure the 'lxml' library is installed.") | ||||||
| 		FeedEntries = 0 | 		FeedEntries = 0 | ||||||
|   | |||||||
| @@ -369,12 +369,14 @@ def MakeSite(TemplatesText, StaticPartsText, DynamicParts, DynamicPartsText, Con | |||||||
| 		for File in Path('Posts').rglob(f"*.{Ext}"): | 		for File in Path('Posts').rglob(f"*.{Ext}"): | ||||||
| 			PostsPaths += [FileToStr(File, 'Posts/')] | 			PostsPaths += [FileToStr(File, 'Posts/')] | ||||||
|  |  | ||||||
| 	PagesPaths = FileNameDateSort(PagesPaths) | 	if PagesPaths: | ||||||
| 	if Sorting['Pages'] == 'Inverse': | 		PagesPaths = FileNameDateSort(PagesPaths) | ||||||
| 		PagesPaths.reverse() | 		if Sorting['Pages'] == 'Inverse': | ||||||
| 	PostsPaths = FileNameDateSort(PostsPaths) | 			PagesPaths.reverse() | ||||||
| 	if Sorting['Posts'] == 'Inverse': | 	if PostsPaths: | ||||||
| 		PostsPaths.reverse() | 		PostsPaths = FileNameDateSort(PostsPaths) | ||||||
|  | 		if Sorting['Posts'] == 'Inverse': | ||||||
|  | 			PostsPaths.reverse() | ||||||
|  |  | ||||||
| 	print("[I] Preprocessing Source Pages") | 	print("[I] Preprocessing Source Pages") | ||||||
| 	for Type in ['Page', 'Post']: | 	for Type in ['Page', 'Post']: | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								TODO
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								TODO
									
									
									
									
									
								
							| @@ -20,3 +20,5 @@ | |||||||
| - Category-based feeds | - Category-based feeds | ||||||
| - Automatic guessing of .htm/.html extension for declarations of templates and stuff | - Automatic guessing of .htm/.html extension for declarations of templates and stuff | ||||||
| - Handle file extensions without case-sensitivity | - Handle file extensions without case-sensitivity | ||||||
|  | - Proper multi-language support | ||||||
|  | - Exporting sites to different formats (?) (single-page HTML, PDF, EPUB, ...) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user