Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Data.Pages replaced with Site.RegularPages,UniqueID deprecated use .F… #77

Merged
merged 1 commit into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions exampleSite/content/posts/creating-a-new-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ $ vi themes/zafta/layouts/index.html
<!DOCTYPE html>
<html>
<body>
{{ range first 10 .Data.Pages }}
{{ range first 10 .Site.RegularPages }}
<h1>{{ .Title }}</h1>
{{ end }}
</body>
Expand Down Expand Up @@ -838,7 +838,7 @@ $ vi themes/zafta/layouts/index.html
<!DOCTYPE html>
<html>
<body>
{{ range first 10 .Data.Pages }}
{{ range first 10 .Site.RegularPages }}
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
{{ end }}
</body>
Expand Down Expand Up @@ -956,14 +956,14 @@ $ vi themes/zafta/layouts/index.html
<html>
<body>
<h1>posts</h1>
{{ range first 10 .Data.Pages }}
{{ range first 10 .Site.RegularPages }}
{{ if eq .Type "post"}}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ end }}

<h1>pages</h1>
{{ range .Data.Pages }}
{{ range .Site.RegularPages }}
{{ if eq .Type "page" }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
{{ end }}
Expand Down Expand Up @@ -1043,14 +1043,14 @@ $ vi themes/zafta/layouts/index.html
{{ partial "header.html" . }}

<h1>posts</h1>
{{ range first 10 .Data.Pages }}
{{ range first 10 .Site.RegularPages }}
{{ if eq .Type "post"}}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ end }}

<h1>pages</h1>
{{ range .Data.Pages }}
{{ range .Site.RegularPages }}
{{ if or (eq .Type "page") (eq .Type "about") }}
<h2><a href="{{ .Permalink }}">{{ .Type }} - {{ .Title }} - {{ .RelPermalink }}</a></h2>
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/cards/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="ui inverted segment">
<h2 class="ui header">{{ i18n "allCards" }}<hr><div class="ui grey sub header">{{ .Content }}</div></h2>

{{ range .Data.Pages.GroupByDate "2006" }}
{{ range .Site.RegularPages.GroupByDate "2006" }}
<h3 class="ui header">{{ .Key }}</h3>
<ul>
{{ range .Pages }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

{{/*Navigation buttons*/}}
{{ if or .context.IsHome (eq .context.Kind "taxonomyTerm") }}
{{ $paginator := .context.Paginate (where .context.Data.Pages "Section" .contentType) }}
{{ $paginator := .context.Paginate (where .context.Site.RegularPages "Section" .contentType) }}
<div class="item">
{{ if .context.Paginator.HasPrev }}
<a href="{{ $paginator.Prev.URL }}">
Expand Down
2 changes: 1 addition & 1 deletion layouts/posts/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3><a class="title" href={{ .Permalink }}>{{ .Title }}</a></h3>
<div class="utility-info">
<ul class="utility-list">
{{ if $.Site.DisqusShortname }}
<div><i class="comment icon"></i><span class="disqus-comment-count" data-disqus-identifier="{{ .UniqueID }}"></span></div>
<div><i class="comment icon"></i><span class="disqus-comment-count" data-disqus-identifier="{{ .File.UniqueID }}"></span></div>
{{ end }}
<div><span><i class="calendar icon"></i>{{ .Date.Format "Jan 2, 2006" }}</span></div>
<div><span><i class="clock icon"></i>{{ .ReadingTime }} min read</span></div>
Expand Down
2 changes: 1 addition & 1 deletion layouts/posts/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2 class="ui header">{{ i18n "archive" }}<hr>
<div class="ui grey sub header">{{ .Content }}</div>
</h2>

{{ range .Data.Pages.GroupByDate "2006" }}
{{ range .Site.RegularPages.GroupByDate "2006" }}
<h3 class="ui header">{{ .Key }}</h3>
<ul>
{{ range .Pages }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1 class="post-title">
<div class="sub header">
<div><span><i class="calendar outline icon"></i>{{ .Date.Format "Jan 2, 2006" }}</span></div>
{{ if $.Site.DisqusShortname }}
<div><span class="disqusComment"><i class="comment outline icon"></i><a href="{{ .Permalink }}#disqus_thread" class="disqus-comment-count" data-disqus-identifier="{{ .UniqueID }}"></a></span></div>{{ end }}
<div><span class="disqusComment"><i class="comment outline icon"></i><a href="{{ .Permalink }}#disqus_thread" class="disqus-comment-count" data-disqus-identifier="{{ .File.UniqueID }}"></a></span></div>{{ end }}
<div><span><i class="clock outline icon"></i>{{ .ReadingTime }} min read</span></div>
<div><span><i class="angle double up icon"></i>{{ i18n "lastUpdate" }} {{ dateFormat "Jan 2, 2006" .Lastmod }}</span></div>
</div>
Expand Down