Kaynağa Gözat

Allow customization of top links

George S. Baugh 5 yıl önce
ebeveyn
işleme
221d90c848

+ 1 - 0
lib/Trog/Routes/HTML.pm

@@ -249,6 +249,7 @@ sub index ($query,$render_cb, $content = '', $i_styles = []) {
         rightbar    => _pick_processor("templates/$rightbar"  ,$processor,$t_processor)->render($rightbar,$query),
         leftbar     => _pick_processor("templates/$leftbar"   ,$processor,$t_processor)->render($leftbar,$query),
         footbar     => _pick_processor("templates/$footbar"   ,$processor,$t_processor)->render($footbar,$query),
+        category_links => _pick_processor("templates/categories.tx", $processor,$t_processor)->render("categories.tx",$query), 
         stylesheets => \@styles,
     });
 }

+ 8 - 0
www/templates/categories.tx

@@ -0,0 +1,8 @@
+<a href="/news"   title="Micro Blog" class="topbar">News</a>
+<a href="/blog"   title="Blog" class="topbar">Blog</a>
+<a href="/image" title="Images" class="topbar">Images</a>
+<a href="/video"  title="Video" class="topbar">Video</a>
+<a href="/audio"  title="Audio" class="topbar">Audio</a>
+<a href="/files"  title="Files" class="topbar">Files</a>
+<a href="/series" title="Series" class="topbar">Series</a>
+<a href="/about"  title="About" class="topbar">About</a>

+ 1 - 8
www/templates/index.tx

@@ -7,14 +7,7 @@
     </div>
     <span title="Menu" id="clickme" onclick="this.focus()">🌐</span>
     <div id="righttitle" class="toplel">
-        <a href="/news"   title="Micro Blog" class="topbar">News</a>
-        <a href="/blog"   title="Blog" class="topbar">Blog</a>
-        <a href="/image" title="Images" class="topbar">Images</a>
-        <a href="/video"  title="Video" class="topbar">Video</a>
-        <a href="/audio"  title="Audio" class="topbar">Audio</a>
-        <a href="/files"  title="Files" class="topbar">Files</a>
-        <a href="/series" title="Series" class="topbar">Series</a>
-        <a href="/about"  title="About" class="topbar">About</a>
+        <: $category_links | mark_raw :>
         <a href="/sitemap" title="Sitemap" class="topbar">🗺️</a>
         <form action="<: $route :>" method="GET" class="inline">
             <input required type="search" name="like"></input>