Add a tool script to quickly create a new custom page #7

Open
opened 2025-03-22 01:22:24 +08:00 by HPCesia · 0 comments
HPCesia commented 2025-03-22 01:22:24 +08:00 (Migrated from github.com)

Currently, there are only two special pages in the template: About and links. Where about is a "standard" page-not much different from a regular post, while links adds the ability to build relevant links from the configuration.

Now, if I need to add a new "standard" page, I have to manually copy about.astro and modify the articles in the spec collection it gets. Considering that backlinks are the default page with the same name as their markdown content, you need to have a suitable utility function (like new and pub) to create a new "standard" page.

I think it would be better to add new features directly to new.mjs. The final command line command should be pnpm new page [page name]

Currently, there are only two special pages in the template: About and links. Where about is a "standard" page-not much different from a regular post, while links adds the ability to build relevant links from the configuration. Now, if I need to add a new "standard" page, I have to manually copy about.astro and modify the articles in the spec collection it gets. Considering that backlinks are the default page with the same name as their markdown content, you need to have a suitable utility function (like new and pub) to create a new "standard" page. I think it would be better to add new features directly to new.mjs. The final command line command should be `pnpm new page [page name]`
Sign in to join this conversation.
No description provided.