Add rel.canonical to redirects; Added alias for internal macros

This commit is contained in:
2022-11-02 00:17:36 +01:00
parent f7773ea226
commit 4187e0647d
5 changed files with 14 additions and 5 deletions

View File

@@ -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>
"""

View File

@@ -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: