mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Adding Frontmatter Reader: Support summary card (OG. Twitter)

Open sspaeti opened this issue 1 year ago • 0 comments

See issues https://github.com/rust-lang/mdBook/issues/1416 and specific description in my comment: https://github.com/rust-lang/mdBook/issues/1416#issuecomment-1953878338.

This works for my site dedp.online, but I'd appreciate some help to integrate it nicely. It's more hackable and hard-coded to these frontmatter I used:

struct FrontMatter {
    title: String,
    description: String,
    featured_image_url: String,
}

Would be nice to read them dynamically. Also, I'm not sure if I added it at the right points.

PS: I also tried to implement a preprocessor (see https://github.com/rust-lang/mdBook/issues/1416#issuecomment-1954287866), but with this PR that one is not needed anymore. Also, I guess this should be integrated into mdBook, and can't be as Preprocessor only?

sspaeti avatar Feb 20 '24 16:02 sspaeti