-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abbf3ec
commit 3d7ce19
Showing
14 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import path from 'node:path'; | ||
import { writeFile } from 'node:fs/promises'; | ||
import { Feed } from 'feed'; | ||
import { createContentLoader } from 'vitepress'; | ||
import { compareAsc } from 'date-fns'; | ||
|
||
export const rss = { | ||
async onBuildEnd(config) { | ||
const hostname = 'https://withease.pages.dev'; | ||
|
||
const feed = new Feed({ | ||
title: 'With Ease Magazine', | ||
description: | ||
'The collection of articles about Effector and related topics. It is not a replacement for the official documentation, but it can help you to understand some concepts better.', | ||
id: hostname, | ||
link: hostname, | ||
language: 'en', | ||
favicon: `${hostname}/favicon.ico`, | ||
copyright: 'Copyright (c) 2023-present, Igor Kamyşev', | ||
}); | ||
|
||
const pages = await createContentLoader('/magazine/*.md', { | ||
excerpt: true, | ||
render: true, | ||
}).load(); | ||
|
||
const posts = pages.filter((page) => page.frontmatter.rss ?? true); | ||
|
||
posts.sort((a, b) => compareAsc(b.frontmatter.date, a.frontmatter.date)); | ||
|
||
for (const { url, excerpt, frontmatter, html } of posts) { | ||
feed.addItem({ | ||
title: frontmatter.title, | ||
id: `${hostname}${url}`, | ||
link: `${hostname}${url}`, | ||
description: excerpt, | ||
content: html, | ||
author: [], | ||
date: frontmatter.date, | ||
}); | ||
} | ||
|
||
await writeFile(path.join(config.outDir, 'feed.rss'), feed.rss2()); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
title: Dependency injection | ||
date: 2023-06-19 | ||
--- | ||
|
||
# Dependency injection | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
title: Explicit start of the app | ||
date: 2024-01-26 | ||
--- | ||
|
||
# Explicit start of the app | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
title: Fork API rules | ||
date: 2024-01-26 | ||
--- | ||
|
||
# Fork API rules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
title: Global variables | ||
date: 2023-01-02 | ||
--- | ||
|
||
# Global variables | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
sidebar: false | ||
rss: false | ||
--- | ||
|
||
# Magazine | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
title: You Don't Need Domains | ||
date: 2024-01-26 | ||
--- | ||
|
||
# You Don't Need Domains | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
title: Prefer Operators to Methods | ||
date: 2024-01-26 | ||
--- | ||
|
||
# Prefer Operators to Methods | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
title: .watch calls are (not) weird | ||
date: 2024-01-26 | ||
--- | ||
|
||
# `.watch` calls are (not) weird | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.