cleanup + now topper
This commit is contained in:
parent
6c81b89874
commit
82604bd42b
38 changed files with 123 additions and 8 deletions
15
src/_data/nowplaying.js
Normal file
15
src/_data/nowplaying.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const EleventyFetch = require('@11ty/eleventy-fetch')
|
||||
|
||||
module.exports = async function () {
|
||||
const url = 'https://coryd.dev/api/music?limit=1&period=7day'
|
||||
const res = EleventyFetch(url, {
|
||||
duration: '10m',
|
||||
type: 'json',
|
||||
})
|
||||
const music = await res
|
||||
return {
|
||||
artist: music.recenttracks.track[0].artist['#text'],
|
||||
title: music.recenttracks.track[0].name,
|
||||
url: music.recenttracks.track[0].url,
|
||||
}
|
||||
}
|
11
src/_data/status.js
Normal file
11
src/_data/status.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
const EleventyFetch = require('@11ty/eleventy-fetch')
|
||||
|
||||
module.exports = async function () {
|
||||
const url = 'https://api.omg.lol/address/cory/statuses/'
|
||||
const res = EleventyFetch(url, {
|
||||
duration: '1d',
|
||||
type: 'json',
|
||||
})
|
||||
const status = await res
|
||||
return status.response.statuses[0]
|
||||
}
|
6
src/_includes/now-topper.liquid
Normal file
6
src/_includes/now-topper.liquid
Normal file
|
@ -0,0 +1,6 @@
|
|||
<div class="border-b border-gray-200 pb-8 dark:border-gray-700 mb-8 pb-8 dark:text-white text-gray-800">
|
||||
<a class="no-underline" href="/"><h2 class="m-0 text-xl font-black leading-tight tracking-normal md:text-2xl text-primary-400 hover:text-primary-500 dark:hover:text-primary-300 mb-4">Now</h2></a>
|
||||
<p>I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies.</p>
|
||||
<p>{{ status.emoji }} {{ status.content }}</p>
|
||||
<p class="mb-0"><a class="no-underline dark:text-white text-gray-800 font-normal" href={{nowplaying.url}}><span class="icon-inline">{% heroicon "solid" "music-note" "Now playing" "width=20 height=20" %}</span> {{nowplaying.title}} by {{nowplaying.artist}}</a></p>
|
||||
</div>
|
|
@ -9,8 +9,8 @@ pagination:
|
|||
templateEngineOverride: liquid,md
|
||||
---
|
||||
|
||||
{% for post in pagination.items %} {% if post.data.published %}
|
||||
<div class="mb-8 border-b border-gray-200 pb-8 text-gray-800 dark:border-gray-700 dark:text-white">
|
||||
{% include "now-topper.liquid" %} {% for post in pagination.items %} {% if post.data.published %}
|
||||
<div class="mb-8 border-b border-gray-200 pb-4 text-gray-800 dark:border-gray-700 dark:text-white">
|
||||
<a class="no-underline" href="{{ post.url }}"
|
||||
><h2
|
||||
class="m-0 text-xl font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl"
|
||||
|
|
Reference in a new issue