aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/frontend.php
diff options
context:
space:
mode:
Diffstat (limited to 'ratatoeskr/frontend.php')
-rw-r--r--ratatoeskr/frontend.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php
index 8d2c767..fe38d5e 100644
--- a/ratatoeskr/frontend.php
+++ b/ratatoeskr/frontend.php
@@ -618,14 +618,24 @@ $ste->register_tag("styles_load", function($ste, $params, $sub)
return $output;
});
+/*
+ * STETag: title
+ * Generate a HTML title tag for your site.
+ *
+ * Tag Content:
+ * The name of your site.
+ *
+ * Returns:
+ * A HTML title tag that describes the current (sub)page.
+ */
$ste->register_tag("title", function($ste, $params, $sub)
{
$pagetitle = $sub($ste);
if(isset($ste->vars["current"]["article"]))
- return $ste->vars["current"]["article"]["title"] . " – $pagetitle";
+ return "<title>" . htmlesc($ste->vars["current"]["article"]["title"]) . " – $pagetitle" . "</title>";
if(isset($ste->vars["current"]["section"]))
- return $ste->vars["current"]["section"]["title"] . " – $pagetitle";
- return $pagetitle;
+ return "<title>" . htmlesc($ste->vars["current"]["section"]["title"]) . " – $pagetitle" . "</title>";
+ return "<title>$pagetitle</title>";
});
/*