Consolidate list templates to _default
Remove the blog list template since it's no different from the default list.
This commit is contained in:
		
							parent
							
								
									9995c8d10d
								
							
						
					
					
						commit
						4a6dd87603
					
				
					 5 changed files with 44 additions and 30 deletions
				
			
		| 
						 | 
					@ -13,12 +13,21 @@
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  blockquote,
 | 
					  blockquote,
 | 
				
			||||||
  dl,
 | 
					  dl,
 | 
				
			||||||
 | 
					  h1, h2, h3, h4, h5, h6,
 | 
				
			||||||
 | 
					  hr,
 | 
				
			||||||
 | 
					  nav,
 | 
				
			||||||
  ol,
 | 
					  ol,
 | 
				
			||||||
  section,
 | 
					  section,
 | 
				
			||||||
  ul,
 | 
					  ul,
 | 
				
			||||||
  .footnotes,
 | 
					  .footnotes,
 | 
				
			||||||
 | 
					  .main__section-header,
 | 
				
			||||||
  .page-footer
 | 
					  .page-footer
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    grid-column: main-start / main-end;
 | 
					    grid-column: main-start / main-end;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.main__posts-by-year {
 | 
				
			||||||
 | 
					  display: grid;
 | 
				
			||||||
 | 
					  grid-template-columns: subgrid;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
{{ define "main" }}
 | 
					{{ define "main" }}
 | 
				
			||||||
  {{ if eq . .FirstSection }}
 | 
					  {{ if eq . .FirstSection }}
 | 
				
			||||||
    {{ partial "page/first_section.list.html" . }}
 | 
					    {{ partial "page/first_section.list.html" (dict "page" .) }}
 | 
				
			||||||
  {{ else }}
 | 
					  {{ else }}
 | 
				
			||||||
    {{ partial "page/descendent_section.list.html" . }}
 | 
					    {{ partial "page/descendent_section.list.html" (dict "page" .) }}
 | 
				
			||||||
  {{ end }}
 | 
					  {{ end }}
 | 
				
			||||||
{{ end }}
 | 
					{{ end }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +0,0 @@
 | 
				
			||||||
{{ define "main" }}
 | 
					 | 
				
			||||||
  {{ if eq . .FirstSection }}
 | 
					 | 
				
			||||||
    {{ partial "page/first_section.list.html" . }}
 | 
					 | 
				
			||||||
  {{ else }}
 | 
					 | 
				
			||||||
    {{ partial "page/descendent_section.list.html" . }}
 | 
					 | 
				
			||||||
  {{ end }}
 | 
					 | 
				
			||||||
{{ end }}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,13 +1,19 @@
 | 
				
			||||||
<main class="main--list">
 | 
					{{- $page := .page -}}
 | 
				
			||||||
 | 
					{{- $class := .class | default "" -}}
 | 
				
			||||||
 | 
					<main class="main--list{{ with $class }} {{ . }}{{ end }}">
 | 
				
			||||||
  <header class="page-header">
 | 
					  <header class="page-header">
 | 
				
			||||||
    {{ partial "page_header.html" (dict "page" .) }}
 | 
					    {{ partial "page_header.html" . }}
 | 
				
			||||||
  </header>
 | 
					  </header>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  {{- .Content -}}
 | 
					  {{- .Content -}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  {{ range .RegularPages.ByPublishDate -}}
 | 
					  {{ with $page.RegularPages.ByPublishDate -}}
 | 
				
			||||||
    {{ if or (not .Draft) hugo.IsDevelopment -}}
 | 
					    <section class="main__posts-by-year">
 | 
				
			||||||
 | 
					      {{ range $page.RegularPages.ByPublishDate -}}
 | 
				
			||||||
 | 
					        {{ if or (not $page.Draft) hugo.IsDevelopment -}}
 | 
				
			||||||
          {{ .Render "page_summary" }}
 | 
					          {{ .Render "page_summary" }}
 | 
				
			||||||
        {{ end }}
 | 
					        {{ end }}
 | 
				
			||||||
      {{ end }}
 | 
					      {{ end }}
 | 
				
			||||||
 | 
					    </section>
 | 
				
			||||||
 | 
					  {{ end }}
 | 
				
			||||||
</main>
 | 
					</main>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,10 +1,12 @@
 | 
				
			||||||
<main class="main--list">
 | 
					{{- $page := .page -}}
 | 
				
			||||||
 | 
					{{- $class := .class | default "" -}}
 | 
				
			||||||
 | 
					<main class="main--list{{ with $class }}  {{ . }}{{ end }}">
 | 
				
			||||||
  <header class="page-header">
 | 
					  <header class="page-header">
 | 
				
			||||||
    {{ partial "page_header.html" (dict "page" .) }}
 | 
					    {{ partial "page_header.html" (dict "page" $page) }}
 | 
				
			||||||
  </header>
 | 
					  </header>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  {{/* Each page is a year section. */}}
 | 
					  {{/* Each page is a year section. */}}
 | 
				
			||||||
  {{- $yearPages := .Pages.ByPublishDate.Reverse -}}
 | 
					  {{- $yearPages := $page.Pages.ByPublishDate.Reverse -}}
 | 
				
			||||||
  {{- $yearLimit := math.Max ($.Site.Params.blog.yearLimit | default 5) 3 -}}
 | 
					  {{- $yearLimit := math.Max ($.Site.Params.blog.yearLimit | default 5) 3 -}}
 | 
				
			||||||
  {{- $expandedYears := first $yearLimit $yearPages -}}
 | 
					  {{- $expandedYears := first $yearLimit $yearPages -}}
 | 
				
			||||||
  {{- $collapsedYears := after $yearLimit $yearPages -}}
 | 
					  {{- $collapsedYears := after $yearLimit $yearPages -}}
 | 
				
			||||||
| 
						 | 
					@ -17,23 +19,27 @@
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
  -}}
 | 
					  -}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  {{- .Content -}}
 | 
					  {{- $page.Content -}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  {{ range $expandedYears -}}
 | 
					  {{ range $expandedYears -}}
 | 
				
			||||||
    <h2 id="{{ .Date | time.Format "2006" }}">{{ .Title }}</h2>
 | 
					    <section id="{{ .Date | time.Format "2006" }}" class="main__posts-by-year">
 | 
				
			||||||
 | 
					      <h2 class="main__section-heading">{{ .Title }}</h2>
 | 
				
			||||||
      {{ range .RegularPagesRecursive.ByPublishDate.Reverse -}}
 | 
					      {{ range .RegularPagesRecursive.ByPublishDate.Reverse -}}
 | 
				
			||||||
        {{ if or (not .Draft) hugo.IsDevelopment -}}
 | 
					        {{ if or (not .Draft) hugo.IsDevelopment -}}
 | 
				
			||||||
          {{ .Render "page_summary" }}
 | 
					          {{ .Render "page_summary" }}
 | 
				
			||||||
        {{ end }}
 | 
					        {{ end }}
 | 
				
			||||||
      {{ end }}
 | 
					      {{ end }}
 | 
				
			||||||
 | 
					    </section>
 | 
				
			||||||
  {{- end }}
 | 
					  {{- end }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  {{ with $collapsedYears -}}
 | 
					  {{ with $collapsedYears -}}
 | 
				
			||||||
    <h2 id="older">{{ i18n "olderPagesSectionTitle" }}</h2>
 | 
					    <section id="older">
 | 
				
			||||||
 | 
					      <h2 class="main__section-heading">{{ i18n "olderPagesSectionTitle" }}</h2>
 | 
				
			||||||
      <ul>
 | 
					      <ul>
 | 
				
			||||||
        {{ range . -}}
 | 
					        {{ range . -}}
 | 
				
			||||||
          <li><a href="{{ .Permalink }}">{{ .LinkTitle | markdownify }}</a></li>
 | 
					          <li><a href="{{ .Permalink }}">{{ .LinkTitle | markdownify }}</a></li>
 | 
				
			||||||
        {{ end }}
 | 
					        {{ end }}
 | 
				
			||||||
      </ul>
 | 
					      </ul>
 | 
				
			||||||
 | 
					    </section>
 | 
				
			||||||
  {{ end }}
 | 
					  {{ end }}
 | 
				
			||||||
</main>
 | 
					</main>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue