now page
This commit is contained in:
parent
82604bd42b
commit
0ff72b4770
11 changed files with 193 additions and 2 deletions
17
src/_data/now.js
Normal file
17
src/_data/now.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
const EleventyFetch = require('@11ty/eleventy-fetch')
|
||||
|
||||
module.exports = async function () {
|
||||
const url = 'https://coryd.dev/api/now?endpoints=artists,albums,books,movies,tv'
|
||||
const res = EleventyFetch(url, {
|
||||
duration: '3h',
|
||||
type: 'json',
|
||||
})
|
||||
const now = await res
|
||||
return {
|
||||
artists: now.artists,
|
||||
albums: now.albums,
|
||||
books: now.books,
|
||||
movies: now.movies,
|
||||
tv: now.tv,
|
||||
}
|
||||
}
|
Reference in a new issue