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

Change home page layout to /posts #140

Open
krossovochkin opened this issue Sep 11, 2021 · 0 comments
Open

Change home page layout to /posts #140

krossovochkin opened this issue Sep 11, 2021 · 0 comments

Comments

@krossovochkin
Copy link

Hi

I'd like to change how home page is looking.
Particularly, I'd like it to look the same way /posts page is looking

It feels to me that I need to replace in /layouts/index.html the following code:

{{ define "content" }}
  <div class="post-list">
    {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" site.Params.mainSections) }}
    {{ range $paginator.Pages }}
      {{ if .Draft }}
        {{ .Scratch.Set "draftPage" true }}
      {{ else }}
        {{ .Scratch.Set "draftPage" false }}
      {{ end }}
      <div class="post-list__item">
        <span class="item__title--big">
          <a href="{{ .RelPermalink }}" {{if .Scratch.Get "draftPage" }}class="draft"{{end}}>{{ .Title }}</a>
        </span>
        <span class="item__date">
          {{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }}
        </span>
        <span {{if .Scratch.Get "draftPage" }}class="draft"{{end}}>
        {{ if .Description }}
        {{ .Description }}
        {{ else }}
        {{ .Summary }}
        {{ end }}
        </span>
        {{ if .Truncated }}
          ... <a class="read-more-symbol" href="{{ .RelPermalink }}">➦</a>
        {{ end }}
        </div>
        {{ .Scratch.Delete "draftPage" }}
     {{ end }}
  </div>
  {{ partial "pagination.html" . }}
{{ end }}

with the code from the page that is used on /posts screen.

Could you please help me to achieve that?
I tried to find what is used on a /post page with no luck so far

Where the content of /posts page is located?

Thank you

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

No branches or pull requests

1 participant