X-Git-Url: http://nitlanguage.org diff --git a/src/nitcatalog.nit b/src/nitcatalog.nit index 5e2584a..c604fa6 100644 --- a/src/nitcatalog.nit +++ b/src/nitcatalog.nit @@ -83,9 +83,18 @@ 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 + # Relative path to the root directory (with the index file). + # + # Use "" for pages in the root directory + # Use ".." for pages in a subdirectory + var rootpath: String + redef init do add """ @@ -94,7 +103,7 @@ class CatalogPage
- + """ add more_head @@ -116,7 +125,7 @@ class CatalogPage @@ -125,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 """ @@ -132,6 +172,10 @@ class CatalogPage +""" + add_piwik + add """ +