diff options
Diffstat (limited to 'layouts/_default')
-rw-r--r-- | layouts/_default/baseof.html | 6 | ||||
-rw-r--r-- | layouts/_default/home.html | 31 | ||||
-rw-r--r-- | layouts/_default/index.json | 5 | ||||
-rw-r--r-- | layouts/_default/list.html | 43 | ||||
-rw-r--r-- | layouts/_default/single.html | 52 |
5 files changed, 30 insertions, 107 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e2e4362..a984f1c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,14 +4,10 @@ {{ partial "head.html" . }} </head> <body> - <main class="container"> <header> {{ partial "header.html" . }} </header> {{ block "main" . }}{{ end }} - <footer> - {{ partial "footer.html" . }} - </footer> - </main> + {{ partial "footer.html" . }} </body> </html> diff --git a/layouts/_default/home.html b/layouts/_default/home.html deleted file mode 100644 index b160025..0000000 --- a/layouts/_default/home.html +++ /dev/null @@ -1,31 +0,0 @@ -{{ define "main" }} -<div class="row"> - <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 last-xs last-sm first-md first-lg sidebar"> - <article> - <header>Навигатор</header> - {{ partial "menu.html" (dict "menuID" "sections" "page" .) }} - </article> - </div> - <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8"> - <article> - <header> - <div class="row between-xs"> - <span class="p-name"> {{ .Title }} </span> - <a href="/feed">{{ partial "icon.html" "rss" }}</a> - </div> - </header> - {{ if .Params.Image }} - <img src="{{.Params.Image}}" /> - {{ end }} - <div class="p-summary">{{ .Summary }}</div> - <div class="e-content">{{ .Content }}</div> - </article> - {{ $pages := where site.RegularPages "Type" "posts" }} - {{ $paginator := .Paginate $pages 7 }} - {{ range $paginator.Pages }} - {{ partial "list.html" . }} - {{ end }} - <nav>{{ partial "pagination.html" . }}</nav> - </div> -</div> -{{ end }} diff --git a/layouts/_default/index.json b/layouts/_default/index.json new file mode 100644 index 0000000..c93f805 --- /dev/null +++ b/layouts/_default/index.json @@ -0,0 +1,5 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} + {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 860fd5c..365d386 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,29 +1,22 @@ {{ define "main" }} -<div class="row"> - <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 last-xs last-sm first-md first-lg sidebar"> - <article> - <header>Навигатор</header> - {{ partial "menu.html" (dict "menuID" "sections" "page" .) }} - </article> - </div> - <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8"> - {{ if .Title }} - <article> - <header> - <div class="row between-xs"> - <span class="p-name"> {{ .Title }} </span> - <a href="index.xml">{{ partial "icon.html" "rss" }}</a> - </div> - </header> - {{ .Content }} - </article> - {{ end }} - {{ $paginator := .Paginate .Pages 7 }} - {{ range $paginator.Pages }} - {{ partial "list.html" . }} - {{ end }} - <nav>{{ partial "pagination.html" . }}</nav> +<div class="container"> + <div class="row"> + <div class="col-xs-12 col-sm-12 col-md-4"> + {{ if .Title }} + <h1 class="post-title fw-semibold"> + {{ .Title }} + </h1> + {{ .Content }} + <a href="index.xml" class="btn btn-primary">{{ partial "icon.html" "rss" }} Пописка</a> + {{ end }} + </div> + <div class="col-xs-12 col-sm-12 col-md-8"> + {{ $paginator := .Paginate .Pages 7 }} + {{ range $paginator.Pages }} + {{ partial "list.html" . }} + {{ end }} + <nav>{{ partial "pagination.html" . }}</nav> + </div> </div> </div> - {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2bc6870..15d4f05 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,49 +1,9 @@ {{ define "main" }} -<div class="row"> - <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 last-xs last-sm first-md first-lg sidebar"> - {{ if .Params.toc }} - <article> - <header>Содержание</header> - <aside>{{ .TableOfContents }}</aside> - </article> - {{ end }} - <article> - <header>Навигатор</header> - {{ partial "menu.html" (dict "menuID" "sections" "page" .) }} - </article> +<div class="posts-container mx-auto my-5"> + <div class="post"> + {{ partial "single/header.html" . }} + <div class="e-content">{{ .Content }}</div> + {{ partial "single/footer.html" . }} </div> - <div class="h-entry col-xs-12 col-sm-12 col-md-8 col-lg-8"> - <article> - <header> - <div class="row between-xs"> - <span class="p-name"> {{ .Title }} </span> - {{ if .Date }} - {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} - {{ $dateHuman := .Date | time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") }} - <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> - {{ end }} - </div> - </header> - {{ if .Params.Image }} - <img src="{{.Params.Image}}" /> - {{ end }} - <div class="p-summary">{{ .Summary }}</div> - <div class="e-content">{{ .Content }}</div> - <footer> - <div class="row between-xs"> - <span> - {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} - </span> - - <a class="u-url" href="{{ .Permalink }}">#</a> - - {{ if .Params.Location }} - <span class="p-location">@ {{.Params.Location}}</span> - {{ end }} - </div> - </footer> - </article> - {{ if .Params.comments }} {{ partial "comments.html" . }} {{ end }} - </div> -</div> + </div> {{ end }} |