Skip to main content

folder_entry

Function folder_entry 

Source
pub fn folder_entry(
    name: &str,
    url_path: String,
    index_frontmatter: Option<&SimpleMetadata>,
) -> Value
Expand description

Builds one subfolder entry for a section/home page listing.

index_frontmatter is the folder’s own index note (docs/index.md for docs/), when it has one. Its title becomes the entry’s title and its frontmatter rides along for custom sort fields — the same two things the sidebar’s buildFolderTree attaches to a folder node, which is what lets sort_folders order a listing exactly as sortFolders() orders the sidebar. title is always present (the folder name when there is no index title), mirroring getFolderFieldValue’s folder.title ?? folder.name.

Contact details are filtered out of the attached frontmatter like they are out of site.json: a listing has no use for an index note’s phone number.