Skip to content

Commit

Permalink
Undo
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverkinch committed Jul 18, 2024
1 parent 1eae900 commit 5956a60
Show file tree
Hide file tree
Showing 6 changed files with 328 additions and 1 deletion.
196 changes: 196 additions & 0 deletions _pages/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
---
layout: default
permalink: /blog/
title: blog
nav: true
nav_order: 1
pagination:
enabled: true
collection: posts
permalink: /page/:num/
per_page: 5
sort_field: date
sort_reverse: true
trail:
before: 1 # The number of links before the current page
after: 3 # The number of links after the current page
---

<div class="post">

{% assign blog_name_size = site.blog_name | size %}
{% assign blog_description_size = site.blog_description | size %}

{% if blog_name_size > 0 or blog_description_size > 0 %}

<div class="header-bar">
<h1>{{ site.blog_name }}</h1>
<h2>{{ site.blog_description }}</h2>
</div>
{% endif %}

{% if site.display_tags or site.display_categories %}

<div class="tag-category-list">
<ul class="p-0 m-0">
{% for tag in site.display_tags %}
<li>
<i class="fa-solid fa-hashtag fa-sm"></i> <a href="{{ tag | slugify | prepend: '/blog/tag/' | relative_url }}">{{ tag }}</a>
</li>
{% unless forloop.last %}
<p>&bull;</p>
{% endunless %}
{% endfor %}
{% if site.display_categories.size > 0 and site.display_tags.size > 0 %}
<p>&bull;</p>
{% endif %}
{% for category in site.display_categories %}
<li>
<i class="fa-solid fa-tag fa-sm"></i> <a href="{{ category | slugify | prepend: '/blog/category/' | relative_url }}">{{ category }}</a>
</li>
{% unless forloop.last %}
<p>&bull;</p>
{% endunless %}
{% endfor %}
</ul>
</div>
{% endif %}

{% assign featured_posts = site.posts | where: "featured", "true" %}
{% if featured_posts.size > 0 %}
<br>

<div class="container featured-posts">
{% assign is_even = featured_posts.size | modulo: 2 %}
<div class="row row-cols-{% if featured_posts.size <= 2 or is_even == 0 %}2{% else %}3{% endif %}">
{% for post in featured_posts %}
<div class="col mb-4">
<a href="{{ post.url | relative_url }}">
<div class="card hoverable">
<div class="row g-0">
<div class="col-md-12">
<div class="card-body">
<div class="float-right">
<i class="fa-solid fa-thumbtack fa-xs"></i>
</div>
<h3 class="card-title text-lowercase">{{ post.title }}</h3>
<p class="card-text">{{ post.description }}</p>

{% if post.external_source == blank %}
{% assign read_time = post.content | number_of_words | divided_by: 180 | plus: 1 %}
{% else %}
{% assign read_time = post.feed_content | strip_html | number_of_words | divided_by: 180 | plus: 1 %}
{% endif %}
{% assign year = post.date | date: "%Y" %}

<p class="post-meta">
{{ read_time }} min read &nbsp; &middot; &nbsp;
<a href="{{ year | prepend: '/blog/' | prepend: site.baseurl}}">
<i class="fa-solid fa-calendar fa-sm"></i> {{ year }} </a>
</p>
</div>
</div>
</div>
</div>
</a>
</div>
{% endfor %}
</div>
</div>
<hr>

{% endif %}

<ul class="post-list">

{% if page.pagination.enabled %}
{% assign postlist = paginator.posts %}
{% else %}
{% assign postlist = site.posts %}
{% endif %}

{% for post in postlist %}

{% if post.external_source == blank %}
{% assign read_time = post.content | number_of_words | divided_by: 180 | plus: 1 %}
{% else %}
{% assign read_time = post.feed_content | strip_html | number_of_words | divided_by: 180 | plus: 1 %}
{% endif %}
{% assign year = post.date | date: "%Y" %}
{% assign tags = post.tags | join: "" %}
{% assign categories = post.categories | join: "" %}

<li>

{% if post.thumbnail %}

<div class="row">
<div class="col-sm-9">
{% endif %}
<h3>
{% if post.redirect == blank %}
<a class="post-title" href="{{ post.url | relative_url }}">{{ post.title }}</a>
{% elsif post.redirect contains '://' %}
<a class="post-title" href="{{ post.redirect }}" target="_blank">{{ post.title }}</a>
<svg width="2rem" height="2rem" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
<path d="M17 13.5v6H5v-12h6m3-3h6v6m0-6-9 9" class="icon_svg-stroke" stroke="#999" stroke-width="1.5" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
{% else %}
<a class="post-title" href="{{ post.redirect | relative_url }}">{{ post.title }}</a>
{% endif %}
</h3>
<p>{{ post.description }}</p>
<p class="post-meta">
{{ read_time }} min read &nbsp; &middot; &nbsp;
{{ post.date | date: '%B %d, %Y' }}
{% if post.external_source %}
&nbsp; &middot; &nbsp; {{ post.external_source }}
{% endif %}
</p>
<p class="post-tags">
<a href="{{ year | prepend: '/blog/' | prepend: site.baseurl}}">
<i class="fa-solid fa-calendar fa-sm"></i> {{ year }} </a>

{% if tags != "" %}
&nbsp; &middot; &nbsp;
{% for tag in post.tags %}
<a href="{{ tag | slugify | prepend: '/blog/tag/' | prepend: site.baseurl}}">
<i class="fa-solid fa-hashtag fa-sm"></i> {{ tag }}</a>
{% unless forloop.last %}
&nbsp;
{% endunless %}
{% endfor %}
{% endif %}

{% if categories != "" %}
&nbsp; &middot; &nbsp;
{% for category in post.categories %}
<a href="{{ category | slugify | prepend: '/blog/category/' | prepend: site.baseurl}}">
<i class="fa-solid fa-tag fa-sm"></i> {{ category }}</a>
{% unless forloop.last %}
&nbsp;
{% endunless %}
{% endfor %}
{% endif %}
</p>

{% if post.thumbnail %}

</div>

<div class="col-sm-3">
<img class="card-img" src="{{post.thumbnail | relative_url}}" style="object-fit: cover; height: 90%" alt="image">
</div>
</div>
{% endif %}
</li>

{% endfor %}

</ul>

{% if page.pagination.enabled %}
{% include pagination.liquid %}
{% endif %}

</div>
2 changes: 1 addition & 1 deletion _pages/cv.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: cv
nav: true
nav_order: 5
cv_pdf: example_pdf.pdf
description: ""
description:
toc:
sidebar: left
---
7 changes: 7 additions & 0 deletions _pages/news.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: page
title: news
permalink: /news/
---

{% include news.liquid %}
65 changes: 65 additions & 0 deletions _pages/projects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
layout: page
title: projects
permalink: /projects/
description: A growing collection of your cool projects.
nav: true
nav_order: 3
display_categories: [work, fun]
horizontal: false
---

<!-- pages/projects.md -->
<div class="projects">
{% if site.enable_project_categories and page.display_categories %}
<!-- Display categorized projects -->
{% for category in page.display_categories %}
<a id="{{ category }}" href=".#{{ category }}">
<h2 class="category">{{ category }}</h2>
</a>
{% assign categorized_projects = site.projects | where: "category", category %}
{% assign sorted_projects = categorized_projects | sort: "importance" %}
<!-- Generate cards for each project -->
{% if page.horizontal %}
<div class="container">
<div class="row row-cols-1 row-cols-md-2">
{% for project in sorted_projects %}
{% include projects_horizontal.liquid %}
{% endfor %}
</div>
</div>
{% else %}
<div class="row row-cols-1 row-cols-md-3">
{% for project in sorted_projects %}
{% include projects.liquid %}
{% endfor %}
</div>
{% endif %}
{% endfor %}

{% else %}

<!-- Display projects without categories -->

{% assign sorted_projects = site.projects | sort: "importance" %}

<!-- Generate cards for each project -->

{% if page.horizontal %}

<div class="container">
<div class="row row-cols-1 row-cols-md-2">
{% for project in sorted_projects %}
{% include projects_horizontal.liquid %}
{% endfor %}
</div>
</div>
{% else %}
<div class="row row-cols-1 row-cols-md-3">
{% for project in sorted_projects %}
{% include projects.liquid %}
{% endfor %}
</div>
{% endif %}
{% endif %}
</div>
47 changes: 47 additions & 0 deletions _pages/repositories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: page
permalink: /repositories/
title: repositories
description: Edit the `_data/repositories.yml` and change the `github_users` and `github_repos` lists to include your own GitHub profile and repositories.
nav: true
nav_order: 4
---

## GitHub users

{% if site.data.repositories.github_users %}

<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
{% for user in site.data.repositories.github_users %}
{% include repository/repo_user.liquid username=user %}
{% endfor %}
</div>

---

{% if site.repo_trophies.enabled %}
{% for user in site.data.repositories.github_users %}
{% if site.data.repositories.github_users.size > 1 %}

<h4>{{ user }}</h4>
{% endif %}
<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
{% include repository/repo_trophies.liquid username=user %}
</div>

---

{% endfor %}
{% endif %}
{% endif %}

## GitHub Repositories

{% if site.data.repositories.github_repos %}

<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
{% for repo in site.data.repositories.github_repos %}
{% include repository/repo.liquid repository=repo %}
{% endfor %}
</div>
{% endif %}
12 changes: 12 additions & 0 deletions _pages/teaching.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: page
permalink: /teaching/
title: teaching
description: Materials for courses you taught. Replace this text with your description.
nav: true
nav_order: 6
---

For now, this page is assumed to be a static description of your courses. You can convert it to a collection similar to `_projects/` so that you can have a dedicated page for each course.

Organize your courses by years, topics, or universities, however you like!

0 comments on commit 5956a60

Please sign in to comment.