media url dynamic

This commit is contained in:
Set Hallstrom 2020-07-28 12:11:59 +02:00
parent 2c4e92adeb
commit bbf68c40f9
6 changed files with 48 additions and 27 deletions

View file

@ -18,6 +18,7 @@ banner: '/assets/img/basspistol_est_2010_square_bluegreen.jpg'
icon: /siteicon.png
logo: /siteicon.png
mblabel: '0f83baf3-4f44-44db-9e30-d5c05d7b77b9'
mediaurl: https://media.basspistol.com/basspistol.com
author:
name: Basspistol

View file

@ -64,15 +64,15 @@
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
<meta property="og:site_name" content="{{ site.title }}" />
<meta property="og:type" content="music:album:track" />
<meta property="og:audio" content="https://media.basspistol.com/basspistol.com/{{ page.slug }}.mp3" />
<meta property="og:audio" content="{{ site.mediaurl }}/{{ page.slug }}.mp3" />
<meta property="article:published_time" content="{{ page.last_modified_at | date_to_xmlschema }}" />
<meta property="og:image" content="https://media.basspistol.com/basspistol.com/{{ page.slug }}.jpeg" />
<meta property="og:image" content="{{ site.mediaurl }}/{{ page.slug }}.jpeg" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{ page.common.title }} | {{ site.title }}" />
<meta name="twitter:description" content="Listen and to a track by {{ page.common.artist | strip_html }} from the release &quot;{{ page.common.album | strip_html }}&quot; and support your remote artist!" />
<meta name="twitter:image" content="https://media.basspistol.com/basspistol.com/{{ page.slug }}.jpeg" />
<meta name="twitter:image" content="{{ site.mediaurl }}/{{ page.slug }}.jpeg" />
{% elsif page.collection == 'albums' %}
@ -119,16 +119,16 @@
<meta property="og:url" content="{{ site.url }}{{ page.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="https://media.basspistol.com/basspistol.com/{{ track.albumSlug }}/{{ track.trackSlug }}.mp3" />
{% for track in page.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="https://media.basspistol.com/basspistol.com/{{ page.tracks[0].slug }}.jpeg" />
<meta property="og:image" content="{{ site.mediaurl }}/{{ page.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="https://media.basspistol.com/basspistol.com/{{ page.tracks[0].slug }}.jpeg" />
<meta name="twitter:image" content="{{ site.mediaurl }}/{{ page.tracks[0].slug }}.jpeg" />

View file

@ -221,7 +221,7 @@ lang: en
"track": {{ track.common.track.no }},
"name": "{{ track.common.title }}",
"length": "{% assign round_seconds = track.format.duration | round %}{% assign minutes = round_seconds | divided_by: 60 %}{% assign leftover_seconds = minutes | times: 60 %}{{ minutes }}:{{ round_seconds | minus: leftover_seconds }}",
"file": "https://media.basspistol.com/basspistol.com/{{ track.albumSlug }}/{{ track.trackSlug }}"
"file": "{{ site.mediaurl }}/{{ track.albumSlug }}/{{ track.trackSlug }}"
}{% unless forloop.last %},{% endunless %}{% endfor %}],
trackCount = tracks.length,
npAction = $('#npAction'),

View file

@ -94,7 +94,7 @@
<div class="plItem">
<div class="plNum">{{ track.common.track.no }}.</div>
<div class="plTitle"><a href="https://media.basspistol.com/basspistol.com/{{ track.albumSlug }}/{{ track.trackSlug }}.mp3">{{ track.common.title }} </a></div>
<div class="plTitle"><a href="{{ site.mediaurl }}/{{ track.albumSlug }}/{{ track.trackSlug }}.mp3">{{ track.common.title }} </a></div>
<div class="plLength">{% assign round_seconds = track.format.duration | round %}{% assign minutes = round_seconds | divided_by: 60 %}{% assign leftover_seconds = minutes | times: 60 %}{{ minutes }}:{{ round_seconds | minus: leftover_seconds }}</div>
</div>
@ -131,7 +131,7 @@
</ul>
</div>
<div class="image">
<img src="https://media.basspistol.com/basspistol.com/{{ track.albumSlug }}/{{ track.trackSlug }}.jpeg" alt="{{ track.common.title }}" />
<img src="{{ site.mediaurl }}/{{ track.albumSlug }}/{{ track.trackSlug }}.jpeg" alt="{{ track.common.title }}" />
</div>
</section>
@ -213,7 +213,7 @@
"track": {{ track.common.track.no }},
"name": "{{ track.common.title }}",
"length": "{% assign round_seconds = track.format.duration | round %}{% assign minutes = round_seconds | divided_by: 60 %}{% assign leftover_seconds = minutes | times: 60 %}{{ minutes }}:{{ round_seconds | minus: leftover_seconds }}",
"file": "https://media.basspistol.com/basspistol.com/{{ track.albumSlug }}/{{ track.trackSlug }}"
"file": "{{ site.mediaurl }}/{{ track.albumSlug }}/{{ track.trackSlug }}"
}{% unless forloop.last %},{% endunless %}{% endfor %}{% break %} {% endif %}{% endfor %}],
trackCount = tracks.length,
npAction = $('#npAction'),

View file

@ -5,9 +5,9 @@ layout: default
{% include relBase.html %}
<!-- Banner -->
<section
class="banner onload-image-fade-in onload-content-fade-right style3 fullscreen content-align-center image-position-center" style="background-image:url('https://media.basspistol.com/basspistol.com/{{ page.slug }}.jpeg');background-size: cover; background-repeat: no-repeat;">
class="banner onload-image-fade-in onload-content-fade-right style3 fullscreen content-align-center image-position-center" style="background-image:url('{{ site.mediaurl }}/{{ page.slug }}.jpeg');background-size: cover; background-repeat: no-repeat;">
<div style="z-index:0;position:absolute; top:0; left:0; width:100%;min-height:100%;background-color: rgba(13, 13 ,13, 0.5);"></div>
<div class="content" style="z-index:1">
<div id="mainwrap" class="content" style="z-index:1">
<h1 style="margin-top:80px">{{ page.common.title }}</h1>
<p><strong>{% for style in page.common.genre %}{{ style }}{% endfor %}</strong> by <strong>{{ page.common.artist }}</strong>
<br />{{ page.common.year }}
@ -15,7 +15,6 @@ layout: default
<p><strong><span id="tracktime"></span></strong><span id="{{ page.common.title | slugify | remove: '-' }}"></span></strong></p>
<script type="text/javascript">
var {{ page.common.title | slugify | remove: '-' }}timestamp = {{ page.format.duration | round }};
var {{ page.common.title | slugify | remove: '-' }}hours = Math.floor({{ page.common.title | slugify | remove: '-' }}timestamp / 60 / 60);
@ -26,14 +25,25 @@ layout: default
theSpan.innerHTML = {{ page.common.title | slugify | remove: '-' }}formatted;
</script>
<ul class="actions stacked">
<li><button id="mu_pause" class="button icon solid fa-play">Play dat!</button></li>
</ul>
</div>
<div id="noJSalbum" class="content" style="z-index:1">
<h1 style="margin-top:80px">{{ page.common.title }}</h1>
<p><strong>{% for style in page.common.genre %}{{ style }}{% endfor %}</strong> by <strong>{{ page.common.artist }}</strong>
<br />{{ page.common.year }}
</p>
<p><strong>{% assign round_seconds = page.format.duration | round %}{% assign minutes = round_seconds | divided_by: 60 %}{% assign leftover_seconds = minutes | times: 60 %}{{ minutes }}:{% assign seconds_without_zero = round_seconds | minus: leftover_seconds %}{% if seconds_without_zero < 10 %}0{% endif %}{{ seconds_without_zero }}</strong></p>
<ul class="actions stacked">
<li><a class="button icon solid fa-play" target="_blank" rel="noopener" href="{{ site.mediaurl }}/{{ page.albumSlug }}/{{ page.trackSlug }}.mp3">Play dat!</a></li>
</ul>
</div>
<div class="image">
<img src="https://media.basspistol.com/basspistol.com/{{ page.slug }}.jpeg" alt="{{ page.title }} logo" id="coverart" />
<img src="{{ site.mediaurl }}/{{ page.slug }}.jpeg" alt="{{ page.title }} logo" id="coverart" />
</div>
</section>
@ -44,23 +54,33 @@ layout: default
<section style="padding-top:40px">
{% include author.html %}
<!-- Content -->
{% if page.all.UNSYNCEDLYRICS != nil %}
<div class="content">
{% unless page.all.UNSYNCEDLYRICS == '' %}<h2>Lyrics</h2>{% endunless %}
{% if page.all.UNSYNCEDLYRICS and page.all.USLT %}
<p style="font-size:16px;">
{{ page.all.USLT.text | newline_to_br }}
</p>
{% elsif page.all.USLT and page.all.UNSYNCEDLYRICS == nil %}
<p style="font-size:16px;">
{{ page.all.USLT.text | newline_to_br }}
</p>
{% elsif page.all.UNSYNCEDLYRICS and page.all.USLT == nil %}
<p style="font-size:16px;">
{{ page.all.UNSYNCEDLYRICS | newline_to_br }}
</p>
<p>credits:
{% endif %}
<p>
{{ page.all.Comment }}
</p>
</div>
{% endif %}
</section>
</div>
</div>
</section>
{% for post in site.posts %}
{% if post.album == page.albumSlug %}
{% include streamer.html %}
{% endif %}
{% endfor %}
<!-- Page navigation -->
<section class="wrapper style1 align-center">
<div class="inner">
@ -77,15 +97,15 @@ layout: default
<div class="post-nav">
<div>
{% if page.previous.url and page.lang == page.previous.lang %}
<h4><a href="{{ relBase }}/tracks/{{ page.previousTrack.slug }}/" alt="Read {{ page.previousTrack.common.title }}" title="Read {{ page.previousTrack.common.title }}"><i class="fas fa-arrow-left"></i></a> <a
href="{{ relBase }}/tracks/{{ page.previousTrack.slug }}/">&nbsp;{{ page.previousTrack.common.title }}</a>
<h4><a href="{{ relBase }}/albums/{{ page.previousTrack.slug }}/" alt="Read {{ page.previousTrack.common.title }}" title="Read {{ page.previousTrack.common.title }}"><i class="fas fa-arrow-left"></i></a> <a
href="{{ relBase }}/albums/{{ page.previousTrack.slug }}/">&nbsp;{{ page.previousTrack.common.title }}</a>
</h4>
{% endif %}
</div>
<div class="post-nav-next">
{% if page.next.url and page.lang == page.next.lang %}
<h4><a href="{{ relBase }}/tracks/{{ page.nextTrack.slug }}/">&nbsp;{{ page.nextTrack.common.title }}</a> <a
href="{{ relBase }}/tracks/{{ page.nextTrack.slug }}/" alt="Read {{ page.nextTrack.common.title }}" title="Read {{ page.nextTrack.common.title }}"><i class="fas fa-arrow-right"></i></a></h4>
<h4><a href="{{ relBase }}/albums/{{ page.nextTrack.slug }}/">&nbsp;{{ page.nextTrack.common.title }}</a> <a
href="{{ relBase }}/albums/{{ page.nextTrack.slug }}/" alt="Read {{ page.nextTrack.common.title }}" title="Read {{ page.nextTrack.common.title }}"><i class="fas fa-arrow-right"></i></a></h4>
{% endif %}
</div>
</div>
@ -98,7 +118,7 @@ layout: default
<!-- Audio player-->
<audio autoplay preload="metadata" data-matomo-title="{{ page.common.title }}">
<source src="https://media.basspistol.com/basspistol.com/{{ page.slug }}.mp3" type="audio/mpeg" ontimeupdate='updateTrackTime(this);' />
<source src="{{ site.mediaurl }}/{{ page.slug }}.mp3" type="audio/mpeg" ontimeupdate='updateTrackTime(this);' />
<h1>Your browser isn't ready for so much hotness. Use the download-link instead.</h1>.
</audio>
{% include footer.html %}
@ -117,7 +137,7 @@ layout: default
// only functional if "loop" is removed
mu.pause();
mu.currentTime = 0;
loadUrl("{{ relBase }}/tracks/{{ page.nextTrack.slug }}/"); return false;
loadUrl("{{ relBase }}/albums/{{ page.nextTrack.slug }}/"); return false;
});
mu.onplaying = function() {
pauseButton.innerHTML = "Pause";

View file

@ -239,7 +239,7 @@ logo_image: /siteicon.png
</ul>
</div>
<div class="image">
<img src="https://media.basspistol.com/basspistol.com/{{ album.slug }}/{{ album.tracks[0].trackSlug }}.jpeg" alt="{{ album.title | smartify }}" />
<img src="{{ site.mediaurl }}/{{ album.slug }}/{{ album.tracks[0].trackSlug }}.jpeg" alt="{{ album.title | smartify }}" />
</div>
</section>