Skip to content

dhulliath/enduro_modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

These are various modules I've written for use with the Enduro CMS, organized by how they fit into Enduro's structure. MIT license. Have fun. There's no guarantee these'll work directly out of the box; I'm awful at testing all use cases. At the least you'll have a decent starting point.

Abstractors

optionated.js

Creates a globalizer-friendly object from an admin user definable array. Potentially dangerous if used array objects are deleted before unlinked.

Usage

{
	someArray: [
		{
			id: 'whatevs',
			value: 'wha'
		},
		{
			id: 'foo',
			value: 'bar'
		}
	],
	optionated: {
		someArray: 'id'
	}
}

will add this to the context:

{
	someArray_optionated: {
		whatevs: {
			id: 'whatevs',
			value: 'wha'
		},
		foo: {
			id: 'foo',
			value: 'bar'
		}
	}
}

required node modules

  • None

sass.js

The intention for this is to allow admin interface users to easily change stylesheet variables. Create a sass object anywhere in the cms templates (I suggest global, but it doesn't really matter). The extra properties sass_file and sass_prefix will be automatically added. Values in the sass object are translated into a scss map variable and written to sass_file in /assets/css/ as the variable sass_prefix. Scss recompilation for production servers is thought to work (script triggers the gulp task), but untested.

required node modules

HBS Helpers

marked.js

Similar to the pre-existing markdown functions already out there, except this renders the markdown on page render instead of adding it directly to the .js structure. Disadvantage is it does not generate header links, advantage is that any property can be rendered with markdown.

Usage
{{{marked property}}}
required node modules

sort_this_by.js

Takes a given context, sorts the values by the specified property, and returns the resorted array (does not mutate the CMS). Can be nested for multiple sorting parameters. You can use decimal notation to sort by subproperties.

Usage
{{#sort_this_by context property}}
    {{#each this}}

    {{/each}}
{{/sort_this_by}}
required node modules

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages