remove redundant JS and fix broken filter

This commit is contained in:
sakrecoer 2020-07-27 08:47:31 +02:00
parent 517e9bb6c5
commit adb47851f9

View file

@ -40,13 +40,13 @@ logo_image: /siteicon.png
{% for post in site.posts limit: '2' %}
<section id="album{% increment var %}"
<section
class="section-shadow banner style1 orient-{% cycle 'left', 'right' %} content-align-{% cycle 'right', 'left' %} image-position-center fullscreen onload-image-fade-in onload-content-fade-right">
<div class="content">
<h1>{{ post.title }}</h1>
<p>{{ post.description }}</p>
{% if post.category == 'release' %}
{% if post.category == 'releases' %}
{% capture album_name -%}
{{ post.album }}
{%- endcapture %}
@ -60,20 +60,12 @@ logo_image: /siteicon.png
{% for track in album.tracks %}
<p style="margin-bottom: 30px; font-family: monospace;font-size: 14px">
<strong>{{ track.common.track.no }}. {{ track.common.title }}</strong><br />
<span id="{{ track.common.title | slugify | remove: '-' }}"></span> |
<span>{% assign round_seconds = track.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 }}</span> |
<span style="font-family: monospace;font-size: 14px">{{ track.common.genre }} </span>
</p>
<script type="text/javascript">
var {{ track.common.title | slugify | remove: '-' }}timestamp = {{ track.format.duration | round }};
var {{ track.common.title | slugify | remove: '-' }}hours = Math.floor({{ track.common.title | slugify | remove: '-' }}timestamp / 60 / 60);
var {{ track.common.title | slugify | remove: '-' }}minutes = Math.floor({{ track.common.title | slugify | remove: '-' }}timestamp / 60) - ({{ track.common.title | slugify | remove: '-' }}hours * 60);
var {{ track.common.title | slugify | remove: '-' }}seconds = {{ track.common.title | slugify | remove: '-' }}timestamp % 60;
var {{ track.common.title | slugify | remove: '-' }}formatted = {{ track.common.title | slugify | remove: '-' }}hours.toString().padStart(2, '0') + ':' + {{ track.common.title | slugify | remove: '-' }}minutes.toString().padStart(2, '0') + ':' + {{ track.common.title | slugify | remove: '-' }}seconds.toString().padStart(2, '0');
var theSpan = document.getElementById("{{ track.common.title | slugify | remove: '-' }}");
theSpan.innerHTML = {{ track.common.title | slugify | remove: '-' }}formatted;
</script>
{% endfor %}
{% break %} {% endif %} {% endfor %}
{% endif %}