|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +permalink: /blog/ |
| 4 | +title: blog |
| 5 | +nav: false |
| 6 | +nav_order: 1 |
| 7 | +pagination: |
| 8 | + enabled: true |
| 9 | + collection: posts |
| 10 | + permalink: /page/:num/ |
| 11 | + per_page: 5 |
| 12 | + sort_field: date |
| 13 | + sort_reverse: true |
| 14 | + trail: |
| 15 | + before: 1 # The number of links before the current page |
| 16 | + after: 3 # The number of links after the current page |
| 17 | +--- |
| 18 | + |
| 19 | +<div class="post"> |
| 20 | + |
| 21 | +{% assign blog_name_size = site.blog_name | size %} |
| 22 | +{% assign blog_description_size = site.blog_description | size %} |
| 23 | + |
| 24 | +{% if blog_name_size > 0 or blog_description_size > 0 %} |
| 25 | + |
| 26 | + <div class="header-bar"> |
| 27 | + <h1>{{ site.blog_name }}</h1> |
| 28 | + <h2>{{ site.blog_description }}</h2> |
| 29 | + </div> |
| 30 | + {% endif %} |
| 31 | + |
| 32 | +{% if site.display_tags and site.display_tags.size > 0 or site.display_categories and site.display_categories.size > 0 %} |
| 33 | + |
| 34 | + <div class="tag-category-list"> |
| 35 | + <ul class="p-0 m-0"> |
| 36 | + {% for tag in site.display_tags %} |
| 37 | + <li> |
| 38 | + <i class="fa-solid fa-hashtag fa-sm"></i> <a href="{{ tag | slugify | prepend: '/blog/tag/' | relative_url }}">{{ tag }}</a> |
| 39 | + </li> |
| 40 | + {% unless forloop.last %} |
| 41 | + <p>•</p> |
| 42 | + {% endunless %} |
| 43 | + {% endfor %} |
| 44 | + {% if site.display_categories.size > 0 and site.display_tags.size > 0 %} |
| 45 | + <p>•</p> |
| 46 | + {% endif %} |
| 47 | + {% for category in site.display_categories %} |
| 48 | + <li> |
| 49 | + <i class="fa-solid fa-tag fa-sm"></i> <a href="{{ category | slugify | prepend: '/blog/category/' | relative_url }}">{{ category }}</a> |
| 50 | + </li> |
| 51 | + {% unless forloop.last %} |
| 52 | + <p>•</p> |
| 53 | + {% endunless %} |
| 54 | + {% endfor %} |
| 55 | + </ul> |
| 56 | + </div> |
| 57 | + {% endif %} |
| 58 | + |
| 59 | +{% assign featured_posts = site.posts | where: "featured", "true" %} |
| 60 | +{% if featured_posts.size > 0 %} |
| 61 | +<br> |
| 62 | + |
| 63 | +<div class="container featured-posts"> |
| 64 | +{% assign is_even = featured_posts.size | modulo: 2 %} |
| 65 | +<div class="row row-cols-{% if featured_posts.size <= 2 or is_even == 0 %}2{% else %}3{% endif %}"> |
| 66 | +{% for post in featured_posts %} |
| 67 | +<div class="col mb-4"> |
| 68 | +<a href="{{ post.url | relative_url }}"> |
| 69 | +<div class="card hoverable"> |
| 70 | +<div class="row g-0"> |
| 71 | +<div class="col-md-12"> |
| 72 | +<div class="card-body"> |
| 73 | +<div class="float-right"> |
| 74 | +<i class="fa-solid fa-thumbtack fa-xs"></i> |
| 75 | +</div> |
| 76 | +<h3 class="card-title text-lowercase">{{ post.title }}</h3> |
| 77 | +<p class="card-text">{{ post.description }}</p> |
| 78 | + |
| 79 | + {% if post.external_source == blank %} |
| 80 | + {% assign read_time = post.content | number_of_words | divided_by: 180 | plus: 1 %} |
| 81 | + {% else %} |
| 82 | + {% assign read_time = post.feed_content | strip_html | number_of_words | divided_by: 180 | plus: 1 %} |
| 83 | + {% endif %} |
| 84 | + {% assign year = post.date | date: "%Y" %} |
| 85 | + |
| 86 | + <p class="post-meta"> |
| 87 | + {{ read_time }} min read · |
| 88 | + <a href="{{ year | prepend: '/blog/' | relative_url }}"> |
| 89 | + <i class="fa-solid fa-calendar fa-sm"></i> {{ year }} </a> |
| 90 | + </p> |
| 91 | + </div> |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + </a> |
| 96 | + </div> |
| 97 | + {% endfor %} |
| 98 | + </div> |
| 99 | + </div> |
| 100 | + <hr> |
| 101 | + |
| 102 | +{% endif %} |
| 103 | + |
| 104 | + <ul class="post-list"> |
| 105 | + |
| 106 | + {% if page.pagination.enabled %} |
| 107 | + {% assign postlist = paginator.posts %} |
| 108 | + {% else %} |
| 109 | + {% assign postlist = site.posts %} |
| 110 | + {% endif %} |
| 111 | + |
| 112 | + {% for post in postlist %} |
| 113 | + |
| 114 | + {% if post.external_source == blank %} |
| 115 | + {% assign read_time = post.content | number_of_words | divided_by: 180 | plus: 1 %} |
| 116 | + {% else %} |
| 117 | + {% assign read_time = post.feed_content | strip_html | number_of_words | divided_by: 180 | plus: 1 %} |
| 118 | + {% endif %} |
| 119 | + {% assign year = post.date | date: "%Y" %} |
| 120 | + {% assign tags = post.tags | join: "" %} |
| 121 | + {% assign categories = post.categories | join: "" %} |
| 122 | + |
| 123 | + <li> |
| 124 | + |
| 125 | +{% if post.thumbnail %} |
| 126 | + |
| 127 | +<div class="row"> |
| 128 | + <div class="col-sm-9"> |
| 129 | +{% endif %} |
| 130 | + <h3> |
| 131 | + {% if post.redirect == blank %} |
| 132 | + <a class="post-title" href="{{ post.url | relative_url }}">{{ post.title }}</a> |
| 133 | + {% elsif post.redirect contains '://' %} |
| 134 | + <a class="post-title" href="{{ post.redirect }}" target="_blank">{{ post.title }}</a> |
| 135 | + <svg width="2rem" height="2rem" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"> |
| 136 | + <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> |
| 137 | + </svg> |
| 138 | + {% else %} |
| 139 | + <a class="post-title" href="{{ post.redirect | relative_url }}">{{ post.title }}</a> |
| 140 | + {% endif %} |
| 141 | + </h3> |
| 142 | + <p>{{ post.description }}</p> |
| 143 | + <p class="post-meta"> |
| 144 | + {{ read_time }} min read · |
| 145 | + {{ post.date | date: '%B %d, %Y' }} |
| 146 | + {% if post.external_source %} |
| 147 | + · {{ post.external_source }} |
| 148 | + {% endif %} |
| 149 | + </p> |
| 150 | + <p class="post-tags"> |
| 151 | + <a href="{{ year | prepend: '/blog/' | relative_url }}"> |
| 152 | + <i class="fa-solid fa-calendar fa-sm"></i> {{ year }} </a> |
| 153 | + |
| 154 | + {% if tags != "" %} |
| 155 | + · |
| 156 | + {% for tag in post.tags %} |
| 157 | + <a href="{{ tag | slugify | prepend: '/blog/tag/' | relative_url }}"> |
| 158 | + <i class="fa-solid fa-hashtag fa-sm"></i> {{ tag }}</a> |
| 159 | + {% unless forloop.last %} |
| 160 | + |
| 161 | + {% endunless %} |
| 162 | + {% endfor %} |
| 163 | + {% endif %} |
| 164 | + |
| 165 | + {% if categories != "" %} |
| 166 | + · |
| 167 | + {% for category in post.categories %} |
| 168 | + <a href="{{ category | slugify | prepend: '/blog/category/' | relative_url }}"> |
| 169 | + <i class="fa-solid fa-tag fa-sm"></i> {{ category }}</a> |
| 170 | + {% unless forloop.last %} |
| 171 | + |
| 172 | + {% endunless %} |
| 173 | + {% endfor %} |
| 174 | + {% endif %} |
| 175 | + </p> |
| 176 | + |
| 177 | +{% if post.thumbnail %} |
| 178 | + |
| 179 | +</div> |
| 180 | + |
| 181 | + <div class="col-sm-3"> |
| 182 | + <img class="card-img" src="{{ post.thumbnail | relative_url }}" style="object-fit: cover; height: 90%" alt="image"> |
| 183 | + </div> |
| 184 | +</div> |
| 185 | +{% endif %} |
| 186 | + </li> |
| 187 | + |
| 188 | + {% endfor %} |
| 189 | + |
| 190 | + </ul> |
| 191 | + |
| 192 | +{% if page.pagination.enabled %} |
| 193 | +{% include pagination.liquid %} |
| 194 | +{% endif %} |
| 195 | + |
| 196 | +</div> |
0 commit comments