mirror of
https://github.com/thomiceli/opengist.git
synced 2026-08-07 07:14:49 +00:00
Add rel="canonical" link tag (#732)
Go CI / Lint (push) Has been cancelled
Go CI / Check (push) Has been cancelled
Go CI / Test (mysql, 1.26, mysql:8, ubuntu-latest, 3306:3306) (push) Has been cancelled
Go CI / Test (postgres, 1.26, postgres:16, ubuntu-latest, 5432:5432) (push) Has been cancelled
Go CI / Test (sqlite, 1.26, macOS-latest) (push) Has been cancelled
Go CI / Test (sqlite, 1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, macOS-latest) (push) Has been cancelled
Go CI / Build (1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, windows-latest) (push) Has been cancelled
Go CI / Lint (push) Has been cancelled
Go CI / Check (push) Has been cancelled
Go CI / Test (mysql, 1.26, mysql:8, ubuntu-latest, 3306:3306) (push) Has been cancelled
Go CI / Test (postgres, 1.26, postgres:16, ubuntu-latest, 5432:5432) (push) Has been cancelled
Go CI / Test (sqlite, 1.26, macOS-latest) (push) Has been cancelled
Go CI / Test (sqlite, 1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, macOS-latest) (push) Has been cancelled
Go CI / Build (1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -158,6 +158,7 @@ func dataInit(next Handler) Handler {
|
||||
}
|
||||
|
||||
ctx.SetData("baseHttpUrl", baseHttpUrl)
|
||||
ctx.SetData("canonicalUrl", baseHttpUrl+ctx.Request().URL.Path)
|
||||
|
||||
return next(ctx)
|
||||
}
|
||||
|
||||
Vendored
+4
@@ -9,6 +9,10 @@
|
||||
|
||||
<base href="{{ $.c.ExternalUrl }}" />
|
||||
|
||||
{{ if .canonicalUrl }}
|
||||
<link rel="canonical" href="{{ .canonicalUrl }}" />
|
||||
{{ end }}
|
||||
|
||||
<script>
|
||||
window.opengist_base_url = "{{ $.c.ExternalUrl }}";
|
||||
window.opengist_locale = "{{ .locale.Code }}".substring(0, 2);
|
||||
|
||||
Reference in New Issue
Block a user