Skip to content

Commit 1a7c38a

Browse files
authored
Ignore hello dev category feed (#58)
* Filter out posts with "hello.dev" category in index.html * Update post filtering to exclude "Developer" category in index.html * Update post filtering to exclude "Developer" category in index.html * Update blog link in index.html and adjust test:blog script in package.json * Add new blog link to linkinator configuration
1 parent e1e2686 commit 1a7c38a

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

linkinator.config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"www.reuters.com",
88
"www.investopedia.com",
99
"--- below links exist but unable to resolve with linkinator ---",
10+
"https://blog.hello.coop/*",
1011
"https://news.microsoft.com/1999/10/11/microsoft-passport-streamlining-commerce-and-communication-on-the-web/",
1112
"https://www.kqed.org/news/11851695/facebook-deleted-your-account-good-luck-retrieving-your-data"
1213
]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"build": "run-s build:* && copyfiles src/index.html S3 -f && copyfiles src/assets/* S3/assets/ -f && copyfiles src/assets/scroll-anim-seq/* S3/assets/scroll-anim-seq -f",
1717
"preview": "vite preview --open",
1818
"test": "linkinator ./S3 --config linkinator.config.json",
19-
"test:blog": "linkinator https://blog.hello.coop https://blog.hello.dev --config linkinator.config.json",
19+
"test:blog": "linkinator https://blog.hello.coop --config linkinator.config.json",
2020
"pr": "./scripts/pr.sh",
2121
"rebase": "git pull origin main --rebase",
2222
"review": "npm run rebase && npm run build && npm run test && npm run pr"

src/index.html

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,13 @@ <h3 class="font-semibold text-lg mt-4">Hellō for Developers</h3>
464464

465465
<p>
466466
<span class="opacity-75 block">Updates & News:</span>
467-
<a href="https://blog.hello.dev/" target="_blank" class="inline-flex items-center mt-1">
467+
<a href="https://blog.hello.coop/" target="_blank" class="inline-flex items-center mt-1">
468468
<svg xmlns="http://www.w3.org/2000/svg" class="h-4" fill="none" viewBox="0 0 24 24"
469469
stroke="currentColor" stroke-width="2">
470470
<path stroke-linecap="round" stroke-linejoin="round"
471471
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
472472
</svg>
473-
<span class="ml-1">blog.hello.dev</span>
473+
<span class="ml-1">blog.hello.coop</span>
474474
</a>
475475
</p>
476476

@@ -808,11 +808,23 @@ <h3 class="text-xl font-semibold text-center mb-6">Interested in talking to othe
808808
const res = await fetch("https://blog.hello.coop/feed")
809809
const txt = await res.text()
810810
const xml = new window.DOMParser().parseFromString(txt, "text/xml")
811-
const posts = xml.querySelectorAll("item")
811+
const allPosts = xml.querySelectorAll("item")
812+
813+
// Filter out posts with "Developer" category
814+
const filteredPosts = Array.from(allPosts).filter(post => {
815+
const categories = post.querySelectorAll("category")
816+
for (let category of categories) {
817+
if (category.textContent === "Developer") {
818+
return false // Exclude this post
819+
}
820+
}
821+
return true // Include this post
822+
})
823+
812824
const postsRef = document.querySelector("#posts")
813825
for (let i = 0; i < 3; i++) {
814-
if (!posts[i]) continue;
815-
const post = posts[i]
826+
if (!filteredPosts[i]) continue;
827+
const post = filteredPosts[i]
816828
const title = post.querySelector("title")?.textContent
817829
const rawDescription = post.querySelector("description")?.textContent
818830
const descriptionPlaceholder = document.createElement("div");

0 commit comments

Comments
 (0)