Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
cosmic band site helpers - for article
// app.js
// etc...
app.engine('handlebars', exphbs({
defaultLayout: 'main',
partialsDir: ['views/partials/'],
helpers: {
truncateText(text, length) {
return truncate(text, length, { stripTags: true, byWords: true })
getYear() {
return moment().format('YYYY')
formatDate(date) {
return moment(date).format('MMMM Do[,] YYYY')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.