antwarjs / antwar

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

Allow theme parts to be replaced/complemented on site level #74

Closed bebraw closed 8 years ago

bebraw commented 9 years ago

If you want to do changes now, you have to fork entire theme. It would be better to support something more gradual. Ie. you might want to write custom SectionItem types, override existing ones and so on.

pe3 commented 9 years ago

Great idea. This could be an differentiating factor for Antwar.

How about using CSS modules and having component folders instead of page "template" files. Then placing the CSS per component in the folders. Shared stuff would go in shared folder. Example: https://github.com/css-modules/webpack-demo/tree/master/src/components

bebraw commented 9 years ago

CSS modules seem very fresh technology at the moment. I'm not sure if we want to tie into some specific solution yet. Now styling is up to theme authors. That said having some better conventions (ie. component folders + associated styling) might be a good idea.

@eldh Any thoughts on this?

pe3 commented 9 years ago

Yes you are right about the freshness. It's more about the pattern and "The React Way" :)

pe3 commented 9 years ago

Practically I think this is related to the "jsx-includes" proposed in #71. It would be great from separation of concerns point of view if site authors could extend or replace parts of Antwar with their own UI widgets without depending much on a template.

eldh commented 9 years ago

Really like css modules.

Would be nice if there was an easy way for themes to expose whichever functions they wanted.

As for antwar core, we should allow overrides of every component/template that we know about – the section indices, section items etc.

bebraw commented 8 years ago

Now that it's possible to override layouts on different levels (base layout, section layout), this should no longer be an issue. You can see the approach in action at gh-pages branch of the official site. See esp. configuration.