Skip to content

Commit

Permalink
First pass at server fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnw committed Jul 10, 2024
1 parent 1015eb5 commit bf101bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 15 additions & 0 deletions content/_data/newsletterArchive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import eleventyFetch from '@11ty/eleventy-fetch';

export default async () => {
const url =
'https://oddbird.us19.list-manage.com/generate-js/?u=80219aa68d7bad77b9fd2eb93&fid=27537&show=10';
const res = await eleventyFetch(url, {
type: 'text',
duration: '0s',
directory: '.cache/eleventy-fetch/',
dryRun: false,
});
const archives = res.replace(/^document.write\("/, '').replace(/"\);$/, '');

return archives;
};
4 changes: 1 addition & 3 deletions content/oddnews.njk
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,4 @@ summary: |

{{ layout.title('Latest News') }}

<div class="oddnews-archive">
<script language="javascript" src="//oddbird.us19.list-manage.com/generate-js/?u=80219aa68d7bad77b9fd2eb93&fid=27537&show=10" type="text/javascript"></script>
</div>
{{ newsletterArchive | safe }}

0 comments on commit bf101bf

Please sign in to comment.