Open trieloff opened 4 years ago
While I like the general idea, there are 2 fundamental things we need to explore first to achieve this:
html_pre.js
and html.htl
are used to dispatch on the correct selector via an ESI include. We all agree this is not the good solution but we do not have something better yet. This would be needed for themespre.js
and the like. It can (but most often won't) have selectors.X-Theme
cookie or header. Any static file that a theme would need to deliver must be in the theme's repository. I think any kind of inheritance or merging mechanism would make things too complicated.i would like to be very careful here that we are sure what we mean by themes and how far we want this to go. i think manipulating the markup in helix pages may be an enabler for themes but is somewhat unrelated and to be perfectly honest, i am not sure that i would support the idea of general purpose our of the box (helix pages branded) theming that requires markup manipulation.
considering that for any theme good general purpose design is crucial, i think in a first step i would like to replicate all the spark page themes as a starting point, and i would be very surprised if that would require manipulations of the markup.
even beyond that, i would then like to explore the spark brand system to get the general purpose theme customization to the next level.
https://theblog.adobe.com/creating-your-brand-in-adobe-spark/
i definitely appreciate the value of markup customization and agree with it as reported in https://github.com/adobe/helix-pipeline/issues/516 but i am not sure that we should produce themes that are not generally applicable under the helix pages umbrella and if they are generally applicable within the context of helix pages then they should style the default markup. maybe i am being nit-picky here...
Maybe to give a bit more background on my initial idea here, since I'm not sure I got it covered during the hackathon demo, I'm really looking at this from the agency's point of view that will be developing the themes for helix, and how much knowledge expertise would be required for each kind of theme "levels".
Theming Level | Description | Expertise required | Target Audience |
---|---|---|---|
White labeling | Simple CSS/logo/icons/fonts adjustments on top of a provided Helix Pages template Extension points:
|
|
Consumer |
Customize layout (SEO/A11y) |
Capability to override part of the markup to inject domain-specific semantics on top of the provided Helix Pages template, i.e. create a carousel from a list of images, inject microdata, add WAI tags, etc. Maybe some basic scripting to initialize/configure vendor libs Extension points:
|
|
SMB |
Full theming | Fully control 100% of the output markup, including different layouts for different page types (blog, gallery, etc.) Extension points:
|
|
Enterprise |
Then for each target audience, I guess the expectations on how to use the themes may be a bit different:
Hi David, I already did replicate a spark theme together with Conrad, for the Basel hackathon in September 2018, and we definitely needed to do markup manipulation. Even when it's true that the CLI was different at that time and the output too, I do believe you always need a certain level of manipulation to achieve a theme.
Having said that a certain theming could be achieved with a single wrapping class, much like the one you can add with the style system when used at a template level. Using that pattern, you wouldn't need to manipulate the markup at all.
@ramboz's presentation at the AES Hackathon made me think about adding a theme system to Helix Pages.
Background
Theming systems should not just allow to create static file overlays as we have in Helix Pages right now, but they should be able to change the fundamental structure of the generated HTML to reflect different needs and usage patterns of sites.
While it is possible to build a blog using Helix Pages right now (see theblog), it requires larger amounts of client-side scripting that are non ideal. With a proper theming system, a user can select what kind of site they are building (collection of micro sites, blog post, documentation site, etc) and the HTML will follow the best practices.
It also allows us to establish a developer ecosystem of developers who are creating their own themes as forks of Helix Pages, deployed to Adobe I/O Runtime, that can be swapped in dynamically, without any coding or deployment required from the author.
Requirements
THEME
file into their repository. TheTHEME
file will point to the theme URLTheme Rendering Implementation
X-Theme
cookie. The VCL will use theX-Theme
cookie value to resolve the correct action to execute.X-Theme
cookie has been set, thehelix-theme
web action will be called. This action reads theTHEME
file and returns the value in theX-Theme
header. The response will be cached for a reasonable amount of time (1 hour to start).Theme Selection UI
THEME
file will be written and the theme cache will be cleared