Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtree committed Feb 6, 2024
1 parent ace3713 commit 494c546
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/components/WeekNews.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
let data = {};
let cats = [];
let ghData = {};
export let year = "2024";
export let week = "05";
export let current = false;
onMount(async () => {
const res = await fetch(`https://raw.githubusercontent.com/web3privacy/news/main/src/${year}/week${week}.yaml`);
const yamlData = await res.text();
//const res = await fetch(`https://raw.githubusercontent.com/web3privacy/news/main/src/${year}/week${week}.yaml`);
const res = await fetch(`https://api.github.com/repos/web3privacy/news/contents/src/${year}/week${week}.yaml`)
//const yamlData = await res.text();
ghData = await res.json();
const yamlData = atob(ghData.content);
data = yaml.load(yamlData);
if (!data.news) {
return null
Expand Down Expand Up @@ -84,6 +88,7 @@
<!--div class="mt-6 text-sm p-4 bg-white/10">
<div>News count: {data.news?.length}</div>
<div>Categories: {cats.join(', ')}</div>
<div>{JSON.stringify(ghData.sha)}</div>
</div-->
{:else}
<div class="mt-4 p-6">Loading week ..</div>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import '../styles/base.css';
<div class="m-4 sm:m-8">
<div class="flex w-full">
<div class="flex gap-6">
<div class="w3pn-logo h-10"></div>
<a href="https://web3privacy.info"><div class="w3pn-logo h-8 sm:h-10"></div></a>
<h1 class="text-2xl sm:text-4xl">Privacy News</h1>
</div>
<div class="grow"></div>
Expand Down

0 comments on commit 494c546

Please sign in to comment.