aboutsummaryrefslogtreecommitdiff
path: root/pkg/context/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/context/context.go')
-rw-r--r--pkg/context/context.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/context/context.go b/pkg/context/context.go
index 1457deec..abf4aaec 100644
--- a/pkg/context/context.go
+++ b/pkg/context/context.go
@@ -51,6 +51,19 @@ func (c *Context) PageIs(name string) {
c.Data["PageIs"+name] = true
}
+// Require sets "Requirexxx" field in template data.
+func (c *Context) Require(name string) {
+ c.Data["Require"+name] = true
+}
+
+func (c *Context) RequireHighlightJS() {
+ c.Require("HighlightJS")
+}
+
+func (c *Context) RequireSimpleMDE() {
+ c.Require("SimpleMDE")
+}
+
// FormErr sets "Err_xxx" field in template data.
func (c *Context) FormErr(names ...string) {
for i := range names {