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§
- Archive
Entry 🔒Props - Properties for the
ArchiveEntrycomponent. - Month
Group 🔒 - 按月份分组的文章归档结构。
- Month
Section 🔒Props - Properties for the
MonthSectioncomponent. - Year
Group 🔒 - 按年份分组的文章归档结构。
- Year
Section 🔒Props - Properties for the
YearSectioncomponent.
Functions§
- Archive
Entry 🔒 - 单条归档文章组件,展示标题与发布日期,并通过覆盖层链接到文章详情。
- Archives
- 归档页面组件,对应路由
/archives。 - Archives
Content 🔒 - 归档页面内容组件。
- Month
Section 🔒 - 单一月份归档区块组件,展示该月份下的文章条目。
- Year
Section 🔒 - 单一年份归档区块组件,展示该年份下的所有月份分组。
- group_
posts 🔒 - 将文章列表按
formatted_date()返回的YYYY-MM-DD格式进行年、月分组。