Add news support to website theme
All checks were successful
Builds / ExectOS WebSite (push) Successful in 31s
All checks were successful
Builds / ExectOS WebSite (push) Successful in 31s
This commit is contained in:
parent
f26705e22d
commit
cd6b01003b
@ -3,11 +3,11 @@
|
||||
{{- partial "head.html" . -}}
|
||||
<body>
|
||||
{{- partial "header.html" . -}}
|
||||
<div class="wrapper_content">
|
||||
<div class="content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
{{- partial "footer.html" . -}}
|
||||
<div class="wrapper_content">
|
||||
<div class="content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
{{- partial "footer.html" . -}}
|
||||
</body>
|
||||
</html>
|
||||
|
2
themes/exectos/layouts/news/list.html
Normal file
2
themes/exectos/layouts/news/list.html
Normal file
@ -0,0 +1,2 @@
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" (slice "news")) }}
|
||||
{{ partial "list.html" (dict "context" . "paginator" $paginator) }}
|
39
themes/exectos/layouts/partials/list.html
Normal file
39
themes/exectos/layouts/partials/list.html
Normal file
@ -0,0 +1,39 @@
|
||||
{{ with .context }}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{- partial "head.html" . -}}
|
||||
<body>
|
||||
{{- partial "header.html" . -}}
|
||||
<div class="wrapper_content">
|
||||
<div class="content">
|
||||
<h2>{{ .Title }}</h2>
|
||||
{{ range $.paginator.Pages }}
|
||||
<section class="news">
|
||||
<h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
|
||||
<div class="news_info">
|
||||
<div class="news_author">{{ if isset .Params "author" }}by {{ .Params.author }}{{ end }}</div>
|
||||
<div class="news_date"><i class="fa fa-calendar"></i> {{ .Date.Format .Site.Params.dateFormat }}</div>
|
||||
</div>
|
||||
<div class="news_intro">{{ .Summary }}</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<li><a href="{{ .Site.BaseURL }}{{ .Paginator.Prev.URL }}">← Newer</a></li>
|
||||
{{ else }}
|
||||
<li><a href="#">← Newer</a></li>
|
||||
{{ end }}
|
||||
{{ if .Paginator.HasNext }}
|
||||
<li><a href="{{ .Site.BaseURL }}{{ .Paginator.Next.URL }}">Older →</a></li>
|
||||
{{ else }}
|
||||
<li><a href="#">Older →</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{- partial "footer.html" . -}}
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
@ -224,6 +224,48 @@ pre code {
|
||||
text-align : center;
|
||||
}
|
||||
|
||||
.news_author {
|
||||
color : #999999;
|
||||
float : left;
|
||||
}
|
||||
|
||||
.news_date {
|
||||
color : #999999;
|
||||
float : right;
|
||||
}
|
||||
|
||||
.news_info {
|
||||
margin-top : -1em;
|
||||
margin-bottom : 3em;
|
||||
}
|
||||
|
||||
.news_intro {
|
||||
margin-bottom : 50px;
|
||||
margin-left : -1em;
|
||||
text-align : justify;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin : 0px;
|
||||
padding : 0 0 0 0;
|
||||
text-align : center;
|
||||
}
|
||||
|
||||
.pagination a {
|
||||
text-decoration : none;
|
||||
}
|
||||
|
||||
.pagination li {
|
||||
display : inline;
|
||||
margin-left : 100px;
|
||||
}
|
||||
|
||||
.pagination ul {
|
||||
margin : 0px;
|
||||
padding : 0px;
|
||||
text-align : center;
|
||||
}
|
||||
|
||||
.wrapper_content {
|
||||
margin-bottom : 2.5em;
|
||||
padding : 6em 0 0 0;
|
||||
|
Loading…
Reference in New Issue
Block a user