Skip to content

Twig support? #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ydmitry opened this issue Sep 27, 2017 · 4 comments · May be fixed by #6
Open

Twig support? #3

ydmitry opened this issue Sep 27, 2017 · 4 comments · May be fixed by #6

Comments

@ydmitry
Copy link

ydmitry commented Sep 27, 2017

How can I enable twig templates markup using this KSS theme?

When I write:
// Markup: example.twig
...it writes file name as is "example.twig"

@JordyPouw
Copy link
Owner

@ydmitry This is just a theme on top of kss-node. This is what their docs says:

Instead of using inline HTML markup, you could point at a separate file that contains your HTML. kss-node supports either a plain *.html file or a Handlebars *.hbs file. The kss-node generator will search for the markup file in any of the --source folders.

You can find that here: github.com/kss-node/kss/blob/spec/SPEC.md.

@ydmitry
Copy link
Author

ydmitry commented Sep 28, 2017

Do you mean I need to generate my examples from twig to HTML separately from KSS and use Markup: compiled-example.html ?

KSS node repository contains builder that can support twig: https://github.com/kss-node/kss-node/tree/master/builder/twig , but as I see index.* file of the builder should be written in twig and builder.js should inherit KssBuilderBaseTwig... Maybe there is a possibility to add twig builder to this theme?

@JordyPouw
Copy link
Owner

JordyPouw commented Sep 28, 2017

@ydmitry I understand. Currently in the kss-config.json we reference to "node_modules/michelangelo/kss_styleguide/custom-template/" with the builder setting, which is just the handlebars template. So creating multiple custom templates is what I think that should happen, something like this:

  • "node_modules/michelangelo/kss_styleguide/custom-templates/hbs"
  • "node_modules/michelangelo/kss_styleguide/custom-templates/twig"

And then it should be possible to reference with the builder setting to the custom theme you want.

Sad news is that I currently don't have the time. But good idea to add later on. For now you can fork this repo and try it yourself if you need it now. I think if you write the index template with the twig syntax and replace the handlebars builder with the twig builder it would work.

@dawidk92
Copy link

+1

@szeidler szeidler linked a pull request Jul 22, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants