Skip to content

Latest commit

 

History

History
85 lines (78 loc) · 3.47 KB

thoughts.md

File metadata and controls

85 lines (78 loc) · 3.47 KB
layout title permalink
default
Thoughts
/thoughts/

Thoughts

Here's where I share my random thoughts, beliefs, philosophy etc.

{% assign sorted_thoughts = site.thoughts | sort: 'last_modified_at' | reverse %} {% for thought in sorted_thoughts %}
{% if thought.image %}
{{ thought.title }}
{% endif %}
    <div class="thought-content">
      <div class="thought-meta">
        <div class="meta-left">
          <span class="update-date">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="meta-icon">
              <circle cx="12" cy="12" r="10"></circle>
              <polyline points="12 6 12 12 16 14"></polyline>
            </svg>
            Last updated: {{ thought.last_modified_at | date: "%B %-d, %Y" }}
          </span>
        </div>
        <div class="meta-right">
          <span class="reading-time">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="meta-icon">
              <path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path>
              <path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path>
            </svg>
            {% capture words %}{{ thought.content | number_of_words }}{% endcapture %}
            {% unless words contains "-" %}
              {{ words | plus: 250 | divided_by: 250 | append: " minute read" }}
            {% endunless %}
          </span>
        </div>
      </div>
      
      <h2 class="thought-title">
        <a href="{{ thought.url | relative_url }}">{{ thought.title }}</a>
      </h2>
      
      <div class="thought-excerpt">
        {% if thought.excerpt %}
          {{ thought.excerpt | strip_html | truncate: 160 }}
        {% endif %}
      </div>
      
      <div class="thought-footer">
        <div class="categories">
          {% if thought.categories.size > 0 %}
            {% for category in thought.categories %}
              <span class="category">{{ category }}</span>
            {% endfor %}
          {% endif %}
        </div>
        
        <a href="{{ thought.url | relative_url }}" class="read-more">
          Read more
          <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="arrow-icon">
            <line x1="5" y1="12" x2="19" y2="12"></line>
            <polyline points="12 5 19 12 12 19"></polyline>
          </svg>
        </a>
      </div>
    </div>
  </div>
{% else %}
  <div class="no-thoughts">
    <p>No thoughts found</p>
  </div>
{% endfor %}