Skip to content

Commit

Permalink
added better blog page
Browse files Browse the repository at this point in the history
  • Loading branch information
hitblast committed Nov 9, 2024
1 parent 5d01256 commit d4d92cb
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 6 deletions.
2 changes: 1 addition & 1 deletion content/blogs/testblog.md → content/blogs/testblog 1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Test Blog"
title = "Example blog post with a very huge title that is very long and will be truncated in the index page."
date = 2024-11-08
description = "A simple test blog."
[taxonomies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title = "Test Blog"
title = "Example blog post"
date = 2024-11-08
description = "A simple test blog."
[taxonomies]
Expand Down
31 changes: 31 additions & 0 deletions static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,37 @@ article {
width: 100%;
}

/* Blog-specific styling */
.blog-post {
padding: 2rem;
width: 60%;
text-align: left;
}

.blog-post-left {
display: inline-block;
font-size: 1.25rem;
}
.blog-post-left:hover {
color: #fff;
}
.blog-post-left p {
margin-top: 1rem;
font-size: 1.1rem;
opacity: 0.85rem;
}

.blog-post-right {
opacity: 0.5;
padding-top: 1rem;
float: right;
font-size: 0.85rem;
}
.blog-post-right i,
.blog-post-left i {
margin-right: 5px;
}

/* Media queries */
@media (min-width: 1025px) {
.container {
Expand Down
18 changes: 14 additions & 4 deletions templates/blogs.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
{% extends "base.html" %} {% block content %}

<center>
<h1>Latest Blogs</h1>
<h1><i class="fa-solid fa-mug-hot"></i> Latest <u>Blogs</u></h1>
<hr />

{% if paginator.pages|length == 0 %} no blogs! {%else%} {% for page in
paginator.pages %}

<a href="{{ page.permalink | safe }}">{{ page.title }}</a> on {{ page.date |
date(format="%b %d, %Y") }} <br />
<!-- {# COMMENT: find all attributes from https://www.getzola.org/documentation/content/page/ #} -->
<div class="blog-post">
<div class="blog-post-left pico-color-sand-500">
<a href="{{ page.permalink | safe }}"> {{ page.title }} </a>
<p>{{ page.description }}</p>
</div>
<div class="blog-post-right">
<i class="fa-solid fa-hourglass-half"></i> {{ page.date |
date(format="%b %d, %Y") }}
</div>
</div>

{% endfor %} {% endif %} {% endblock content %}
</center>

0 comments on commit d4d92cb

Please sign in to comment.