Skip to content
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

Added substitution 'template' to allow importing of markup from external .html files #62

Closed
wants to merge 4 commits into from

Conversation

gotofritz
Copy link

As discussed here, having to copy and paste html from other documents into a comment in an scss file really inconvenient. With this PR, you can use the @{template: /pth/to/file} substition.

Path can either be absolute paths, relative to where nucleus is running, or you can set a templatePath variable in the config and it will be prepended to all paths in the substitution.

It would be even better if we could leave the argument empty, and have a templateSuffix property in the config, and then nucleus would automatically find a file of the same name as the one being processed:

 // file: navigation.css
 /**
  * blah blah
  *   @{template: }
  */

 // config.nucleus.js
 { 
    templatePath: "src/styleguide/templates/"
    templateSuffix:  ".html"
 }

// -> nucleus automatically tries to fetch src/styleguide/templates/navigation.html

But if I understand correctly, Substitute doesn't know the name of the file it is processing.

Still, this is a step forward and should save lots of time

c-stellfri added 2 commits July 20, 2017 12:24
It lets you fetch content from an external file. The path can be set
in the config variable templatePath
@gotofritz
Copy link
Author

gotofritz commented Jul 20, 2017

"All checks have failed"

This looks like the same error as the other pull request that has been sitting there for about a month.
It looks like Travis is not set up correctly, and there's nobody at hand to fix it.

I hope the project's not being abandoned...

@pkkummermo
Copy link

Hopefully not, and this PR looks like great functionality to be added to Nucleus. Perhaps @michaelseibt could shed some light on where this project is going?

Fritz Stelluto and others added 2 commits July 24, 2017 17:35
commit 0747c86
Author: Fritz Stelluto <[email protected]>
Date:   Thu Jul 20 15:07:32 2017 +0200

    Documentation for template substitution

commit 174042a
Author: c-stellfri <[email protected]>
Date:   Thu Jul 20 12:19:57 2017 +0200

    Added a template substitution

    It lets you fetch content from an external file. The path can be set
    in the config variable templatePath
Squashed merged template branch
@gotofritz gotofritz closed this May 24, 2022
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 this pull request may close these issues.

2 participants