mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-10 00:20:35 +03:00
add canonical tag
This commit is contained in:
parent
6e6a8f5c07
commit
79ff34c213
|
@ -2,6 +2,7 @@ include ./header
|
||||||
include ./mixins.jade
|
include ./mixins.jade
|
||||||
|
|
||||||
- var Page = InitPage(Site, Authors.spacy, "home", '404')
|
- var Page = InitPage(Site, Authors.spacy, "home", '404')
|
||||||
|
- Page.canonical_url = null
|
||||||
- Page.is_error = true
|
- Page.is_error = true
|
||||||
- Site.slogan = "404"
|
- Site.slogan = "404"
|
||||||
- Page.active = {}
|
- Page.active = {}
|
||||||
|
|
|
@ -28,8 +28,10 @@
|
||||||
- Page.links = [];
|
- Page.links = [];
|
||||||
- if (type == "home") {
|
- if (type == "home") {
|
||||||
- Page.url = "";
|
- Page.url = "";
|
||||||
|
- Page.canonical_url = Site.url + Page.url;
|
||||||
- } else {
|
- } else {
|
||||||
- Page.url = "/" + type;
|
- Page.url = "/" + type;
|
||||||
|
- Page.canonical_url = Site.url + Page.url.replace(/\/?$/, '/');
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- // Set defaults
|
- // Set defaults
|
||||||
|
@ -57,6 +59,7 @@
|
||||||
- Page.description = Meta.description
|
- Page.description = Meta.description
|
||||||
- Page.date = Meta.date
|
- Page.date = Meta.date
|
||||||
- Page.url = Meta.url
|
- Page.url = Meta.url
|
||||||
|
- Page.canonical_url = Site.url + Page.url.replace(/\/?$/, '/');
|
||||||
- Page.active["blog"] = true
|
- Page.active["blog"] = true
|
||||||
- Page.links = Meta.links
|
- Page.links = Meta.links
|
||||||
- if (Meta.image != null) {
|
- if (Meta.image != null) {
|
||||||
|
@ -98,6 +101,8 @@ mixin WritePage(Site, Author, Page)
|
||||||
meta(property="og:site_name" content=Site.name)
|
meta(property="og:site_name" content=Site.name)
|
||||||
meta(property="article:published_time" content=getDate(Page.date).timestamp)
|
meta(property="article:published_time" content=getDate(Page.date).timestamp)
|
||||||
link(rel="stylesheet" href="/resources/css/style.css")
|
link(rel="stylesheet" href="/resources/css/style.css")
|
||||||
|
if Page.canonical_url
|
||||||
|
link(rel="canonical" href=Page.canonical_url)
|
||||||
|
|
||||||
//[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]
|
//[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user