Browse Source

Add sounds page

master
Nathan Bergey 2 years ago
parent
commit
57813d72dd
  1. 2
      layout/_partial/index.ejs
  2. 6
      layout/_partial/page.ejs
  3. 4
      layout/page.ejs
  4. 21
      scripts/audio.js

2
layout/_partial/index.ejs

@ -19,6 +19,8 @@ Follow me being weird online
<li><a href="https://git.natronics.org/natronics">git.natronics.org/natronics</a></li>
</ul>
<h3>Beep Boop</h3>
<p><a href="sounds/">I made a couple of sounds.</a></p>
<h3>Posts</h3>

6
layout/_partial/page.ejs

@ -0,0 +1,6 @@
<article class="content">
<header>
<h1 class="title"><%- page.title %></h1>
</header>
<%- page.content %>
</article>

4
layout/page.ejs

@ -0,0 +1,4 @@
<%- partial('_partial/root', {
title: page.title,
body: partial('_partial/page', {page: page})
}) %>

21
scripts/audio.js

@ -0,0 +1,21 @@
hexo.extend.tag.register('audio', function(args) {
const file = args[0];
const title = args[1];
const date = args[2];
const desc = args[3];
return `
<div>
<h3>${title}</h3>
<span style="display:block;margin:0.66em 0;">${date}</span>
<figure>
<figcaption>${desc}</figcaption>
<audio style="display:block;width:100%;border-radius:6px;"
preload="metadata"
controls
src="${file}"
>
Your browser does not support the <code>audio</code> element.
</audio>
</figure>
</div>`;
}, {ends: false});
Loading…
Cancel
Save