antwarjs / antwar

A static site generator built with React and Webpack.
https://antwar.js.org/
MIT License
460 stars 35 forks source link

Provide access to page metadata #83

Closed bebraw closed 7 years ago

bebraw commented 9 years ago

Looks like we could inject this through React. See https://github.com/nfl/react-helmet and https://github.com/kodyl/react-document-meta .

iamstarkov commented 9 years ago

But how are you going to extract metadata from posts?

bebraw commented 9 years ago

Currently it tries to parse YAML headmatter for Markdown posts should that exist. In addition we provide hooks. See configuration docs. The configuration allows you to map content to specific urls, parse dates from them and so on.

If that is not enough you can inject custom data at sort hook. See antwar.config.js of SurviveJS for an example. So if options above don't work for you, you could for instance parse metadata per post from a separate JSON or so. You would just need some convention based on which to map it to a post (naming likely).

Based on the structure of your site it shouldn't be too difficult to port to Antwar. You would have to push your content to a directory and define a section mapping for it. If you want I can set up something simple for you to get started.

iamstarkov commented 9 years ago

If you want I can set up something simple for you to get started.

ohh, thank you, i dont want to bother you wit this task and i can do it by myself when I will need it =)

bebraw commented 7 years ago

This isn't relevant anymore as pages go through EJS templating.