Skip to content

Commit

Permalink
🐛 fix(footer): fix external link redirection in footer (#219)
Browse files Browse the repository at this point in the history
Co-authored-by: welpo <[email protected]>
  • Loading branch information
joberthrogers18 and welpo authored Oct 31, 2023
1 parent 7752bc3 commit de91dfb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ footer_menu = [
{url = "about", name = "about", trailing_slash = true},
# {url = "privacy", name = "privacy", trailing_slash = true},
{url = "sitemap.xml", name = "sitemap", trailing_slash = false},
# {url = "https://example.com", name = "external link", trailing_slash = true},
]

# Enable a copyright notice for the footer, shown between socials and the "Powered by" text.
Expand Down
1 change: 1 addition & 0 deletions content/blog/mastering-tabi-settings/index.ca.md
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ footer_menu = [
{url = "about", name = "about", trailing_slash = true},
{url = "privacy", name = "privacy", trailing_slash = true},
{url = "sitemap.xml", name = "sitemap", trailing_slash = false},
{url = "https://example.com", name = "external link", trailing_slash = true},
]
```

Expand Down
1 change: 1 addition & 0 deletions content/blog/mastering-tabi-settings/index.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ footer_menu = [
{url = "about", name = "about", trailing_slash = true},
{url = "privacy", name = "privacy", trailing_slash = true},
{url = "sitemap.xml", name = "sitemap", trailing_slash = false},
{url = "https://example.com", name = "external link", trailing_slash = true},
]
```

Expand Down
1 change: 1 addition & 0 deletions content/blog/mastering-tabi-settings/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ footer_menu = [
{url = "about", name = "about", trailing_slash = true},
{url = "privacy", name = "privacy", trailing_slash = true},
{url = "sitemap.xml", name = "sitemap", trailing_slash = false},
{url = "https://example.com", name = "external link", trailing_slash = true},
]
```

Expand Down
6 changes: 6 additions & 0 deletions templates/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@

{%- if menu.url == "sitemap.xml" -%}
{%- set url = get_url(path=menu.url, trailing_slash=trailing_slash) -%}
{%- elif menu.url is starting_with("http") -%}
{%- if menu.trailing_slash -%}
{%- set url = menu.url ~ "/" -%}
{%- else -%}
{%- set url = menu.url -%}
{%- endif -%}
{%- else -%}
{%- set url = get_url(path=menu.url, lang=lang, trailing_slash=trailing_slash) -%}
{%- endif -%}
Expand Down
1 change: 1 addition & 0 deletions theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ encode_plaintext_email = true # Setting is ignored if email is already encoded.
# {url = "about", name = "about", trailing_slash = true},
# {url = "privacy", name = "privacy", trailing_slash = true},
# {url = "sitemap.xml", name = "sitemap", trailing_slash = false},
# {url = "https://example.com", name = "external link", trailing_slash = true},
# ]

# Enable a copyright notice for the footer, shown between socials and the "Powered by" text.
Expand Down

0 comments on commit de91dfb

Please sign in to comment.