Skip to content

Conversation

@L4Ph
Copy link
Collaborator

@L4Ph L4Ph commented Jun 10, 2025

This pull request removes the markdown-it dependency and its related packages, replacing its functionality with a custom implementation for processing blog posts in the RSS feed. The changes focus on dependency cleanup and code refactoring.

Dependency Cleanup:

  • Removed the markdown-it dependency from package.json and pnpm-lock.yaml, along with associated packages like linkify-it, mdurl, punycode.js, and uc.micro. These packages were no longer needed after the refactor. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Code Refactoring:

  • Updated the RSS feed generation in src/pages/rss.xml.ts to replace the markdown-it parser with a new approach using compiledContent() for rendering post content. This also introduced a custom filtering and sorting mechanism for blog posts based on their metadata.

@L4Ph L4Ph linked an issue Jun 10, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Jun 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuwari-yags ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2025 0:42am

@L4Ph
Copy link
Collaborator Author

L4Ph commented Jun 10, 2025

Normally, post.url would return correctly without doing this.

	const postsWithUrls = sorted.map((post) => {
		const contentPath = path.relative(process.cwd(), post.file);
		let url = contentPath
			.replace(/^src\/content/, "")
			.replace(/\.md$/, "")
			.replace(/index$/, "");

		url = url.replace(/\\/g, "/");
		if (!url.startsWith("/")) {
			url = `/${url}`;
		}
		if (!url.startsWith("/posts/")) {
			url = `/posts${url}`;
		}
		return {
			...post,
			url: url,
		};
	});

@L4Ph
Copy link
Collaborator Author

L4Ph commented Jun 10, 2025

I think it's a relatively neat solution (just tweaked the official sample).
Would you like to try this branch?
@SakuraSenQwQ @Keduoli03 @CarlosCB1986

@SakuraSenQwQ
Copy link

SakuraSenQwQ commented Jun 11, 2025

It seem to not work,output rss.xml :
image

All the link are wrong, I tried twice but same

@L4Ph
Copy link
Collaborator Author

L4Ph commented Jun 11, 2025

https://fuwari-yags-git-482-rss-is-no-616003-zephyirdgmailcoms-projects.vercel.app/rss.xml

This is an RSS feed of the latest Pull Request preview builds. It seems to work fine here, but...

@SakuraSenQwQ
Copy link

SakuraSenQwQ commented Jun 11, 2025

I tried on my debian server rebuild:

root@iZuf69xtxkoed8503i71xwZ:~/fuwari# cat dist/rss.xml

<title>Fuwari</title>Demo Sitehttps://fuwari.vercel.app/en<title>Markdown Extended Features</title>https://fuwari.vercel.app/posts/markdown-extended/

It working!

But on my windows:

I tried clone again,but the same problem

@SakuraSenQwQ
Copy link

SakuraSenQwQ commented Jun 11, 2025

I see:
:36 .replace(/^src/content/, "")
TO
:36 .replace(/^src[/\]content/, "")

On Debian:
image
On Windows:
image
🤣

@L4Ph
Copy link
Collaborator Author

L4Ph commented Jun 11, 2025

I forgot to handle the OS path.
I've committed the fix.

@SakuraSenQwQ
Copy link

look at

Markdown Example's rss

<span><span><span>π=3.1415926535  8979323846  2643383279  5028841971  6939937510  5820974944  5923078164  0628620899  8628034825  3421170679  …\begin{equation*} \pi =3.1415926535 \;8979323846\;2643383279\;5028841971\;6939937510\;5820974944 \;5923078164\;0628620899\;8628034825\;3421170679\;\ldots \end{equation*}</span><span><span><span></span><span><span><span><span><span><span><span><span></span><span><span>π</span><span></span><span>=</span><span></span><span>3.1415926535</span><span></span><span>8979323846</span><span></span><span>2643383279</span><span></span><span>5028841971</span><span></span><span>6939937510</span><span></span><span>5820974944</span><span></span><span>5923078164</span><span></span><span>0628620899</span><span></span><span>8628034825</span><span></span><span>3421170679</span><span></span><span></span><span>…</span></span></span></span><span>​</span></span><span><span><span></span></span></span></span></span></span></span></span></span></span></span>

in rss reader

image

in post

image


Maybe we need to select and keep part of it

@L4Ph
Copy link
Collaborator Author

L4Ph commented Jun 11, 2025

Now, opening a Pull Request is one thing, but honestly, the code feels downright terrible.
Since #492 represents a fairly solid fix, we'll merge that instead.

@L4Ph L4Ph closed this Jun 11, 2025
@L4Ph L4Ph deleted the 482-rss-is-not-output-according-to-specifications branch June 11, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RSS is not output according to specifications

2 participants