Skip to content

Commit

Permalink
Use the new bookmarks API
Browse files Browse the repository at this point in the history
  • Loading branch information
LkeMitchll committed Mar 7, 2024
1 parent 0eaf509 commit f4a1fcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/_data/bookmarks.js
@@ -1,9 +1,9 @@
import BookmarksAPI from '../_providers/bookmarks.js';

function numberedBookmarks(data) {
data.forEach((entry, i) => {
const e = entry;
e.number = i;
data.forEach((e, i) => {
const entry = e;
entry.number = i;
});
return data;
}
Expand Down
8 changes: 1 addition & 7 deletions src/_providers/bookmarks.js
@@ -1,12 +1,6 @@
import Fetch from '@11ty/eleventy-fetch';

export default class BookmarksAPI {
constructor() {
this.credentials = Buffer.from(
`${process.env.BOOKMARKS_USER}:${process.env.BOOKMARKS_PASSWORD}`,
).toString('base64');
}

fetchPublishedBookmarks() {
return Fetch(
`${process.env.BOOKMARKS_URL}/bookmarks?filter=published`,
Expand All @@ -15,7 +9,7 @@ export default class BookmarksAPI {
type: 'json',
fetchOptions: {
headers: {
Authorization: `Basic ${this.credentials}`,
Authorization: `Bearer ${process.env.BOOKMARKS_KEY}`,
},
},
},
Expand Down

0 comments on commit f4a1fcb

Please sign in to comment.