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

Support list layouts / list page template #172

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
7 changes: 7 additions & 0 deletions exampleSite/content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Blogs
sidebar: false
sidebarlogo: fresh-white-alt
---

Check out all of our blog posts
7 changes: 7 additions & 0 deletions exampleSite/content/howto/get_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Get Started
sidebar: true
sidebarlogo: fresh-white-alt
---

Get Started Content Placeholder
7 changes: 7 additions & 0 deletions exampleSite/content/howto/user_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: User Guide
sidebar: true
sidebarlogo: fresh-white-alt
---

User Guide Content Placeholder
8 changes: 6 additions & 2 deletions exampleSite/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,21 @@ params:
column2:
title: "Docs"
links:
- text: Index
link: /howto
- text: Get started
link: /
link: /howto/get_started
- text: User guides
link: /
link: /howto/user_guide
- text: Admin guide
link: /
- text: Developers
link: /
column3:
title: "Blog"
links:
- text: All blog posts
link: /blog
- text: Latest news
link: /blog/first
- text: Tech articles
Expand Down
42 changes: 41 additions & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
{{ "<!-- Layout with no content to avoid WARN message about missing page layout -->" | safeHTML }}
{{ define "main" }}

{{ partial "navbar.html" . }}
{{ partial "navbar-clone.html" . }}

<section class="section is-medium">
<div class="container">
<div class="columns">
<div class="column is-centered-tablet-portrait">
<h1 class="title section-title">{{ .Title }}</h1>
<h5 class="subtitle is-5 is-muted">{{ .Params.Subtitle }}</h5>
<div class="divider"></div>
</div>
</div>

<div class="content">
{{ if .Content }}
{{ .Content }}
{{ end }}

<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>

</div>
</div>
</section>

{{ if .Params.include_footer }}
{{ partial "footer.html" . }}
{{ end }}

{{ if .Params.sidebar }}
{{ partial "single/sidebar.html" . }}
{{ end }}

{{ end }}