Explorar o código

Added Canonical URL to Profile, Issues and Repo which Closes #55

Yoginth %!s(int64=7) %!d(string=hai) anos
pai
achega
a4be4ab8df
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      templates/base/meta.tmpl

+ 9 - 0
templates/base/meta.tmpl

@@ -4,7 +4,16 @@
 <meta name="_suburl" content="{{AppSubURL}}" />
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
 <meta name="hostname" content="{{AppURL}}">
+
+{{if .PageIsUserProfile}}
+<link rel="canonical" href="{{.Owner.HTMLURL}}" />
+{{else if .PageIsIssueConversation}}
+<link rel="canonical" href="{{$.Link}}/{{.Index}}" />
+{{else if .Repository}}
+<link rel="canonical" href="{{.Repository.HTMLURL}}" />
+{{else}}
 <link rel="canonical" href="{{AppURL}}" />
+{{end}}
 
 {{if .PageIsAdmin}}
 {{else if .PageIsUserProfile}}