Skip to content

Commit

Permalink
reafactor post categories organization
Browse files Browse the repository at this point in the history
  • Loading branch information
dsonyy committed Nov 2, 2024
1 parent 3221b44 commit ea8b5f8
Show file tree
Hide file tree
Showing 29 changed files with 359 additions and 516 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Jekyll ignores
.jekyll-cache
_site
_draft
.jekyll-cache
.sass-cache
.jekyll-metadata
.jekyll-cache

# Misc
.vscode
36 changes: 35 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,47 @@ excerpt_separator: <!--more-->
# Keywords
keywords: ["seo", "key", "words"]

# Collections
collections:
rovers:
output: true
permalink: /rovers/:path/
layout: "post"
order: "asc"
sort_by: "title"

# Defaults
defaults:
- scope:
path: "_rovers/"
values:
title: Untitled
categories:
layout: post
read_more: false
rover:
designer:
text: N/D
launch:
text: N/D
mission:
text: N/D
destination:
text: N/D
status:
text: N/D
weight:
text: N/D
dimensions:
text: N/D

# Styling
sass:
sass_dir: _sass
style: expanded # compact, expanded or compressed

# Exclusions
exclude: ["README.md", "LICENSE"]
exclude: ["README.md", "LICENSE", "_rovers/_template.md"]

# Plugins
plugins:
Expand Down
34 changes: 0 additions & 34 deletions _draft/2022-04-02-Kalman.md

This file was deleted.

11 changes: 8 additions & 3 deletions _includes/category.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<h1>Rovers in #{{ page.category }} category</h1>
<h1>{{ include.category | capitalize }} rovers</h1>

{% for post in site.categories[page.category] %} {% include post.html post=post
%} {% endfor %}
<!-- getting all posts with included category -->
{% assign posts = site.rovers | where_exp: 'post', "post.categories contains include.category" %}

<!-- render post -->
{% for post in posts %}
{% include post.html %}
{% endfor %}
6 changes: 5 additions & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<div class="footer">
<span class="footer-text float-left">Some rights reserved.</span>
<a href="https://github.com/dsonyy/awesome-rovers" target="_blank">
<span class="footer-text float-left"
>Love inspiring others? Contribute!</span
></a
>
<span class="footer-text float-right">
last update: {{ site.time | date: '%Y-%m-%d' }}
</span>
Expand Down
6 changes: 0 additions & 6 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
type="text/css"
href="{{ site.baseurl }}/assets/css/styles.css"
/>
<link
rel="stylesheet"
type="text/css"
href="{{ site.baseurl }}/assets/css/prism.css"
/>
<script src="{{ site.baseurl }}/assets/js/prism.js"></script>
{% if site.analytics.plausible.enabled %}
<script
defer
Expand Down
8 changes: 7 additions & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="welcome">
<p>Welcome to...</p>
</div>
<h1>awesome rovers</h1>
<a href="{{ site.url}}/"><h1>🚀 awesome rovers 🚀</h1></a>
<div class="long">
<p>
The world of rovers is as diverse as it is inspiring. These remarkable
Expand All @@ -18,6 +18,12 @@ <h1>awesome rovers</h1>
rover is achievable for anyone and limited only by your creativity!
</p>
</div>
<div class="long">
Also ❤️ inspiring others?
<a href="https://github.com/dsonyy/awesome-rovers"
>Contribute and add your ideas!</a
>
</div>
{% include nav.html %}
<hr />
</div>
14 changes: 10 additions & 4 deletions _includes/nav.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<nav>
<a href="{{ site.url }}/">Home</a>
<a href="{{ site.url }}/category/earth">Earth</a>
<a href="{{ site.url }}/category/moon">Moon</a>
<a href="{{ site.url }}/category/mars">Mars</a>
<a href="{{ site.url }}">Home</a>
<a href="{{ site.url }}/list">List</a>

<!-- get all rovers categories -->
{% assign all_categories = site.rovers | map: 'categories' | uniq | sort %}

<!-- iterate over categories -->
{% for category in all_categories -%}
<a href="{{ site.url }}?categories={{ category }}">#{{ category }}</a>
{% endfor %}
</nav>
12 changes: 9 additions & 3 deletions _includes/post.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<div class="post">
<div
class="post"
post-title="{{ post.title }}"
post-categories="{{ post.categories | join: ',' }}"
>
<!-- post title -->
<h2>{{ post.title }}</h2>
<a id="{{ post.title }}" href="{{ site.url }}/#{{ post.title }}"
><h2>{{ post.title }}</h2></a
>

<!-- categories -->
<div class="tags">
{% for cat in post.categories %}
<a><span>#{{ cat }}</span></a>
<a href="{{ site.url }}?categories={{ cat }}"><span>#{{ cat }}</span></a>
{% endfor %}
</div>

Expand Down
7 changes: 1 addition & 6 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@
layout: default
---

<div class="post-info">
<h2>{{ page.title }}</h2>
<p>{{ page.date | date_to_string }} | {{ page.author }}</p>
</div>

<div class="post-content">{{ content }}</div>
{% assign post = page %} {% include post.html %}
34 changes: 0 additions & 34 deletions _posts/2022-04-02-Kalman.md

This file was deleted.

44 changes: 0 additions & 44 deletions _posts/2022-04-02-PrOP-M.md

This file was deleted.

43 changes: 43 additions & 0 deletions _rovers/_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Template
categories: earth students education
read_more: false
rover:
designer:
text: Template
link:
launch:
text: 2018
link:
mission:
text: Rover Challenges
link:
destination:
text: Earth
link:
status:
text: Active
link:
weight:
text: 50 kg
link:
dimensions:
text: 1.2 x 1.2 x 1.2 m
link:
---
<!-- title will be added here -->

<!-- rover details table will be added here -->

<!-- media section -->
<figure>
<img src="{{ site.url }}/assets/img/kalman/1.jpg" />
<img src="{{ site.url }}/assets/img/kalman/2.jpg" />
<figcaption>Photos by <a href="https://example.com/">KSAF AGH</a>.</figcaption>
</figure>

<!-- text section -->
Kalman is one of two planetary rovers built by [AGH Space Systems](https://spacesystems.agh.edu.pl/), following the earlier [Phobos](#phobos) model with advanced new technical solutions.

<!--more-->
<!-- NOTE: set "read_mode" to "true" if you add content below this line -->
44 changes: 44 additions & 0 deletions _rovers/kalman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Kalman
categories: earth students education
read_more: false
rover:
designer:
text: AGH Space Systems
link: https://spacesystems.agh.edu.pl/
launch:
text: 2018
link:
mission:
text: Rover Challenges
link:
destination:
text: Earth
link:
status:
text: Active
link:
weight:
text: 50 kg
link:
dimensions:
text: 1.2 x 1.2 x 1.2 m
link:
---
<!-- title will be added here -->

<!-- rover details table will be added here -->

<!-- media section -->
<figure>
<img src="{{ site.url }}/assets/img/kalman/1.jpg" />
<img src="{{ site.url }}/assets/img/kalman/2.jpg" />
<img src="{{ site.url }}/assets/img/kalman/3.jpg" />
<img src="{{ site.url }}/assets/img/kalman/4.jpg" />
<figcaption>Photos by <a href="https://www.ksaf.pl/">KSAF AGH</a>.</figcaption>
</figure>

Kalman is one of two planetary rovers built by [AGH Space Systems](https://spacesystems.agh.edu.pl/), following the earlier [Phobos](##phobos) model with advanced new technical solutions. This agile, four-wheeled research vehicle features vision systems for remote control and terrain documentation. It’s equipped with a manipulator for handling objects, performing basic repairs, and operating control panels, as well as a mobile lab for soil sample analysis.

<!--more-->
<!-- NOTE: set "read_mode" to "true" if you add content below this line -->
Loading

0 comments on commit ea8b5f8

Please sign in to comment.