Skip to content
This repository has been archived by the owner on May 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3 from igilham/master
Browse files Browse the repository at this point in the history
added ability to hide a page from index
  • Loading branch information
rakuishi committed Mar 11, 2016
2 parents cfd5432 + a0e2515 commit 4bb68ef
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ In this theme you can add variables to your site config file. The following is t
email = "rakuishi@gmail.com"
analytics = "UA-12345678-9"

`copyright` may contain safe HTML, such as a link to a license.

### Hide pages from the homepage list

To exclude a page from the list on the homepage (e.g. `content/about.md`), set the following property in the page's frontmatter:

hidefromhome = true

## License

MIT License
Expand Down
7 changes: 7 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
date = "now()"
slug = ""
tags = ["", ""]
title = ""

+++
4 changes: 2 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{ partial "header.html" . }}

<main role="main">
{{ range .Data.Pages }}
{{ range (where .Data.Pages ".Params.hidefromhome" "!=" "true") }}
<article itemscope itemtype="http://schema.org/Blog">
<h2 class="entry-title" itemprop="headline"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
<span class="entry-meta"><time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 02, 2006" }}</time></span>
</article>
{{ end }}
</main>

{{ partial "footer.html" . }}
{{ partial "footer.html" . }}
4 changes: 2 additions & 2 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{ with .Site.Params.facebook }}<a href="{{ . }}" target="_blank">Facebook</a></span>{{ end }}
{{ with .Site.Params.github }}<a href="{{ . }}" target="_blank">GitHub</a></span>{{ end }}
</div>
<div class="copyright">Copyright &copy; {{ .Site.Params.copyright }}</div>
<div class="copyright">Copyright &copy; {{ .Site.Params.copyright | safeHTML }}</div>
</footer>

</div>
Expand All @@ -25,4 +25,4 @@
<script>hljs.initHighlightingOnLoad();</script>

</body>
</html>
</html>

0 comments on commit 4bb68ef

Please sign in to comment.