X-Git-Url: http://nitlanguage.org diff --git a/src/nitcatalog.nit b/src/nitcatalog.nit index 28ae918..c604fa6 100644 --- a/src/nitcatalog.nit +++ b/src/nitcatalog.nit @@ -83,6 +83,9 @@ end class CatalogPage super Template + # The associated catalog, used to groups options and other global data + var catalog: Catalog + # Placeholder to include additional things before the ``. var more_head = new Template @@ -131,6 +134,37 @@ class CatalogPage """ end + # Inject piwik HTML code if required + private fun add_piwik + do + var tracker_url = catalog.piwik_tracker + if tracker_url == null then return + + var site_id = catalog.piwik_site_id + + tracker_url = tracker_url.trim + if tracker_url.chars.last != '/' then tracker_url += "/" + add """ + + + + +""" + + end + redef fun rendering do add """ @@ -138,6 +172,10 @@ class CatalogPage +""" + add_piwik + add """ + """ @@ -191,6 +229,12 @@ class Catalog # The score is loosely computed using other metrics var score = new Counter[MPackage] + # Return a empty `CatalogPage`. + fun new_page(rootpath: String): CatalogPage + do + return new CatalogPage(self, rootpath) + end + # Scan, register and add a contributor to a package fun add_contrib(person: String, mpackage: MPackage, res: Template) do @@ -245,7 +289,7 @@ class Catalog end # Recursively generate a level in the file tree of the *content* section - private fun gen_content_level(ot: OrderedTree[Object], os: Array[Object], res: Template) + private fun gen_content_level(ot: OrderedTree[MConcern], os: Array[Object], res: Template) do res.add "