Merge: rosetta_code: sha1
[nit.git] / contrib / nitiwiki / src / wiki_html.nit
index 7f1ac4d..d5ccc7a 100644 (file)
@@ -211,7 +211,9 @@ redef class WikiArticle
        fun tpl_article: TplArticle do
                var article = new TplArticle
                article.body = content
-               article.breadcrumbs = new TplBreadcrumbs(self)
+               if wiki.config.auto_breadcrumbs then
+                       article.breadcrumbs = new TplBreadcrumbs(self)
+               end
                article.sidebar = tpl_sidebar
                article.sidebar_pos = wiki.config.sidebar
                return article
@@ -220,7 +222,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
@@ -289,6 +293,14 @@ redef class WikiArticle
                if tpl.has_macro("GEN_TIME") then
                        tpl.replace("GEN_TIME", time.to_s)
                end
+               if tpl.has_macro("LAST_CHANGES") then
+                       var url = "{wiki.config.last_changes}{src_path or else ""}"
+                       tpl.replace("LAST_CHANGES", url)
+               end
+               if tpl.has_macro("EDIT") then
+                       var url = "{wiki.config.edit}{src_path or else ""}"
+                       tpl.replace("EDIT", url)
+               end
                return tpl
        end
 end