Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jesselau76/hugo-w3-simple.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjesselau76 <jesselau76@gmail.com>2019-03-19 01:43:12 +0300
committerjesselau76 <jesselau76@gmail.com>2019-03-19 01:43:12 +0300
commitadf4e045d219591202bc5cb351eec98f91a1bbc6 (patch)
tree5d4c8253af1714ecf4c8cb0c3a975b160455be6f /layouts
parentbd82fafba94aa655309e2b5c32b4281ae3efe1f3 (diff)
alllist style
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html7
-rw-r--r--layouts/_default/list.html213
2 files changed, 132 insertions, 88 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index f246adc..fd97097 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -22,6 +22,11 @@
<div class="w3-content">
<div>
+ {{ if and .IsHome .Site.Params.welcomemessage }}
+ <div class="w3-card-4 w3-container" >
+ {{ .Content | markdownify }}
+ </div>
+ {{ end }}
<div id="content" >
{{ block "main" . }}{{ end }}
</div>
@@ -189,6 +194,7 @@ window.onscroll = function() {scrollFunction()};
function scrollFunction() {
<!-- TOC -->
+ {{ if not .IsHome }}
{{ if and (ge (len .TableOfContents) 100) (ne .Params.toc "false") }}
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
@@ -197,6 +203,7 @@ function scrollFunction() {
document.getElementById("toc").style.display = "none";
}
{{ end }}
+ {{ end }}
<!-- cookie bar -->
{{ if .Site.Params.cookie_info }}
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index c128195..03c71e7 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -5,113 +5,150 @@
{{ end }}
{{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }}
-{{ if .Site.Params.gridstyle }}
-<!-- grid list style -->
+{{ if .Site.Params.allliststyle }}
+ <script src="{{ "/js/w3.js" | relURL }}"></script>
+ <p>
+ <input oninput="w3.filterHTML('#id01', '.item', this.value)" class="w3-input" placeholder="{{ T "postssearch"}}">
+ </p>
+ <div style="overflow-x:auto;">
+ <table id="id01" class="w3-table-all w3-hoverable">
+ <tr class="w3-green" style="white-space:nowrap;">
+ <th onclick="w3.sortHTML('#id01', '.item', 'td:nth-child(1)')" style="cursor:pointer">{{ T "poststitle"}} <i class="fa fa-sort" style="font-size:13px;"></i></th>
+ <th onclick="w3.sortHTML('#id01', '.item', 'td:nth-child(2)')" style="cursor:pointer">{{ T "postsdate"}} <i class="fa fa-sort" style="font-size:13px;"></i>&nbsp;&nbsp;</th>
+ <th onclick="w3.sortHTMLbyNumber('#id01', '.item', 'td:nth-child(3)')" style="cursor:pointer">{{ T "postsword"}} <i class="fa fa-sort" style="font-size:13px;"></i>&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ </tr>
+ {{ if .IsHome }}
+ {{range where .Site.RegularPages "Section" "posts"}}
+ <tr class="item ">
+ <td><a href="{{.Permalink}}">{{.Title}}</a></td>
+ <td>{{ .Date.Format "2006/01/02" }}</td>
+ <td>{{.WordCount}}</td>
+ </tr>
+ {{end}}
+
+ {{ else }}
+ {{range .Pages }}
+ <tr class="item ">
+ <td><a href="{{.Permalink}}">{{.Title}}</a></td>
+ <td>{{ .Date.Format "2006/01/02" }}</td>
+ <td>{{.WordCount}}</td>
+ </tr>
+ {{end}}
+ {{ end }}
+
+ </table>
+ </div>
+{{ else }}
-{{ range $i, $e:= $paginator.Pages }}
- {{ if modBool $i 3 }}
- <div class="w3-row w3-section">
- {{ end }}
- {{ if .Site.Params.lazyload | and (gt $i 1) }}
- {{ $.Scratch.Set "novisual" 1 }}
- {{ end }}
- <div class="w3-col w3-container w3-section m12 l4 ">
- <div class="w3-card-2 w3-hover-shadow " >
+ {{ if .Site.Params.gridstyle }}
+ <!-- grid list style -->
- {{ with .Params.thumbnail }}
- <div class="w3-hover-opacity thumb">
- {{ if eq ( $.Scratch.Get "novisual") 1 }}
-
- <img src="{{ "/placeholder.svg" | relURL }}" data-src="{{ relURL . }}" alt="Thumbnail" />
- {{ else }}
-
- <img src="{{ relURL . }}" alt="Thumbnail" />
- {{ end }}
- </div>
- {{ else }}
- {{ if .Site.Params.firstpic}}
+
+ {{ range $i, $e:= $paginator.Pages }}
+ {{ if modBool $i 3 }}
+ <div class="w3-row w3-section">
+ {{ end }}
+ {{ if .Site.Params.lazyload | and (gt $i 1) }}
+ {{ $.Scratch.Set "novisual" 1 }}
+ {{ end }}
+ <div class="w3-col w3-container w3-section m12 l4 ">
+ <div class="w3-card-2 w3-hover-shadow " >
+
+ {{ with .Params.thumbnail }}
+ <div class="w3-hover-opacity thumb">
+ {{ if eq ( $.Scratch.Get "novisual") 1 }}
- {{ $img := findRE "(?i)<img .*?src\\s*=\\s*\"([^\"]*(png|jpg|jpeg|gif|bmp|svg))\".*?>" .Content 1 }}
- {{ range $img }}
-
- <div class="w3-hover-opacity thumb ">
- {{ if eq ( $.Scratch.Get "novisual") 1 }}
-
- <img src="{{ "/placeholder.svg" | relURL }}" data-src="{{ replaceRE "<img .*?src=\"(.*?)\".*?>" "$1" . }}" alt="Thumbnail"/></div>
-
- {{ else }}
- <img src="{{ replaceRE "<img .*?src=\"(.*?)\".*?>" "$1" . }}" alt="Thumbnail" /></div>
- {{ end }}
-
+ <img src="{{ "/placeholder.svg" | relURL }}" data-src="{{ relURL . }}" alt="Thumbnail" />
+ {{ else }}
+
+ <img src="{{ relURL . }}" alt="Thumbnail" />
+ {{ end }}
+ </div>
+ {{ else }}
+ {{ if .Site.Params.firstpic}}
+
+ {{ $img := findRE "(?i)<img .*?src\\s*=\\s*\"([^\"]*(png|jpg|jpeg|gif|bmp|svg))\".*?>" .Content 1 }}
+ {{ range $img }}
+
+ <div class="w3-hover-opacity thumb ">
+ {{ if eq ( $.Scratch.Get "novisual") 1 }}
+
+ <img src="{{ "/placeholder.svg" | relURL }}" data-src="{{ replaceRE "<img .*?src=\"(.*?)\".*?>" "$1" . }}" alt="Thumbnail"/></div>
+
+ {{ else }}
+ <img src="{{ replaceRE "<img .*?src=\"(.*?)\".*?>" "$1" . }}" alt="Thumbnail" /></div>
+ {{ end }}
+
+ {{ end }}
{{ end }}
{{ end }}
- {{ end }}
-
- <header class="w3-container wraptext w3-text-indigo">
- <h4><a href="{{ .URL }}">{{ .Title | markdownify }}</a></h4>
-
-
- </header>
+
+ <header class="w3-container wraptext w3-text-indigo">
+ <h4><a href="{{ .URL }}">{{ .Title | markdownify }}</a></h4>
+
+
+ </header>
- <div class="w3-container wraptext w3-white">
- <code> {{ .Date.Format "2006/01/02" }} </code>
+ <div class="w3-container wraptext w3-white">
+ <code> {{ .Date.Format "2006/01/02" }} </code>
+
-
- {{ if gt (len .Summary) 200 }}
+ {{ if gt (len .Summary) 200 }}
-
- <p>{{substr .Summary 0 200 }}...</p>
-
-
- {{ end }}
-
- </div>
+
+ <p>{{substr .Summary 0 200 }}...</p>
+
+
+ {{ end }}
+
+ </div>
- <footer >
- <a href="{{ .URL }}"><button class="w3-button w3-blue w3-block w3-hover-green">{{ T "readMore" }}</button></a>
- </footer>
- </div>
- </div>
- {{ if or (modBool (add $i 1) 3) (ge (add $i 1) $paginator.Pages) }}
+ <footer >
+ <a href="{{ .URL }}"><button class="w3-button w3-blue w3-block w3-hover-green">{{ T "readMore" }}</button></a>
+ </footer>
</div>
- {{ end }}
-
-{{ end }}
+ </div>
+ {{ if or (modBool (add $i 1) 3) (ge (add $i 1) $paginator.Pages) }}
+ </div>
+ {{ end }}
-{{ else }}
+ {{ end }}
-<!-- simple list style -->
+ {{ else }}
-<ul class="w3-ul w3-hoverable">
+ <!-- simple list style -->
+ <ul class="w3-ul w3-hoverable">
-{{ range $paginator.Pages }}
- <li>
- <span class="date">{{ .Date.Format "2006/01/02" }}</span> &nbsp;
- <a href="{{ .URL }}">{{ .Title | markdownify }}</a>
- </li>
-{{ end }}
-{{ end }}
-</ul>
-</div>
+ {{ range $paginator.Pages }}
+ <li>
+ <span class="date">{{ .Date.Format "2006/01/02" }}</span> &nbsp;
+ <a href="{{ .URL }}">{{ .Title | markdownify }}</a>
+ </li>
+ {{ end }}
+ {{ end }}
+ </ul>
-<br>
-<div class="w3-content" >
- <div class="w3-bar w3-section w3-hide-large w3-hide-medium">
-
- {{ with $paginator.Prev -}}
- <a href="{{ .URL }}" class="w3-btn w3-text-indigo w3-hover-green">&#10094; Previous</a>
- {{- end }}
- {{ with $paginator.Next -}}
- <a href="{{ .URL }}" class="w3-btn w3-right w3-text-indigo w3-hover-green">Next &#10095;</a>
- {{- end }}
-</div>
-<nav class="w3-center w3-hide-small">{{ template "_internal/pagination.html" . }}</nav>
-</div>
+ </div>
-{{- end }}
+ <br>
+ <div class="w3-content" >
+ <div class="w3-bar w3-section w3-hide-large w3-hide-medium">
+
+ {{ with $paginator.Prev -}}
+ <a href="{{ .URL }}" class="w3-btn w3-text-indigo w3-hover-green">&#10094; Previous</a>
+ {{- end }}
+ {{ with $paginator.Next -}}
+ <a href="{{ .URL }}" class="w3-btn w3-right w3-text-indigo w3-hover-green">Next &#10095;</a>
+ {{- end }}
+ </div>
+ <nav class="w3-center w3-hide-small">{{ template "_internal/pagination.html" . }}</nav>
+
+ {{- end }}
+</div>
+{{ end }}