Skip to content

Broken External Footer Links due to relLangURL Filter #554

Description

@aniket866

Describe the bug

Description

The footer layout filters external absolute menu links using the relLangURL filter.

  • File Link: themes/microcks/layouts/partials/footer.html and line 40
  • Code Snippet:
    <a href="{{ .URL | relLangURL }}" title="{{ .Name }}">{{ .Name }}</a>

Why It Breaks

The footer contains absolute external links, such as the Linux Foundation privacy policy URL: https://www.linuxfoundation.org/legal/privacy-policy. Passing this absolute URL into the relLangURL filter corrupts the URL into a malformed relative path prefix (e.g. /https:/www.linuxfoundation.org/legal/privacy-policy). Clicking this link causes a 404 error on the local host instead of opening the external web page.

How to Reproduce

  1. Build the website and scroll to the footer.
  2. Click on the "Privacy Policy" or "Terms & Conditions" links.
  3. Observe that the browser redirects to a broken 404 page on microcks.io rather than the external Linux Foundation website.

Reproduction Flow

sequenceDiagram
    actor User as Site Visitor
    participant Site as Footer Link
    participant Browser as Web Browser
    User->>Site: Clicks "Privacy Policy"
    Note over Site: Evaluates URL: "https://www.linuxfoundation.org/..." | relLangURL
    Site->>Browser: Opens "/https:/www.linuxfoundation.org/legal/privacy-policy"
    Browser->>Browser: Requests host web server
    Browser-->>User: Renders 404 Not Found Page
Loading

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions