dynamise analytics and fix SEO for site with no album output

This commit is contained in:
Set Hallstrom 2020-07-29 14:44:32 +02:00
parent af6dfc7710
commit 368b6ded61
5 changed files with 34 additions and 53 deletions

View file

@ -77,15 +77,18 @@
<meta name="twitter:image" content="{{ site.mediaurl }}/{{ page.slug }}.jpeg" />
{% elsif page.collection == 'albums' %}
{% elsif page.collection == 'posts' %}
{% if page.category == 'releases' %}
{% for album in site.albums %}
{% if album.slug == page.album %}
<!-- BEGIN seo.html -->
{% capture namelist %}{% for art in page.artists %}{{ art }}{% unless forloop.last %}, {% endunless %}{% endfor %}{% endcapture %}
{% capture namelist %}{% for art in album.artists %}{{ art }}{% unless forloop.last %}, {% endunless %}{% endfor %}{% endcapture %}
{% capture artist %}{{ namelist }}{% endcapture %}
<title>Play &quot;{{ page.name }}&quot; by {{ artist | uniq }} | {{ site.title }}</title>
<meta name="title" content="Play &quot;{{ page.name | strip_html }}&quot; by {{ artist | uniq }}" />
<meta name="description" content="A release by {{ artist | uniq }} named &quot;{{ page.name | strip_html }}&quot; published on {{ site.title }}" />
<title>Play &quot;{{ album.name }}&quot; by {{ artist | uniq }} | {{ site.title }}</title>
<meta name="title" content="Play &quot;{{ album.name | strip_html }}&quot; by {{ artist | uniq }}" />
<meta name="description" content="A release by {{ artist | uniq }} named &quot;{{ album.name | strip_html }}&quot; published on {{ site.title }}" />
<meta name="dc.date.modified" scheme="ISO8601" content="{{ page.last_modified_at | date_to_xmlschema }}" />
<meta name="robots" content="index" />
@ -107,34 +110,31 @@
<meta name="dcterms.Type" content="text/html" />
<meta name="dcterms.Coverage" content="{{ site.url }}/" />
<meta name="dcterms.Rights" content="Copyright &copy;{{ site.time | date: '%Y' }} {{ site.title }}." />
<meta name="dcterms.Subject" content="A release by {{ artist | uniq }} named &quot;{{ page.name | strip_html }}&quot; published on {{ site.title }}" />
<meta name="dcterms.Title" content="Play &quot;{{ page.name | strip_html }}&quot; by {{ artist | uniq }}" />
<meta name="dcterms.Subject" content="A release by {{ artist | uniq }} named &quot;{{ album.name | strip_html }}&quot; published on {{ site.title }}" />
<meta name="dcterms.Title" content="Play &quot;{{ album.name | strip_html }}&quot; by {{ artist | uniq }}" />
<meta name="dcterms.Contributor" content="{{ site.title }}" />
<meta name="dcterms.Date" content="{{ page.last_modified_at | date: '%Y-%m-%d' }}" />
<meta name="dcterms.Description" content="Listen and to a release by {{ artist | uniq }} named &quot;{{ page.name | strip_html }}&quot; and support your remote artist!" />
<meta name="dcterms.Description" content="Listen and to a release by {{ artist | uniq }} named &quot;{{ album.name | strip_html }}&quot; and support your remote artist!" />
<!-- Facebook -->
<meta property="og:title" content="{{ page.name }} by {{ artist | uniq }}" />
<meta property="og:title" content="{{ album.name }} by {{ artist | uniq }}" />
<meta property="og:locale" content="en" />
<meta property="og:description" content="Listen and to a release by {{ artist | uniq }} named &quot;{{ page.name | strip_html }}&quot; and support your remote artist!" />
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
<meta property="og:description" content="Listen and to a release by {{ artist | uniq }} named &quot;{{ album.name | strip_html }}&quot; and support your remote artist!" />
<meta property="og:url" content="{{ site.url }}{{ album.url }}" />
<meta property="og:site_name" content="{{ site.title }}" />
<meta property="og:type" content="music:album" />
{% for track in page.tracks %}<meta property="og:audio" content="{{ site.mediaurl }}/{{ track.albumSlug }}/{{ track.trackSlug }}.mp3" />
{% endfor %}
{% for track in album.tracks %}<meta property="og:audio" content="{{ site.mediaurl }}/{{ track.albumSlug }}/{{ track.trackSlug }}.mp3" />{% endfor %}
<meta property="article:published_time" content="{{ page.last_modified_at | date_to_xmlschema }}" />
<meta property="og:image" content="{{ site.mediaurl }}/{{ page.tracks[0].slug }}.jpeg" />
<meta property="og:image" content="{{ site.mediaurl }}/{{ album.tracks[0].slug }}.jpeg" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{ page.name }} | {{ site.title }}" />
<meta name="twitter:description" content="Listen and to a release by {{ artist | uniq }} named &quot;{{ page.name | strip_html }}&quot; and support your remote artist!" />
<meta name="twitter:image" content="{{ site.mediaurl }}/{{ page.tracks[0].slug }}.jpeg" />
{% else %}
<meta name="twitter:title" content="{{ album.name }} | {{ site.title }}" />
<meta name="twitter:description" content="Listen and to a release by {{ artist | uniq }} named &quot;{{ album.name | strip_html }}&quot; and support your remote artist!" />
<meta name="twitter:image" content="{{ site.mediaurl }}/{{ album.tracks[0].slug }}.jpeg" />
{% endif %}{% endfor %}{% else %}
<!-- BEGIN seo.html -->
<title>{{ page.title }} | {{ site.title }}</title>
@ -209,7 +209,7 @@
}
}
</script>
{% endif %}
{% endif %}
<link rel="alternate" type="application/rss+xml" href="{{ site.url}}/feed.xml" title="{{ site.title }}" />