mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Transition to monorepo on a new Dev branch
This commit is contained in:
19
App/Source/Modules/Sitemap.py
Normal file
19
App/Source/Modules/Sitemap.py
Normal file
@ -0,0 +1,19 @@
|
||||
""" ================================= |
|
||||
| This file is part of |
|
||||
| staticoso |
|
||||
| Just a simple Static Site Generator |
|
||||
| |
|
||||
| Licensed under the AGPLv3 license |
|
||||
| Copyright (C) 2022, OctoSpacc |
|
||||
| ================================= """
|
||||
|
||||
from urllib.parse import quote as URLEncode
|
||||
from Modules.Utils import *
|
||||
|
||||
def MakeSitemap(Flags, Pages):
|
||||
Map = ''
|
||||
Domain = Flags['SiteDomain'] + '/' if Flags['SiteDomain'] else ''
|
||||
for File, Content, Titles, Meta, ContentHTML, SlimHTML, Description, Image in Pages:
|
||||
File = f"{StripExt(File)}.html"
|
||||
Map += Domain + URLEncode(File) + '\n'
|
||||
WriteFile(f"{Flags['OutDir']}/sitemap.txt", Map)
|
Reference in New Issue
Block a user