Improve SEO include
This commit is contained in:
parent
fec3508b5d
commit
d14a360cd3
3 changed files with 19 additions and 21 deletions
|
@ -14,13 +14,13 @@ description : "Write an awesome description for your new site here.
|
||||||
url : "http://localhost:4000" # the base hostname & protocol for your site
|
url : "http://localhost:4000" # the base hostname & protocol for your site
|
||||||
baseurl : "/test" # the subpath of your site, e.g. /blog
|
baseurl : "/test" # the subpath of your site, e.g. /blog
|
||||||
email : "your-email@domain.com"
|
email : "your-email@domain.com"
|
||||||
logo : "images/default-thumb.png"
|
logo : "default-thumb.png"
|
||||||
google_site_verification :
|
google_site_verification :
|
||||||
twitter:
|
twitter:
|
||||||
username : site_twitter
|
username : site_twitter
|
||||||
facebook:
|
facebook:
|
||||||
app_id : 1234
|
app_id :
|
||||||
publisher : 1234
|
publisher :
|
||||||
google_site_verification :
|
google_site_verification :
|
||||||
bing_site_verification :
|
bing_site_verification :
|
||||||
alexa_site_verification :
|
alexa_site_verification :
|
||||||
|
@ -29,7 +29,7 @@ yandex_site_verification :
|
||||||
# For specifying social profiles.
|
# For specifying social profiles.
|
||||||
# https://developers.google.com/structured-data/customize/social-profiles
|
# https://developers.google.com/structured-data/customize/social-profiles
|
||||||
social:
|
social:
|
||||||
type : # person or organization (defaults to person)
|
type : # Person or Organization (defaults to Person)
|
||||||
name : # If the user or organization name differs from the site's name
|
name : # If the user or organization name differs from the site's name
|
||||||
links: # An array of links to social media profiles
|
links: # An array of links to social media profiles
|
||||||
- "https://twitter.com/site_twitter"
|
- "https://twitter.com/site_twitter"
|
||||||
|
|
|
@ -36,19 +36,16 @@
|
||||||
{% assign seo_author_twitter = seo_author %}
|
{% assign seo_author_twitter = seo_author %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% assign seo_author_twitter = seo_author_twitter | replace:"@", "" %}
|
{% assign seo_author_twitter = seo_author_twitter | replace: "@", "" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<meta property="og:locale" content="{{ site.locale }}">
|
<meta property="og:locale" content="{{ site.locale }}">
|
||||||
<meta property="og:site_name" content="{{ site.title }}">
|
<meta property="og:site_name" content="{{ site.title }}">
|
||||||
|
<meta property="og:title" content="{{ page.title | default: site.title | markdownify | strip_html | strip_newlines | escape_once }}">
|
||||||
{% if page.title %}
|
|
||||||
<meta property="og:title" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if seo_url %}
|
{% if seo_url %}
|
||||||
<link rel="canonical" href="{{ page.url | prepend: seo_url | replace:"/index.html", "/" }}" />
|
<link rel="canonical" href="{{ page.url | prepend: seo_url | replace: "/index.html", "/" }}">
|
||||||
<meta property="og:url" content="{{ page.url | prepend: seo_url | replace:"/index.html", "/" }}" />
|
<meta property="og:url" content="{{ page.url | prepend: seo_url | replace: "/index.html", "/" }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.excerpt %}
|
{% if page.excerpt %}
|
||||||
|
@ -56,9 +53,9 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if site.twitter %}
|
{% if site.twitter %}
|
||||||
<meta name="twitter:site" content="@{{ site.twitter.username | replace:"@", "" }}" />
|
<meta name="twitter:site" content="@{{ site.twitter.username | replace: "@", "" }}">
|
||||||
<meta name="twitter:title" content="{{ seo_title }}" />
|
<meta name="twitter:title" content="{{ page.title | default: site.title | markdownify | strip_html | strip_newlines | escape_once }}">
|
||||||
<meta name="twitter:description" content="{{ seo_description }}" />
|
<meta name="twitter:description" content="{{ seo_description }}">
|
||||||
<meta name="twitter:url" content="{{ canonical_url }}">
|
<meta name="twitter:url" content="{{ canonical_url }}">
|
||||||
|
|
||||||
{% if page.image.feature %}
|
{% if page.image.feature %}
|
||||||
|
@ -70,17 +67,17 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if seo_author_twitter %}
|
{% if seo_author_twitter %}
|
||||||
<meta name="twitter:creator" content="@{{ seo_author_twitter }}" />
|
<meta name="twitter:creator" content="@{{ seo_author_twitter }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if site.facebook %}
|
{% if site.facebook %}
|
||||||
{% if site.facebook.publisher %}
|
{% if site.facebook.publisher %}
|
||||||
<meta property="article:publisher" content="{{ site.facebook.publisher }}" />
|
<meta property="article:publisher" content="{{ site.facebook.publisher }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if site.facebook.app_id %}
|
{% if site.facebook.app_id %}
|
||||||
<meta property="fb:app_id" content="{{ site.facebook.app_id }}" />
|
<meta property="fb:app_id" content="{{ site.facebook.app_id }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -90,12 +87,12 @@
|
||||||
|
|
||||||
{% if page.date %}
|
{% if page.date %}
|
||||||
<meta property="og:type" content="article">
|
<meta property="og:type" content="article">
|
||||||
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}" />
|
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}">
|
||||||
{% if page.next.url %}
|
{% if page.next.url %}
|
||||||
<link rel="next" href="{{ page.next.url | prepend: seo_url | replace:"/index.html", "/" }}" title="{{ page.next.title | escape }}" />
|
<link rel="next" href="{{ page.next.url | prepend: seo_url | replace: "/index.html", "/" }}" title="{{ page.next.title | escape }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if page.previous.url %}
|
{% if page.previous.url %}
|
||||||
<link rel="prev" href="{{ page.previous.url | prepend: seo_url | replace:"/index.html", "/" }}" title="{{ page.previous.title | escape }}" />
|
<link rel="prev" href="{{ page.previous.url | prepend: seo_url | replace: "/index.html", "/" }}" title="{{ page.previous.title | escape }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -115,7 +112,7 @@
|
||||||
{
|
{
|
||||||
"@context" : "http://schema.org",
|
"@context" : "http://schema.org",
|
||||||
"@type" : "{% if site.social.type %}{{ site.social.type }}{% else %}person{% endif %}",
|
"@type" : "{% if site.social.type %}{{ site.social.type }}{% else %}person{% endif %}",
|
||||||
"name" : "{% if site.social.name %}{{ site.social.name }}{% else %}{{ site.name }}{% endif %}",
|
"name" : "{{ site.social.name | default: site.name }}",
|
||||||
"url" : {{ seo_url | jsonify }},
|
"url" : {{ seo_url | jsonify }},
|
||||||
"sameAs" : {{ site.social.links | jsonify }}
|
"sameAs" : {{ site.social.links | jsonify }}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ layout: compress
|
||||||
"{{ page.image.feature }}"
|
"{{ page.image.feature }}"
|
||||||
{% else %}
|
{% else %}
|
||||||
"{{ page.image.feature | prepend: "/images/" | prepend: absurl }}"
|
"{{ page.image.feature | prepend: "/images/" | prepend: absurl }}"
|
||||||
|
"{{ page.image.feature | prepend: absurl }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
alt="{{ page.title }}">
|
alt="{{ page.title }}">
|
||||||
{% if page.image.credit %}
|
{% if page.image.credit %}
|
||||||
|
|
Loading…
Reference in a new issue