_index.md's content is shown at list page

This commit is contained in:
leafee98 2022-05-18 19:45:04 +08:00
parent 23e6e10f43
commit 836128c866
5 changed files with 96 additions and 74 deletions

View file

@ -8,3 +8,5 @@ draft: false
--- ---
<!--more--> <!--more-->
*There are some short articles.*

View file

@ -1,33 +1,39 @@
{{ define "main" }} {{ define "main" }}
<section id="archive"> <div>
{{ range .Data.Pages.GroupByDate "2006" }} {{ if trim .Content " \n" }}
<div class="group"> <div class="content archive-hint">{{ .Content }}</div>
<h3 class="key">
{{ .Key }}
</h3>
{{ range .Pages }}
<div class="value">
<time class="date" datetime="{{ .PublishDate }}">{{ .PublishDate.Format "01/02" }}</time>
<div class="title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ with .Params.tags }}
{{ range . }}
<a class="tags" href="{{ "/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{ end }}
</div>
</div>
{{ end }}
</div>
{{ end }} {{ end }}
</section> <section id="archive">
{{ range .Data.Pages.GroupByDate "2006" }}
<div class="group">
<h3 class="key">
{{ .Key }}
</h3>
{{ range .Pages }}
<div class="value">
<time class="date" datetime="{{ .PublishDate }}">{{ .PublishDate.Format "01/02" }}</time>
<div class="title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ with .Params.tags }}
{{ range . }}
<a class="tags" href="{{ "/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{ end }}
</div>
</div>
{{ end }}
</div>
{{ end }}
</section>
</div>
{{ end }} {{ end }}

View file

@ -1,33 +1,39 @@
{{ define "main" }} {{ define "main" }}
<section id="archive"> <div>
{{ range .Data.Pages.GroupByDate "2006" }} {{ if trim .Content " \n" }}
<div class="group"> <div class="content archive-hint">{{ .Content }}</div>
<h3 class="key">
{{ .Key }}
</h3>
{{ range .Pages }}
<div class="value">
<time class="date" datetime="{{ .PublishDate }}">{{ .PublishDate.Format "01/02" }}</time>
<div class="title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ with .Params.tags }}
{{ range . }}
<a class="tags" href="{{ "/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{ end }}
</div>
</div>
{{ end }}
</div>
{{ end }} {{ end }}
</section> <section id="archive">
{{ range .Data.Pages.GroupByDate "2006" }}
<div class="group">
<h3 class="key">
{{ .Key }}
</h3>
{{ range .Pages }}
<div class="value">
<time class="date" datetime="{{ .PublishDate }}">{{ .PublishDate.Format "01/02" }}</time>
<div class="title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ with .Params.tags }}
{{ range . }}
<a class="tags" href="{{ "/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a>
{{ end }}
{{ end }}
</div>
</div>
{{ end }}
</div>
{{ end }}
</section>
</div>
{{ end }} {{ end }}

View file

@ -1,5 +1,5 @@
<header class="header-wrapper"> <header class="header-wrapper">
<div class="header max-wrapper"> <div class="header">
<a class="site-title" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a> <a class="site-title" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
<ul class="menu"> <ul class="menu">

View file

@ -1,8 +1,8 @@
:root { :root {
--fonts-sans-serif: Roboto, Helvetica, Tahoma, Arial, --fonts-sans-serif: Roboto, Helvetica, Tahoma, Arial,
"DejaVu Sans", "Liberation Sans", "DejaVu Sans", "Liberation Sans",
"WenQuanYi Zen Hei", "WenQuanYi Micro Hei", "WenQuanYi Zen Hei", "WenQuanYi Micro Hei",
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
"Noto Sans CJK", "Noto Sans CJK",
sans-serif; sans-serif;
@ -105,7 +105,7 @@ body {
.main, .main,
.side-recent, .side-recent,
.side-categories, .side-categories,
.side-tags .side-tags
{ background-color: var(--color-light-5); } { background-color: var(--color-light-5); }
/* place header in the center of header-wrapper */ /* place header in the center of header-wrapper */
@ -120,12 +120,6 @@ body {
margin-bottom: 0; margin-bottom: 0;
} }
.max-wrapper {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
/********** set up break point **********/ /********** set up break point **********/
@ -142,13 +136,13 @@ body {
.header-wrapper, .footer { width: 100vw;} .header-wrapper, .footer { width: 100vw;}
.main-wrapper { width: calc(100vw - 2 * var(--len-3));} .main-wrapper { width: calc(100vw - 2 * var(--len-3));}
/************************/ /************************/
/* set up header layout */ /* set up header layout */
/************************/ /************************/
.header { .header {
padding: var(--len-3); padding: var(--len-3);
width: 100%;
} }
/* place title and menus horizonally */ /* place title and menus horizonally */
@ -238,7 +232,7 @@ body {
/************************/ /************************/
.footer { .footer {
padding: var(--len-4) 0; padding: var(--len-4) 0;
font-size: var(--font-size-1); font-size: var(--font-size-1);
} }
@ -265,7 +259,6 @@ body {
color: var(--color-fav-2); color: var(--color-fav-2);
} }
/**********************************/ /**********************************/
/* set up home page's list layout */ /* set up home page's list layout */
/**********************************/ /**********************************/
@ -356,12 +349,12 @@ body {
.single .taxonomies { margin-top: var(--len-1); } .single .taxonomies { margin-top: var(--len-1); }
.single > hr { .single > hr {
border: none; border: none;
background-color: var(--color-fav-1); background-color: var(--color-fav-1);
height: 1px; height: 1px;
width: 90%; width: 90%;
margin: var(--len-3) 0; margin: var(--len-3) 0;
} }
@ -505,16 +498,16 @@ body {
overflow-x: auto; overflow-x: auto;
} }
/********************************/ /**************************/
/* setup taxonomies page layout */ /* setup list page layout */
/********************************/ /**************************/
#archive { #archive {
padding-left: var(--len-3); padding-left: var(--len-3);
} }
#archive .group { #archive .group {
margin: var(--len-4) auto; margin: var(--len-4) auto;
} }
#archive .group .key { #archive .group .key {
font-size: var(--font-size-4); font-size: var(--font-size-4);
@ -642,3 +635,18 @@ body {
color: var(--color-black-3) color: var(--color-black-3)
} }
/**********/
/** misc **/
/**********/
.archive-hint {
padding-left: var(--len-4);
color: var(--color-fav-1);
}
.max-wrapper {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}