diff options
| author | Eltrac <eltrac233@gmail.com> | 2024-11-28 23:55:20 +0800 |
|---|---|---|
| committer | Eltrac <eltrac233@gmail.com> | 2024-11-28 23:55:20 +0800 |
| commit | 1a0692d23e15f80afcc0c1e9a394fa33ff125628 (patch) | |
| tree | 8ea3bc2fa68cb27f6eea9efbce860b93fb46e50c | |
| parent | cbf3400406296fcb3315335f7adf2621f226ec0e (diff) | |
remove(theme): unnecessary dom layers with rows and cols
| -rw-r--r-- | themes/yinyang/layouts/_default/list.html | 38 | ||||
| -rw-r--r-- | themes/yinyang/layouts/_default/single.html | 114 | ||||
| -rw-r--r-- | themes/yinyang/layouts/index.html | 100 |
3 files changed, 121 insertions, 131 deletions
diff --git a/themes/yinyang/layouts/_default/list.html b/themes/yinyang/layouts/_default/list.html index ca7e50c4..5ccc0e3f 100644 --- a/themes/yinyang/layouts/_default/list.html +++ b/themes/yinyang/layouts/_default/list.html @@ -1,29 +1,25 @@ {{ partial "snippets/document-start.html" . }} <article class="posts"> - <div class="row"> - <div class="col-xs-12"> - {{ partial "header.html" . }} - <h1 class="taxonomy-term">{{.Data.Term}}</h1> - <div id="posts-list"> - {{ range .Pages }} - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">{{ .Date.Format "06/01/02"}}</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="{{ .RelPermalink }}"> - {{ .Title }}{{ with .Params.subtitle }}:<span class="posts-subtitle">{{. }}</span> - {{ end }} - </a> - </div> - </div> + {{ partial "header.html" . }} + <h1 class="taxonomy-term">{{.Data.Term}}</h1> + <div id="posts-list"> + {{ range .Pages }} + <div class="row posts-line"> + <div class="posts-date col-xs-2"> + <time datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">{{ .Date.Format "06/01/02"}}</time> + </div> + <div class="posts-title col-xs-10"> + <div class="row"> + <div class="col-xs-12"> + <a href="{{ .RelPermalink }}"> + {{ .Title }}{{ with .Params.subtitle }}:<span class="posts-subtitle">{{. }}</span> + {{ end }} + </a> </div> </div> - {{ end }} + </div> </div> - </div> + {{ end }} </div> </article> {{ partial "snippets/document-end.html" . }}
\ No newline at end of file diff --git a/themes/yinyang/layouts/_default/single.html b/themes/yinyang/layouts/_default/single.html index 0810a11d..49abf0ff 100644 --- a/themes/yinyang/layouts/_default/single.html +++ b/themes/yinyang/layouts/_default/single.html @@ -1,69 +1,67 @@ {{ partial "snippets/document-start.html" . }} <article class="post {{ .Site.Language.LanguageName }}" id="article"> - <div class="row"> - <div class="col-xs-12"> - <!-- Site Header --> - <div class="site-header"> - {{ partial "header.html" . }} - </div> - <!-- Post Header --> - <header class="post-header"> - {{ if in .Site.Params.mainSections .Type }} - <!-- Title and Subtitle --> - <h1 class="post-title"> - {{ .Title }} - {{ with .Params.subtitle }} - <small class="post-subtitle">{{ . }}</small> - {{ end }} - </h1> - <!-- Post Meta --> - <div class="row post-desc"> - <div class="col-xs-6"> - {{ if .Date }} - <time class="post-date" datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}"> - {{ .Date.Format "02 Jan 2006" }} - </time> - {{ end }} - <span> / </span> - <span><span class="waline-pageview-count">…</span> Views</span> - </div> - </div> - {{ end }} - </header> - <!-- Post Content --> - <div id="post-content" class="post-content markdown-body"> - {{ .Site.Params.postHeaderContent | safeHTML }} - {{ .Content }} + <!-- Site Header --> + <div class="site-header"> + {{ partial "header.html" . }} + </div> + <!-- Post Header --> + <header class="post-header"> + {{ if in .Site.Params.mainSections .Type }} + <!-- Title and Subtitle --> + <h1 class="post-title"> + {{ .Title }} + {{ with .Params.subtitle }} + <small class="post-subtitle">{{ . }}</small> + {{ end }} + </h1> + <!-- Post Meta --> + <div class="row post-desc"> + <div class="col-xs-6"> + {{ if .Date }} + <time class="post-date" datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}"> + {{ .Date.Format "02 Jan 2006" }} + </time> + {{ end }} + <span> / </span> + <span><span class="waline-pageview-count">…</span> Views</span> </div> + </div> + {{ end }} + </header> - <!-- Post Tags --> - <!-- <div class="row middle-xs"> - <div class="col-xs-12"> - {{ range .Params.tags }} - <div class="post-tags"> - <a href="{{ site.LanguagePrefix }}/tags/{{ lower . | urlize }}/"> - {{ . }} - </a> - </div> - {{ end }} - </div> - </div> --> + <!-- Post Content --> + <div id="post-content" class="post-content markdown-body"> + {{ .Site.Params.postHeaderContent | safeHTML }} + {{ .Content }} + </div> - <!-- Post Comments --> - {{ if in .Site.Params.mainSections .Type }} - <!-- waline --> - <div style="height: 50px;"></div> - <div class="post-comments"> - <div id="waline"></div> - <script type="module"> - import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js'; - {{ partial "snippets/waline-init.html" . | safeJS }} - </script> - </div> + <!-- Post Tags --> + <!-- <div class="row middle-xs"> + <div class="col-xs-12"> + {{ range .Params.tags }} + <div class="post-tags"> + <a href="{{ site.LanguagePrefix }}/tags/{{ lower . | urlize }}/"> + {{ . }} + </a> + </div> {{ end }} </div> - </div> + </div> --> + + <!-- Post Comments --> + {{ if in .Site.Params.mainSections .Type }} + <!-- waline --> + <div style="height: 50px;"></div> + <div class="post-comments"> + <div id="waline"></div> + <script type="module"> + import { init } from 'https://unpkg.com/@waline/client@v3/dist/waline.js'; + {{ partial "snippets/waline-init.html" . | safeJS }} + </script> + </div> + {{ end }} + </article> <!-- use fancybox --> <!-- the reason it is replace here it that the fancybox.js is loaded after the swup.js --> diff --git a/themes/yinyang/layouts/index.html b/themes/yinyang/layouts/index.html index ba5aaa55..c59f3abd 100644 --- a/themes/yinyang/layouts/index.html +++ b/themes/yinyang/layouts/index.html @@ -1,62 +1,58 @@ {{ partial "snippets/document-start.html" . }} <article class="posts"> - <div class="row"> - <div class="col-xs-12"> - {{ partial "header.html" . }} - <div id="posts-list"> - {{ $currentYear := now.Format "2006" }} <!-- 获取当前年份 --> - - {{ $isFirstPost := true }} <!-- 用于标记首页的第一篇文章 --> - - {{ range (where site.RegularPages "Type" "in" site.Params.mainSections).GroupByDate "2006" -}} - <section class="posts-year-section"> - <h1 class="site-date-catalog posts-year-title">{{ .Key }}</h1> - - {{ range .Pages.GroupByDate "01" }} - <h2>{{ .Key }} 月</h2> - <ul> - {{ range .Pages }} - <li class="{{ if $isFirstPost }}first-post{{ end }}"> - <!-- 首页第一篇文章特殊展示 --> - <div class="row posts-line {{ if $isFirstPost }}featured-post{{ end }}"> - <div class="posts-date col-xs-3 col-sm-2"> - <time datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">{{ .Date.Format "Jan 02" }}</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="{{ .RelPermalink }}">{{ .Title }}</a> - <div class="posts-excerpt"> - {{ if $isFirstPost }} - {{ if .Params.description }} - <p>{{.Params.description }}</p> - {{ else }} - <p>{{ .Summary }}</p> - {{ end }} - {{ $isFirstPost = false }} - {{ end }} - </div> - </div> - <div class="col-xs-1 col-sm-2 posts-categories"> - {{ with .Params.categories }} - <div class="posts-category"> - <a href="/categories/{{ . }}/"><strong>{{ . }}</strong></a> - </div> + {{ partial "header.html" . }} + <div id="posts-list"> + {{ $currentYear := now.Format "2006" }} <!-- 获取当前年份 --> + + {{ $isFirstPost := true }} <!-- 用于标记首页的第一篇文章 --> + + {{ range (where site.RegularPages "Type" "in" site.Params.mainSections).GroupByDate "2006" -}} + <section class="posts-year-section"> + <h1 class="site-date-catalog posts-year-title">{{ .Key }}</h1> + + {{ range .Pages.GroupByDate "01" }} + <h2>{{ .Key }} 月</h2> + <ul> + {{ range .Pages }} + <li class="{{ if $isFirstPost }}first-post{{ end }}"> + <!-- 首页第一篇文章特殊展示 --> + <div class="row posts-line {{ if $isFirstPost }}featured-post{{ end }}"> + <div class="posts-date col-xs-3 col-sm-2"> + <time datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">{{ .Date.Format "Jan 02" }}</time> + </div> + <div class="posts-title col-xs-9 col-sm-10"> + <div class="row"> + <div class="col-xs-11 col-sm-10"> + <a href="{{ .RelPermalink }}">{{ .Title }}</a> + <div class="posts-excerpt"> + {{ if $isFirstPost }} + {{ if .Params.description }} + <p>{{.Params.description }}</p> + {{ else }} + <p>{{ .Summary }}</p> {{ end }} - </div> + {{ $isFirstPost = false }} + {{ end }} + </div> + </div> + <div class="col-xs-1 col-sm-2 posts-categories"> + {{ with .Params.categories }} + <div class="posts-category"> + <a href="/categories/{{ . }}/"><strong>{{ . }}</strong></a> </div> + {{ end }} </div> </div> - </li> - {{ end }} - </ul> + </div> + </div> + </li> {{ end }} - - </section> - <hr> - {{ end }} - </div> - </div> + </ul> + {{ end }} + + </section> + <hr> + {{ end }} </div> </article> {{ partial "snippets/document-end.html" . }} |
