Skip to content

Commit

Permalink
Merge pull request #3 from jusx/feature-limit-more-archives
Browse files Browse the repository at this point in the history
Show archives link only when more than 3 posts.
  • Loading branch information
jusx committed Nov 22, 2017
2 parents 41e895a + 2fe0862 commit eab4c7a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -46,6 +46,14 @@ Any content in this file will be included in the page.

Alternately you can simply fork this repo and go from there.

## Details

- Really Simple will display up to three posts fully on the home page.

- Link to archives in the header and at the end of the home page will only display when there are more than 3 posts.

- The header has two links: `Archives` and `About`. Really Simple expects these files to be in the root project folder. The `jekyll new` command will create a dummy `about.md` file in the root folder. Remove the layout metadata so that the Really Simple default template is used.

## Contributions
Bug reports and pull requests are most welcome.

Expand Down
7 changes: 6 additions & 1 deletion _layouts/default.html
Expand Up @@ -10,7 +10,12 @@
<div class="content">
<div class="header">
<a class="title" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
<span class="nav">&raquo; <a href="{{ "archives" | relative_url }}">archives</a> &nbsp;&raquo; <a href="{{ "about" | relative_url }}">about</a></span>
<span class="nav">
{% if site.posts.size > 3 %}
&raquo; <a href="{{ "archives" | relative_url }}">archives</a>
{% endif %}
&nbsp;&raquo; <a href="{{ "about" | relative_url }}">about</a>
</span>
</div>

{{ content }}
Expand Down
2 changes: 2 additions & 0 deletions _layouts/home.html
Expand Up @@ -21,5 +21,7 @@ <h1 class="post-title">
{% endfor %}
</ul>

{% if site.posts.size > 3 %}
<a class="post-link" href="{{ "pages/archives" | relative_url }}">More...</a>
{% endif %}
</div>

0 comments on commit eab4c7a

Please sign in to comment.