mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Add rel.canonical to redirects; Added alias for internal macros
This commit is contained in:
@ -40,7 +40,7 @@ Needed for Gemtext output support:
|
||||
|
||||
## Features roadmap
|
||||
|
||||
- [ ] HTML feeds (pages with list of N most recent posts)
|
||||
- [x] HTML feeds (pages with list of N most recent posts)
|
||||
- [x] Lists of all pages in a site directory
|
||||
- [x] Page redirects / Alt URLs (+ ActivityPub URL overrides)
|
||||
- [x] Progress bars for the build process!
|
||||
|
@ -248,6 +248,7 @@ def Main(Args, FeedEntries):
|
||||
WriteFile(
|
||||
DestFile,
|
||||
RedirectPageTemplate.format(
|
||||
SiteDomain=SiteDomain,
|
||||
DestURL=DestURL,
|
||||
TitlePrefix=f"{SiteName} - " if SiteName else '',
|
||||
StrClick=Locale['ClickHere'],
|
||||
|
@ -25,11 +25,12 @@ RedirectPageTemplate = """\
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{TitlePrefix}Redirect</title>
|
||||
<meta http-equiv="refresh" content="0; url='{DestURL}'" />
|
||||
<title>{TitlePrefix}Redirect</title>
|
||||
<link rel="canonical" href="{SiteDomain}/{DestURL}">
|
||||
<meta http-equiv="refresh" content="0; url='{DestURL}'">
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="{DestURL}">{StrClick}</a> {StrRedirect}.</p>
|
||||
<p><a href="{DestURL}">{StrClick}</a> {StrRedirect}.</p>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
@ -347,6 +347,7 @@ def PatchHTML(File, HTML, StaticPartsText, DynamicParts, DynamicPartsText, HTMLP
|
||||
for e in Meta['Macros']:
|
||||
HTML = ReplWithEsc(HTML, f"[:{e}:]", Meta['Macros'][e])
|
||||
for e in FolderRoots:
|
||||
HTML = ReplWithEsc(HTML, f"<staticoso:CustomPath:{e}>", FolderRoots[e])
|
||||
HTML = ReplWithEsc(HTML, f"[staticoso:Folder:{e}:AbsoluteRoot]", FolderRoots[e])
|
||||
HTML = ReplWithEsc(HTML, f"<staticoso:Folder:{e}:AbsoluteRoot>", FolderRoots[e])
|
||||
for e in Categories:
|
||||
@ -362,6 +363,7 @@ def PatchHTML(File, HTML, StaticPartsText, DynamicParts, DynamicPartsText, HTMLP
|
||||
'<staticoso:PageTitle>': Title,
|
||||
'[staticoso:Page:Description]': Description,
|
||||
'<staticoso:PageDescription>': Description,
|
||||
'<staticoso:SiteDomain>': SiteDomain,
|
||||
'[staticoso:Site:Name]': SiteName,
|
||||
'<staticoso:SiteName>': SiteName,
|
||||
'[staticoso:Site:AbsoluteRoot]': SiteRoot,
|
||||
@ -372,6 +374,7 @@ def PatchHTML(File, HTML, StaticPartsText, DynamicParts, DynamicPartsText, HTMLP
|
||||
for e in Meta['Macros']:
|
||||
ContentHTML = ReplWithEsc(ContentHTML, f"[:{e}:]", Meta['Macros'][e])
|
||||
for e in FolderRoots:
|
||||
ContentHTML = ReplWithEsc(ContentHTML, f"<staticoso:CustomPath:{e}>", FolderRoots[e])
|
||||
ContentHTML = ReplWithEsc(ContentHTML, f"[staticoso:Folder:{e}:AbsoluteRoot]", FolderRoots[e])
|
||||
ContentHTML = ReplWithEsc(ContentHTML, f"<staticoso:Folder:{e}:AbsoluteRoot>", FolderRoots[e])
|
||||
for e in Categories:
|
||||
|
6
TODO
6
TODO
@ -1,5 +1,9 @@
|
||||
- Release on pip
|
||||
- Alert for deprecated features
|
||||
- WriteFreely/Wordpress/Blogger integration for reposting+comments
|
||||
- Fix comment box not appearing in pages with changed URL
|
||||
- Set categories for all files in a folder and subfolder
|
||||
- Pages with lists of all posts and all pages (? the folder categories thing might make it redundant?)
|
||||
- Pages with lists of all posts and all pages (? the folder lists thing might make it redundant?)
|
||||
- Fix title detection:
|
||||
- Don't consider titles in code/comment blocks
|
||||
- Consider titles in lists (title marker preceded by chars)
|
||||
|
Reference in New Issue
Block a user