Skip to main content

Module archives

Module archives 

Source
Expand description

归档页面模块。

对应路由 /archives

数据获取:通过 use_server_future 调用 list_published_posts(1, 10000) server function, 一次性拉取全部已发布文章,然后在内存中按发布日期的年、月进行分组展示。 在 wasm32 目标下,server function 的函数体被替换为向服务端端点发起 HTTP POST 请求的客户端存根; 实际的数据库访问逻辑仅在 feature = "server" 启用时运行。

Re-exports§

pub use Archives_completions::Component::Archives;

Structs§

ArchiveEntryProps 🔒
Properties for the ArchiveEntry component.
MonthGroup 🔒
按月份分组的文章归档结构。
MonthSectionProps 🔒
Properties for the MonthSection component.
YearGroup 🔒
按年份分组的文章归档结构。
YearSectionProps 🔒
Properties for the YearSection component.

Functions§

ArchiveEntry 🔒
单条归档文章组件,展示标题与发布日期,并通过覆盖层链接到文章详情。
Archives
归档页面组件,对应路由 /archives
ArchivesContent 🔒
归档页面内容组件。
MonthSection 🔒
单一月份归档区块组件,展示该月份下的文章条目。
YearSection 🔒
单一年份归档区块组件,展示该年份下的所有月份分组。
group_posts 🔒
将文章列表按 formatted_date() 返回的 YYYY-MM-DD 格式进行年、月分组。