blog

Log | Files | Refs

archives.html (2812B)


      1 {{- define "main" }}
      2 
      3 <header class="page-header">
      4   <h1>
      5     {{ .Title }}
      6     {{- if (.Param "ShowRssButtonInSectionTermList") }}
      7     {{- $rss := (.OutputFormats.Get "rss") }}
      8     {{- if (eq .Kind `page`) }}
      9     {{- $rss = (.Parent.OutputFormats.Get "rss") }}
     10     {{- end }}
     11     {{- with $rss }}
     12     <a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS">
     13       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
     14         stroke-linecap="round" stroke-linejoin="round" height="23">
     15         <path d="M4 11a9 9 0 0 1 9 9" />
     16         <path d="M4 4a16 16 0 0 1 16 16" />
     17         <circle cx="5" cy="19" r="1" />
     18       </svg>
     19     </a>
     20     {{- end }}
     21     {{- end }}
     22   </h1>
     23   {{- if .Description }}
     24   <div class="post-description">
     25     {{ .Description }}
     26   </div>
     27   {{- end }}
     28 </header>
     29 
     30 {{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
     31 
     32 {{- if site.Params.ShowAllPagesInArchive }}
     33 {{- $pages = site.RegularPages }}
     34 {{- end }}
     35 
     36 {{- range $pages.GroupByPublishDate "2006" }}
     37 {{- if ne .Key "0001" }}
     38 <div class="archive-year">
     39   {{- $year := replace .Key "0001" "" }}
     40   <h2 class="archive-year-header" id="{{ $year }}">
     41     <a class="archive-header-link" href="#{{ $year }}">
     42       {{- $year -}}
     43     </a>
     44     <sup class="archive-count">&nbsp;{{ len .Pages }}</sup>
     45   </h2>
     46   {{- range .Pages.GroupByDate "January" }}
     47   <div class="archive-month">
     48     <h3 class="archive-month-header" id="{{ $year }}-{{ .Key }}">
     49       <a class="archive-header-link" href="#{{ $year }}-{{ .Key }}">
     50         {{- .Key -}}
     51       </a>
     52       <sup class="archive-count">&nbsp;{{ len .Pages }}</sup>
     53     </h3>
     54     <div class="archive-posts">
     55       {{- range .Pages }}
     56       {{- if eq .Kind "page" }}
     57       <div class="archive-entry">
     58         <h3 class="archive-entry-title entry-hint-parent">
     59           {{- .Title | markdownify }}
     60           {{- if .Draft }}
     61           <span class="entry-hint" title="Draft">
     62             <svg xmlns="http://www.w3.org/2000/svg" height="15" viewBox="0 -960 960 960" fill="currentColor">
     63               <path
     64                 d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
     65             </svg>
     66           </span>
     67           {{- end }}
     68         </h3>
     69         <div class="archive-meta">
     70           {{- partial "post_meta.html" . -}}
     71         </div>
     72         <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
     73       </div>
     74       {{- end }}
     75       {{- end }}
     76     </div>
     77   </div>
     78   {{- end }}
     79 </div>
     80 {{- end }}
     81 {{- end }}
     82 
     83 {{- end }}{{/* end main */}}