Add more schema tags (#157)

* about,contact: add more schema tags for contact related information.
   It adds schema tags for the e-mail, telephone, and address, when they
   are available. They are linked to the Person type.

* about: add the schema Organization type.
   This way we also tag the organization url not just its name.

* about: add a hidden url schema property to the person.
   It makes sure that the URL of the website is linked to the person.

* about: add the sameAs property for each social link.
This commit is contained in:
Ronny Chevalier 2017-04-20 20:18:33 +01:00 committed by gcushen
commit 74041d65d1
2 changed files with 11 additions and 9 deletions

View file

@ -2,7 +2,7 @@
{{ $page := .page }} {{ $page := .page }}
<!-- About widget --> <!-- About widget -->
<div class="row" itemprop="author" itemscope itemtype="http://schema.org/Person"> <div class="row" itemprop="author" itemscope itemtype="http://schema.org/Person" itemref="{{ if $.Site.Params.email }}person-email{{ end }}{{ if $.Site.Params.phone }} person-telephone{{ end }}{{ if $.Site.Params.address}} person-address{{ end }}">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-4">
<div id="profile"> <div id="profile">
@ -16,19 +16,21 @@
<h2 itemprop="name">{{ $.Site.Params.name }}</h2> <h2 itemprop="name">{{ $.Site.Params.name }}</h2>
<h3 itemprop="jobTitle">{{ $.Site.Params.role }}</h3> <h3 itemprop="jobTitle">{{ $.Site.Params.role }}</h3>
{{ if $.Site.Params.organization }} {{ if $.Site.Params.organization }}
<h3 itemprop="worksFor"> <h3 itemprop="worksFor" itemscope itemtype="http://schema.org/Organization">
{{ with $.Site.Params.organization_url }}<a href="{{ . }}" target="_blank">{{ end }} {{ with $.Site.Params.organization_url }}<a href="{{ . }}" target="_blank" itemprop="url">{{ end }}
{{ $.Site.Params.organization }} <span itemprop="name">{{ $.Site.Params.organization }}</span>
{{ if $.Site.Params.organization_url }}</a>{{ end }} {{ if $.Site.Params.organization_url }}</a>{{ end }}
</h3> </h3>
{{ end }} {{ end }}
</div> </div>
<link itemprop="url" href="{{ $.Site.BaseURL }}">
<ul class="social-icon" aria-hidden="true"> <ul class="social-icon" aria-hidden="true">
{{ range $.Site.Params.social }} {{ range $.Site.Params.social }}
{{ $pack := or .icon_pack "fa" }} {{ $pack := or .icon_pack "fa" }}
<li> <li>
<a href="{{ .link | safeURL }}" target="_blank"> <a itemprop="sameAs" href="{{ .link | safeURL }}" target="_blank">
<i class="{{ $pack }} {{ $pack }}-{{ .icon }} big-icon"></i> <i class="{{ $pack }} {{ $pack }}-{{ .icon }} big-icon"></i>
</a> </a>
</li> </li>

View file

@ -11,12 +11,12 @@
<div class="col-xs-12 col-md-8"> <div class="col-xs-12 col-md-8">
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }} {{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
<ul class="fa-ul"> <ul class="fa-ul" itemscope>
{{ with $.Site.Params.email }} {{ with $.Site.Params.email }}
<li> <li>
<i class="fa-li fa fa-envelope fa-2x" aria-hidden="true"></i> <i class="fa-li fa fa-envelope fa-2x" aria-hidden="true"></i>
<span> <span id="person-email" itemprop="email">
{{- if $autolink }}<a href="mailto:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}} {{- if $autolink }}<a href="mailto:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}}
</span> </span>
</li> </li>
@ -34,7 +34,7 @@
{{ with $.Site.Params.phone }} {{ with $.Site.Params.phone }}
<li> <li>
<i class="fa-li fa fa-phone fa-2x" aria-hidden="true"></i> <i class="fa-li fa fa-phone fa-2x" aria-hidden="true"></i>
<span> <span id="person-telephone" itemprop="telephone">
{{- if $autolink }}<a href="tel:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}} {{- if $autolink }}<a href="tel:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}}
</span> </span>
</li> </li>
@ -61,7 +61,7 @@
{{ with $.Site.Params.address }} {{ with $.Site.Params.address }}
<li> <li>
<i class="fa-li fa fa-map-marker fa-2x" aria-hidden="true"></i> <i class="fa-li fa fa-map-marker fa-2x" aria-hidden="true"></i>
<span>{{ . }}</span> <span id="person-address" itemprop="address">{{ . }}</span>
</li> </li>
{{ end }} {{ end }}