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

github.com/parsiya/Hugo-Octopress.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsiya <parsiya@gmail.com>2018-11-23 20:04:38 +0300
committerparsiya <parsiya@gmail.com>2018-11-23 20:04:38 +0300
commitdc15df8630c240fb96ac58a510dbfc7bac6619d9 (patch)
treee2091dfdc2c2019801308e63d40857003781b76d /layouts
parent465cee42bfb1ac1001a9e1eb89ca75eaaa444458 (diff)
Add compact index view
Diffstat (limited to 'layouts')
-rw-r--r--layouts/index.html45
-rwxr-xr-xlayouts/partials/classic_index.html42
-rwxr-xr-xlayouts/partials/compact_index.html36
-rw-r--r--layouts/partials/header.html4
4 files changed, 85 insertions, 42 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 331398c..4707897 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,42 +1,7 @@
{{ partial "header.html" . }}
-<div id="main">
- <div id="content">
- <div class="blog-index">
- {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
- {{ range $paginator.Pages }}
- <article>
-
- {{ .Scratch.Set "isHome" true }}
- {{ partial "post_header.html" . }}
-
- {{ if eq .Site.Params.truncate false }}
- {{ .Content }}
- {{ else if .Description }}
- {{ .Description }}
- <footer>
- <a href="{{ .Permalink }}" rel="full-article">{{ with .Site.Params.continueReadingText }}{{ . | markdownify }}{{ else }}Read On &rarr;{{ end }}</a>
- </footer>
- {{ else }}
- <p>{{ .Summary }}</p>
-
- {{ if .Truncated }}
- <footer>
- <a href="{{ .Permalink }}" rel="full-article">{{ with .Site.Params.continueReadingText }}{{ . | markdownify }}{{ else }}Read On &rarr;{{ end }}</a>
- </footer>
- {{ end }}
-
- {{ end }}
-
- </article>
- {{ end }}
- <!-- {{ template "_internal/pagination.html" . }} default pagination -->
- {{ partial "pagination.html" . }} <!-- use custom pagination -->
-
- </div>
-
- {{ partial "sidebar.html" . }} <!-- sidebar -->
- </div>
-</div>
-
-{{ partial "footer.html" . }} <!-- footer -->
+{{ if .Site.Params.compactIndex }}
+ {{ partial "compact_index.html" . }}
+{{ else }}
+ {{ partial "classic_index.html" . }}
+{{ end }}
diff --git a/layouts/partials/classic_index.html b/layouts/partials/classic_index.html
new file mode 100755
index 0000000..64b88bb
--- /dev/null
+++ b/layouts/partials/classic_index.html
@@ -0,0 +1,42 @@
+<!-- Partial for classic index page -->
+
+<div id="main">
+ <div id="content">
+ <div class="blog-index">
+ {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
+ {{ range $paginator.Pages }}
+ <article>
+
+ {{ .Scratch.Set "isHome" true }}
+ {{ partial "post_header.html" . }}
+
+ {{ if eq .Site.Params.truncate false }}
+ {{ .Content }}
+ {{ else if .Description }}
+ {{ .Description }}
+ <footer>
+ <a href="{{ .Permalink }}" rel="full-article">{{ with .Site.Params.continueReadingText }}{{ . | markdownify }}{{ else }}Read On &rarr;{{ end }}</a>
+ </footer>
+ {{ else }}
+ <p>{{ .Summary }}</p>
+
+ {{ if .Truncated }}
+ <footer>
+ <a href="{{ .Permalink }}" rel="full-article">{{ with .Site.Params.continueReadingText }}{{ . | markdownify }}{{ else }}Read On &rarr;{{ end }}</a>
+ </footer>
+ {{ end }}
+
+ {{ end }}
+
+ </article>
+ {{ end }}
+ <!-- {{ template "_internal/pagination.html" . }} default pagination -->
+ {{ partial "pagination.html" . }} <!-- use custom pagination -->
+
+ </div>
+
+ {{ partial "sidebar.html" . }} <!-- sidebar -->
+ </div>
+ </div>
+
+ {{ partial "footer.html" . }} <!-- footer --> \ No newline at end of file
diff --git a/layouts/partials/compact_index.html b/layouts/partials/compact_index.html
new file mode 100755
index 0000000..43f70e0
--- /dev/null
+++ b/layouts/partials/compact_index.html
@@ -0,0 +1,36 @@
+<!-- Partial for compact index -->
+
+<style>
+table.allposts, td.allposts-date, td.allposts-title {
+ border:none;
+}
+
+td.allposts-date {
+ padding: 0 0.5em 0 0;
+}
+
+td.allposts-title {
+ font-size: 110%;
+}
+</style>
+
+<div id="main">
+ <div id="content">
+ <div>
+ <article role="article">
+ <table class="allposts">
+ {{ range (where .Site.Pages "Type" "post") }}
+ {{ if .IsPage }}
+ <tr>
+ <td class="allposts-date"><strong>{{ .Date | dateFormat "2006"}} {{ .Date | dateFormat "Jan" }} {{ .Date | dateFormat "2" }}</strong></td>
+ <td class="allposts-title"><a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a></td>
+ </tr>
+ {{ end }}
+ {{ end }}
+ </table>
+ </article>
+ </div>
+ {{ partial "sidebar.html" . }}
+ </div>
+</div>
+{{ partial "footer.html" . }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 9bd9457..4b89455 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -60,10 +60,10 @@
{{ end }}
</head>
-<body{{ with .Site.Params.theme }} class="{{ . }}"{{ end }}>
+<body>
<!-- top header for octopress -->
-<header role="banner">{{ partial "octo-header.html" . }}</header>
+<header role="banner">{{ partial "octo_header.html" . }}</header>
<!-- navigation -->
<nav role="navigation">{{ partial "navigation.html" . }}</nav>