Class PublishDateHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.content.PublishDateHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class PublishDateHandlebarsHelper extends BaseHelper
The {{publishDate}} handlebars helper returns the publish date of the currently publishing content item.If there is no currently publishing content item, this helper outputs a blank string.
Usage
{{dateFormat (publishDate) "dd MMMM, YYYY hh:mm Z"}}
The {{publishDate}} handlebars expression is a simple tag that returns the publish date of the currently publishing content item. In general, the returned Date should be formatted using the dateFormat core handlebars helper.
-
-
Constructor Summary
Constructors Constructor Description PublishDateHandlebarsHelper(IContentAPI contentApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PDDateTime
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Constructor Detail
-
PublishDateHandlebarsHelper
@Autowired public PublishDateHandlebarsHelper(IContentAPI contentApi)
-
-
Method Detail
-
apply
public PDDateTime apply(Object context, com.github.jknack.handlebars.Options options)
Description copied from class:BaseHelper
Theapply
method is the main entry point for handlebars.java helpers.It is called internally by the handlebars.java engine when a matching handlebars.java expression is encountered.
- Specified by:
apply
in interfacecom.github.jknack.handlebars.Helper<Object>
- Specified by:
apply
in classBaseHelper
- Parameters:
context
- The currently executing context.options
- The options.- Returns:
- The generated output.
-
-