Skip to content

Metadata on a per-page basis #2142

Open
@cr0mll

Description

@cr0mll

Problem

There should simply be a way to specify custom metadata for each page and maybe have some predefined metadata attributes such as keywords, author information, or time of creation/modification which mdbook handles on its own.

For example, page keywords are only specified for the book as a whole - you cannot have separate keywords for each page which can make it difficult for people using search engines to find the correct page.

However, this can be augmented by also allowing one to specify for example author information for each page. This is useful for projects with multiple contributors which would like to give proper credit.

Proposed Solution

The way https://chirpy.cotes.page/ do things seems like an appropriate way to implement. Metadata is inserted into each page as key-value pairs in a markdown comment at the top of each page.

The value of each metadata attribute should be accessible as a template in index.hbs with {{ attribute_name }}.

Notes

This is not a request to implement specific metadata tags such as keywords or author information, but simply a request to expose custom metadata for each page as templates in index.hbs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement or feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions