chore: resolve conflict

This commit is contained in:
Cory Dransfeldt 2023-11-08 11:48:38 -08:00
parent 2f6c3d69df
commit 1927790d06
5 changed files with 72 additions and 21 deletions

View file

@ -1,20 +1,5 @@
const EleventyFetch = require('@11ty/eleventy-fetch')
const links = require('../_data/json/links.json')
module.exports = async function () {
const API_TOKEN_PINBOARD = process.env.API_TOKEN_PINBOARD
const url = `https://api.pinboard.in/v1/posts/recent?auth_token=${API_TOKEN_PINBOARD}&format=json&tag=share`
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
}).catch()
const links = await res
return links['posts'].map((link) => {
return {
title: link['description'],
url: link['href'],
tags: [...new Set(link['tags'].split(' ').filter((tag) => tag.toLowerCase() !== 'share'))],
date: link['time'],
description: link['extended'],
}
})
return links.links.reverse()
}