Skip to content

Commit

Permalink
Add Blog Hub
Browse files Browse the repository at this point in the history
- Added a blog hub
- Added a LICENCE
- Generalized some post layout through _config.yaml
- Posts now have tags
- Posts now have excerpts
  • Loading branch information
Perseus333 committed Oct 27, 2024
1 parent f7bdefb commit e032289
Show file tree
Hide file tree
Showing 12 changed files with 727 additions and 8 deletions.
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
- [x] Make katex work
- [x] Make homepage image .webp
- [x] Add a favicon
- [ ] Add tags to blogs
- [ ] Convert images to webp or aviff
- [ ] Add blog homepage
- [x] Add tags to blogs
- [x] Convert images to webp
- [x] Add blog homepage
- [ ] Add support for RSS
- [ ] Add a project
- [ ] Add projects template
Expand Down
8 changes: 8 additions & 0 deletions _config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ markdown: kramdown
kramdown:
math_engine: katex

defaults:
-
scope:
path: "\_posts"
values:
layout: "posts"
excerpt_separator: <!--more-->

exclude:
- README.md
- vendor/
1 change: 1 addition & 0 deletions _includes/posts-hub-style.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" href="/src/styles/posts-hub.css"></link>
2 changes: 1 addition & 1 deletion _includes/trees.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</li>
{% endfor %}
<li>
<a href="/404.html">more...</a>
<a href="/src/posts-hub.html">more...</a>
</li>
</ul>
</li>
Expand Down
6 changes: 6 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
{% include themes-style.html %}
{% include trees-style.html %}
{% include post-style.html %}
{% if page.style %}
{% include {{page.style}}-style.html %}
{% endif %}
{% if page.katex %}
<!--KaTeX loading-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
Expand All @@ -30,6 +33,9 @@
</div>
<div id="content">
<h1>{{ page.title }}</h1>
{% if page.tag %}
<p class="tag">{{ page.tag }}</p>
{% endif %}
{{ content }}
</div>
</div>
Expand Down
8 changes: 6 additions & 2 deletions _posts/2024-09-21-memories-and-dreams.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
title: Memories and dreams
layout: post
title: "Memories and dreams"
tag: "philosophy"
---

Did you enjoy a good draem if you don't remember it? Should we focus on creating or remembering memories? I will try to find an answer these in this post.

<!--more-->

{2024-09-21}
## General Ideas

Expand Down
6 changes: 4 additions & 2 deletions _posts/2024-10-26-hanoi-tower.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: Hanoi & sum of powers
layout: post
title: "Hanoi & sum of powers"
tag: "math"
katex: True
---

In this mini-essay I want to cover some interesting formulas relating the sum of the powers and how they relate to the Tower of Hanoi problem.

<!--more-->

## Backstory

This all started a year or so ago during a math class when me and my friend were analyzing the amount of moves necessary to solve a Tower of Hanoi. We noticed analytically that the amount of moves requiered to solve a tower were this:
Expand Down
Empty file removed _posts/posts-home.html
Empty file.
19 changes: 19 additions & 0 deletions src/posts-hub.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
layout: post
title: Posts Hub
style: posts-hub
---

<div id="posts-list">
{% for post in site.posts %}
<div class="post">
<div class="post-header">
<a href="{{ post.url }}">{{ post.title }} - {{post.date | date_to_string}}</a>
<p class="tag">{{ post.tag }}</p>
</div>
<div class="post-content">
{{ post.excerpt }}
</div>
</div>
{% endfor %}
</div>
9 changes: 9 additions & 0 deletions src/styles/post.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
position: relative;
}

.tag::before {
content: "#";
}

.tag {
margin: inherit;
font-weight: bold;
}

/*Markdown Element styling*/

h1 {
Expand Down
9 changes: 9 additions & 0 deletions src/styles/posts-hub.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.post {
margin-bottom: 4em;
border-left: var(--border-thickness) solid var(--current-text-color);
padding-left: 2em;
}

.post-content {
font-style: italic;
}

0 comments on commit e032289

Please sign in to comment.