George S. Baugh пре 5 година
родитељ
комит
4e901111cb
2 измењених фајлова са 9 додато и 4 уклоњено
  1. 5 2
      lib/Trog/Routes/HTML.pm
  2. 4 2
      www/themes/teodesian.net/routes.pm

+ 5 - 2
lib/Trog/Routes/HTML.pm

@@ -219,7 +219,7 @@ sub index ($query,$render_cb, $content = '', $i_styles = []) {
         route       => $query->{route},
         theme_dir   => $theme_dir,
         content     => $content,
-        title       => $conf->param('general.title'), #TODO control in theme instead
+        title       => $query->{title} // $Theme::default_title // 'tCMS',
         htmltitle   => _pick_processor("templates/$htmltitle" ,$processor,$t_processor)->render($htmltitle,$query),
         midtitle    => _pick_processor("templates/$midtitle" ,$processor,$t_processor)->render($midtitle,$query),
         rightbar    => _pick_processor("templates/$rightbar" ,$processor,$t_processor)->render($rightbar,$query),
@@ -246,6 +246,7 @@ sub _generic_route ($rname, $code, $title, $query, $render_cb) {
         path   => _dir_for_resource("$rname.tx"),
     );
 
+    $query->{title} = $title;
     my $styles = _build_themed_styles("$rname.css");
     my $content = $processor->render("$rname.tx", {
         title    => $title,
@@ -579,8 +580,9 @@ sub posts ($query, $render_cb) {
 
     my $styles = _build_themed_styles('posts.css');
 
+    $query->{title} = @$tags ? "$query->{domain} : @$tags" : undef;
     my $content = $processor->render('posts.tx', {
-        title     => "Posts tagged @$tags",
+        title     => $query->{title},
         posts     => $posts,
         in_series => !!($query->{route} =~ m/\/series\/\d*$/),
         route     => $query->{route},
@@ -715,6 +717,7 @@ sub sitemap ($query, $render_cb) {
 
     my $styles = _build_themed_styles('sitemap.css');
 
+    $query->{title} = "$query->{domain} : Sitemap";
     my $content = $processor->render('sitemap.tx', {
         title      => "Site Map",
         to_map     => \@to_map,

+ 4 - 2
www/themes/teodesian.net/routes.pm

@@ -9,6 +9,8 @@ use feature qw{signatures};
 use lib 'lib';
 use Trog::Routes::HTML;
 
+our $default_title = 'TEODESIAN.NET WHIPS THEM CHIPS ~';
+
 our %routes = (
     '/links' => {
         method   => 'GET',
@@ -34,12 +36,12 @@ sub path_to_tile ($path) {
     return $paths{$path} ? $paths{$path} : $path;
 }
 
-sub links ($query, $input, $render_cb) {
+sub links ($query, $render_cb) {
     my $content = $processor->render('links.tx', {
         title => "Approved Propaganda from the ministry of family values",
         theme_dir => 'themes/teodesian.net',
     });
-    return Trog::Routes::HTML::index($query, $input, $render_cb, $content);
+    return Trog::Routes::HTML::index($query, $render_cb, $content);
 }
 
 1;