Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implements list.html #8

Closed
2 tasks done
raeperd opened this issue Jan 8, 2022 · 2 comments · Fixed by #12
Closed
2 tasks done

Implements list.html #8

raeperd opened this issue Jan 8, 2022 · 2 comments · Fixed by #12
Assignees
Labels
enhancement New feature or request

Comments

@raeperd
Copy link
Owner

raeperd commented Jan 8, 2022

  • Implements ArticePreview
  • Implements Pagination
{{ define "main" }}

<!-- Main Title -->
{{ if .Title }}
<h1 class="main-title">{{ .Title }}</h1>
{{ end }}

<!-- $pages -->
{{ $pages := union .RegularPages .Sections }}
<!---->{{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ end }}

<!-- Articles -->
{{ $paginator := .Paginate $pages }} {{ range $index, $page := $paginator.Pages }}
<article class="post-entry">
  <h2>{{ .Title }}</h2>
  <time>{{ .Date | time.Format ":date_medium" }}</time>
  <a href="{{ .Permalink }}"></a>
</article>
{{ end }}

<!-- Main Nav -->
{{ if gt $paginator.TotalPages 1 }}
<nav class="main-nav">
  {{ if $paginator.HasPrev }}
  <a class="prev" href="{{ $paginator.Prev.URL }}">← {{ i18n "prev_page" }}</a>
  {{ end }}<!---->
  {{ if $paginator.HasNext }}
  <a class="next" href="{{ $paginator.Next.URL }}">{{ i18n "next_page" }} →</a>
  {{ end }}
</nav>
{{ end }}<!---->

{{ end }}
@raeperd raeperd added the enhancement New feature or request label Jan 8, 2022
@raeperd raeperd self-assigned this Jan 8, 2022
raeperd added a commit that referenced this issue Jan 9, 2022
raeperd added a commit that referenced this issue Jan 9, 2022
raeperd added a commit that referenced this issue Jan 9, 2022
raeperd added a commit that referenced this issue Jan 9, 2022
raeperd added a commit that referenced this issue Jan 9, 2022
raeperd added a commit that referenced this issue Jan 9, 2022
@raeperd
Copy link
Owner Author

raeperd commented Jan 9, 2022

911f682 Implements ArticlePreview

Before
image

After
image

raeperd added a commit that referenced this issue Jan 9, 2022
raeperd added a commit that referenced this issue Jan 9, 2022
@raeperd
Copy link
Owner Author

raeperd commented Jan 9, 2022

911f682 Implements Pagination

Before

image

After

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant