Add album tracks

main
lambda 1 year ago
parent 4ff83076fc
commit c2f9ce7bf2
No known key found for this signature in database
GPG Key ID: 662ADE783CBB4026

@ -20,8 +20,9 @@ function isFullUrl(url) {
// Only one module.exports per configuration file, please! // Only one module.exports per configuration file, please!
module.exports = function (eleventyConfig) { module.exports = function (eleventyConfig) {
eleventyConfig.addShortcode("image", async function (src, alt, sizes) { eleventyConfig.addPassthroughCopy("content/albums/**/*.mp3");
eleventyConfig.addShortcode("image", async function (src, alt, sizes) {
let input; let input;
if(isFullUrl(src)) { if(isFullUrl(src)) {
input = src; input = src;
@ -29,8 +30,6 @@ module.exports = function (eleventyConfig) {
input = relativeToInputPath(this.page.inputPath, src); input = relativeToInputPath(this.page.inputPath, src);
} }
console.log("SEARCH IMAGE IN", input);
let metadata = await Image(input, { let metadata = await Image(input, {
widths: [300, 600], widths: [300, 600],
formats: ["avif", "jpeg"], formats: ["avif", "jpeg"],

@ -6,6 +6,12 @@
<h3 itemprop="name">{{ album.data.title }}</h3> <h3 itemprop="name">{{ album.data.title }}</h3>
<p itemprop="description">{{ album.data.description }}</p> <p itemprop="description">{{ album.data.description }}</p>
{% image album.data.cover, "photo of my tabby cat", "(min-width: 30em) 50vw, 100vw" %} {% image album.data.cover, "photo of my tabby cat", "(min-width: 30em) 50vw, 100vw" %}
<figure>
{% for track in album.data.tracklist %}
<figcaption>{{ track.title }}</figcaption>
<audio controls src="{{ track.audio }}"></audio>
{% endfor %}
</figure>
</li> </li>
</ol> </ol>
{% endfor %} {% endfor %}

@ -1,7 +1,16 @@
--- ---
tags: tags:
- albums - albums
title: Cheburek title: Cheburek
description: In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before the final copy is available. description: In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before the final copy is available.
cover: ./albums/cheburek/cover.jpg cover: ./albums/cheburek/cover.jpg
tracklist:
- title: Track One
audio: ./albums/cheburek/tracklist/trackone.mp3
- title: Track Two
audio: ./albums/cheburek/tracklist/tracktwo.mp3
--- ---

Loading…
Cancel
Save