Skip to content

Commit

Permalink
List all content types in homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
jultty committed Nov 17, 2024
1 parent b5764ba commit 0e1d340
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
12 changes: 12 additions & 0 deletions static/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ footer {
grid-template-columns: 13% 64% 10% 13%;
}

.index-h2 {
font-size: 1em;
margin-left: 14%;
padding-left: 20px;
margin-top: 40px;
}

.index-posts ul#posts {
margin-left: 14%;
padding-left: 20px;
Expand All @@ -282,6 +289,11 @@ footer {
padding-left: 20px;
}

.index-see-all {
margin-left: 14%;
padding-left: 20px;
}

.article {
margin: 0 45px;
}
Expand Down
48 changes: 48 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

{% block content %}

<h2 class="index-h2">Latest posts</h2>
{%- if lang == "pt" %}
{%- set posts = get_section(path="posts/_index.pt.md") %}
{%- else %}
Expand All @@ -32,7 +33,54 @@
<span class="post-date">{{ post.date }}</span>
<a href="{{ post.permalink | safe }}">{{ post.title }}</a>
</li>
{% if loop.index == 5 %}{% break %}{% endif %}
{% endfor %}
</ul>
</nav>
<a class="index-see-all" href="{{ posts.permalink }}">
{%- if lang == "pt" %}Ver todos{% else %}See all{% endif %}
</a>

<h2 class="index-h2">Latest notes</h2>
{%- if lang == "pt" %}
{%- set notes = get_section(path="notes/_index.pt.md") %}
{%- else %}
{%- set notes = get_section(path="notes/_index.md") %}
{%- endif %}
<nav class="index-posts">
<ul id="posts">
{% for note in notes.pages %}
<li>
<span class="post-date">{{ note.date }}</span>
<a href="{{ note.permalink | safe }}">{{ note.title }}</a>
</li>
{% if loop.index == 5 %}{% break %}{% endif %}
{% endfor %}
</ul>
</nav>
<a class="index-see-all" href="{{ notes.permalink }}">
{%- if lang == "pt" %}Ver todos{% else %}See all{% endif %}
</a>

<h2 class="index-h2">Latest links</h2>
{%- if lang == "pt" %}
{%- set links = get_section(path="links/_index.pt.md") %}
{%- else %}
{%- set links = get_section(path="links/_index.md") %}
{%- endif %}
<nav class="index-posts">
<ul id="posts">
{% for link in links.pages %}
<li>
<span class="post-date">{{ link.date }}</span>
<a href="{{ link.permalink | safe }}">{{ link.title }}</a>
</li>
{% if loop.index == 5 %}{% break %}{% endif %}
{% endfor %}
</ul>
</nav>
<a class="index-see-all" href="{{ links.permalink }}">
{%- if lang == "pt" %}Ver todos{% else %}See all{% endif %}
</a>

{%- endblock content %}

0 comments on commit 0e1d340

Please sign in to comment.