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

add support for _index.md #119

Open
pbexiga opened this issue Apr 6, 2024 · 1 comment
Open

add support for _index.md #119

pbexiga opened this issue Apr 6, 2024 · 1 comment

Comments

@pbexiga
Copy link

pbexiga commented Apr 6, 2024

It would be useful to be able to use the content in _index.md if needed. This way you can customize the home page.

@pbexiga
Copy link
Author

pbexiga commented Apr 6, 2024

All we need to do is add the following to layouts_default\list.html

     <div class="post-content">
       {{ .Content }}
     </div>

the complete file should look like this:

{{ define "main" }}
  <article>
    <h1>{{ .Title }}</h1>

    <div class="post-content">
      {{ .Content }}
    </div>

    <ul class="posts-list">
      {{ range where .Paginator.Pages "Type" "!=" "page" }}
        <li class="posts-list-item">
          <a class="posts-list-item-title" href="{{ .Permalink }}">{{ .Title }}</a>
          <span class="posts-list-item-description">
            {{ partial "icon.html" (dict "ctx" $ "name" "calendar") }}
            {{ .PublishDate.Format "Jan 2, 2006" }}
            <span class="posts-list-item-separator">-</span>
            {{ partial "icon.html" (dict "ctx" $ "name" "clock") }}
            {{ .ReadingTime }} min read
          </span>
        </li>
      {{ end }}
    </ul>
    {{ partial "pagination.html" $ }}
  </article>
{{ end }}

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