Skip to content

Extension for Grow that is adding the functionality to create document-scoped inline stylesheets.

License

Notifications You must be signed in to change notification settings

jungvonmatt/grow-ext-inline-text-assets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grow-ext-inline-text-assets

Extension for the static-site generator Grow that enables you to add textual asset dependencies via calls from your template.

Concept

This extension comes in handy if you want to use inline stylesheets for your project. To do so you could simply configure a asset bundle that you can then add files to just by calls from your templates.

And only for the files that are really needed in your template, instead of using pre-configured bundles.

Usage

Initial setup

  1. Create an extensions.txt file within your pod.
  2. Add to the file: git+git://github.com/jungvonmatt/grow-ext-inline-text-assets
  3. Run grow install.
  4. Add the following section to podspec.yaml:
ext:
- extensions.inline_text_assets.InlineTextAssetsExtension:
    bundles:
        - name: 'styles'
          method: 'addCssFile'
        - name: 'icons'
          method: 'useIcon'

This configuration adds two bundles to your documents that can be used in your templates with for example

{% if headline %}
{{ doc.styles.addCssFile('/css/headlines.css', 99) }}
<h1>{{ headline }}</h1>
{% endif %}
<style amp-custom>
{{ doc.styles.emit() }}
</style>

About

Extension for Grow that is adding the functionality to create document-scoped inline stylesheets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published