nitiwiki: make summary optional
authorAlexandre Terrasa <alexandre@moz-code.org>
Sat, 6 Jun 2015 19:09:45 +0000 (15:09 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Wed, 10 Jun 2015 00:39:04 +0000 (20:39 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

contrib/nitiwiki/src/wiki_base.nit
contrib/nitiwiki/src/wiki_html.nit

index b96805b..d53a758 100644 (file)
@@ -747,6 +747,14 @@ class WikiConfig
                return value_or_default("wiki.footer", "footer.html")
        end
 
+       # Automatically add a summary.
+       #
+       # * key: `wiki.auto_summary`
+       # * default: `true`
+       var auto_summary: Bool is lazy do
+               return value_or_default("wiki.auto_summary", "true") == "true"
+       end
+
        # Sidebar position.
        #
        # Position of the sidebar between `left`, `right` and `none`. Any other value
index 7f1ac4d..ced60c8 100644 (file)
@@ -220,7 +220,9 @@ redef class WikiArticle
        # Sidebar for this page.
        var tpl_sidebar: TplSidebar is lazy do
                var res = new TplSidebar
-               res.blocks.add tpl_summary
+               if wiki.config.auto_summary then
+                       res.blocks.add tpl_summary
+               end
                res.blocks.add_all sidebar.blocks
                return res
        end