Parcourir la source

Make list.html fully generic (#203)

I love the list template. However, I had some issues using it for other content archetypes other than `posts`. This code change makes list.html fully generic, there are no more built in references to `posts`.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Henning Blunck il y a 4 ans
Parent
commit
7c87605d45
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      layouts/_default/list.html

+ 2 - 2
layouts/_default/list.html

@@ -10,7 +10,7 @@
 {{ define "sidebar" }}
   {{ $blogHome:="#" }}
   {{ if site.IsMultiLingual }}
-    {{ $blogHome = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) "posts") }}
+    {{ $blogHome = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
   {{ end }}
 
   <section class="sidebar-section" id="sidebar-section">
@@ -19,7 +19,7 @@
         <input type="text" value="" placeholder="Search" data-search="" id="search-box" />
         <div class="sidebar-tree">
           <ul class="tree" id="tree">
-            <li id="list-heading"><a href="{{ "/posts" | relLangURL }}" data-filter="all">{{ i18n "posts" }}</a></li>
+            <li id="list-heading"><a href="{{ .Type | relLangURL }}" data-filter="all">{{ i18n .Type }}</a></li>
             <div class="subtree">
                 {{ partial "navigators/sidebar.html" (dict "menus" site.Menus.sidebar "ctx" .) }}
             </div>