mirror of
				https://github.com/ItsDrike/itsdrike.com.git
				synced 2025-11-04 04:06:36 +00:00 
			
		
		
		
	Make new default listing and use original in posts
This commit is contained in:
		
							parent
							
								
									e1342fcd55
								
							
						
					
					
						commit
						ef1800933b
					
				
					 2 changed files with 32 additions and 19 deletions
				
			
		| 
						 | 
					@ -2,21 +2,12 @@
 | 
				
			||||||
  <div id="main">
 | 
					  <div id="main">
 | 
				
			||||||
    <div class="container">
 | 
					    <div class="container">
 | 
				
			||||||
        {{ partial "content.html" . }}
 | 
					        {{ partial "content.html" . }}
 | 
				
			||||||
 | 
					        {{ if .Content }}
 | 
				
			||||||
            <!--Group posts by months-->
 | 
					            <hr />
 | 
				
			||||||
            {{ range .Pages.GroupByDate "2006-01" }}
 | 
					        {{ end }}
 | 
				
			||||||
                {{ $month := print .Key  "-01"}}
 | 
					        {{ range .Pages.ByTitle }}
 | 
				
			||||||
                {{ $display := dateFormat "2006-01" $month }}
 | 
					 | 
				
			||||||
                <h3 class="mt-5" id="{{ $display }}">
 | 
					 | 
				
			||||||
                    <a href="#{{ $display }}">
 | 
					 | 
				
			||||||
                        <time datetime="{{ $month }}" title='{{ dateFormat "January 2006" $month }}'>{{ $display }}</time>
 | 
					 | 
				
			||||||
                    </a>
 | 
					 | 
				
			||||||
                </h3>
 | 
					 | 
				
			||||||
                <!--List posts belonging to current month -->
 | 
					 | 
				
			||||||
                {{ range (sort .Pages "Date" "desc") }}
 | 
					 | 
				
			||||||
          {{ partial "list_item.html" . }}
 | 
					          {{ partial "list_item.html" . }}
 | 
				
			||||||
        {{ end }}
 | 
					        {{ end }}
 | 
				
			||||||
            {{ end }}
 | 
					 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
{{ end }}
 | 
					{{ end }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										22
									
								
								layouts/posts/list.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								layouts/posts/list.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,22 @@
 | 
				
			||||||
 | 
					{{ define "main" }}
 | 
				
			||||||
 | 
					    <div id="main">
 | 
				
			||||||
 | 
					        <div class="container">
 | 
				
			||||||
 | 
					            {{ partial "content.html" . }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <!--Group posts by months-->
 | 
				
			||||||
 | 
					            {{ range .Pages.GroupByDate "2006-01" }}
 | 
				
			||||||
 | 
					                {{ $month := print .Key  "-01"}}
 | 
				
			||||||
 | 
					                {{ $display := dateFormat "2006-01" $month }}
 | 
				
			||||||
 | 
					                <h3 class="mt-5" id="{{ $display }}">
 | 
				
			||||||
 | 
					                    <a href="#{{ $display }}">
 | 
				
			||||||
 | 
					                        <time datetime="{{ $month }}" title='{{ dateFormat "January 2006" $month }}'>{{ $display }}</time>
 | 
				
			||||||
 | 
					                    </a>
 | 
				
			||||||
 | 
					                </h3>
 | 
				
			||||||
 | 
					                <!--List posts belonging to current month -->
 | 
				
			||||||
 | 
					                {{ range (sort .Pages "Date" "desc") }}
 | 
				
			||||||
 | 
					                    {{ partial "list_item.html" . }}
 | 
				
			||||||
 | 
					                {{ end }}
 | 
				
			||||||
 | 
					            {{ end }}
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					{{ end }}
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue