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

github.com/bul-ikana/hugo-cards.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Aguirre <bul.ikana@gmail.com>2018-09-30 01:57:20 +0300
committerHugo Aguirre <bul.ikana@gmail.com>2018-09-30 01:57:20 +0300
commit34ff648b1ef1571a2c5fa19e79e509d1b883db1c (patch)
tree00276754ce8fd2602d1cf177ff1f8dd6a31cd20f
parent3748934f63ad9c45a53772391883c9b8ddcebb5c (diff)
Add layout for pages and separate them from posts
-rw-r--r--layouts/_default/list.html3
-rw-r--r--layouts/pages/single.html20
-rw-r--r--layouts/partials/header.html4
-rw-r--r--layouts/partials/sidebar.html2
4 files changed, 25 insertions, 4 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 160b321..202bf69 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -5,7 +5,8 @@
<div class="row pack">
- {{ range .Paginator.Pages }}
+ {{ $paginator := .Paginate (where .Pages "Section" "posts") }}
+ {{ range $paginator.Pages }}
<div class="col-md-4 card">
<a href="{{ .Permalink }}" class="index-anchor">
<div class="panel panel-default">
diff --git a/layouts/pages/single.html b/layouts/pages/single.html
new file mode 100644
index 0000000..178ea10
--- /dev/null
+++ b/layouts/pages/single.html
@@ -0,0 +1,20 @@
+{{ define "main" }}
+<div class="row">
+<div class="col-md-8">
+<article class="post">
+
+ <header class="post-header">
+ <h1 class="post-title">{{ .Title }}</h1>
+ </header>
+
+ <div class="post-content">
+ {{ .Content }}
+ </div>
+
+</article>
+</div>
+{{ partial "sidebar.html" . }}
+</div>
+
+{{ partial "fb-script.html" . }}
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 165b669..1df3cad 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -15,8 +15,8 @@
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse " id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
- <li><a href="{{ .Site.BaseURL }}about/">About</a></li>
- <li><a href="{{ .Site.BaseURL }}contact/">Contact</a></li>
+ <li><a href="{{ .Site.BaseURL }}pages/about/">About</a></li>
+ <li><a href="{{ .Site.BaseURL }}pages/contact/">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Download <span class="caret"></span></a>
<ul class="dropdown-menu">
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 5fc9f36..d3a5752 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -11,7 +11,7 @@
<div class="mt10 recent">
<h2>Recent articles</h2>
<ul>
- {{ range first 3 .Site.RegularPages }}
+ {{ range first 3 (where .Site.RegularPages "Section" "posts") }}
<li>
<p><a href="{{ .URL }}">{{ .Title }}</a><small>&nbsp;&nbsp;{{ .Date.Format "January 2, 2006" }}</small></p>