alias: fix redirect URLs in case of empty BaseURL #562

This commit is contained in:
Sören Weber 2023-06-09 11:11:00 +02:00
parent e3ac6efd7c
commit 35a4fd83ef
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -1,7 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
{{- $url := replace (replace .Permalink site.BaseURL "/") "//" "/" }} {{- $url := .Permalink }}
{{- if site.BaseURL }}
{{- $url = replace .Permalink site.BaseURL "/" }}
{{- end }}
{{- $url = replace $url "//" "/" }}
{{- with site.Home.GetPage $url }} {{- with site.Home.GetPage $url }}
{{- $c := "" }}{{/* if defaultContentLanguageInSubdir=false we are ending here for home page of the default language */}} {{- $c := "" }}{{/* if defaultContentLanguageInSubdir=false we are ending here for home page of the default language */}}
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }} {{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}