blog.trnck.dev

Add image customization

+6 -1
+5 -1
_includes/header.html
··· 13 13 {% if page.path contains '_posts' %} 14 14 {% assign page_title = page.title %} 15 15 {% assign meta_description = page.content | strip_html | strip_newlines | xml_escape | truncate: 300 %} 16 + {% if page.image %} 17 + {% assign meta_image = page.image | prepend: "/img/thumbnail/" | absolute_url %} 18 + {% endif %} 16 19 {% else %} 17 20 {% assign page_title = user.name %} 18 21 {% assign meta_description = user.bio | strip_html | strip_newlines | xml_escape | truncate: 300 %} 22 + {% assign meta_image = user.avatar_url %} 19 23 {% endif %} 20 24 21 25 <!doctype html> ··· 25 29 <title>{{ page_title }}</title> 26 30 <meta name="description" content="{{ meta_description }}" /> 27 31 <meta property="og:title" content="{{ page_title }}" /> 28 - <meta property="og:image" content="{{ user.avatar_url }}" /> 32 + {% if meta_image %}<meta property="og:image" content="{{ meta_image }}" />{% endif %} 29 33 <meta property="og:description" content="{{ meta_description }}" /> 30 34 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 31 35 <link href="{{ "/assets/styles.css" | relative_url }}" rel="stylesheet" type="text/css">
+1
_posts/2022-08-12-open-source-thesis.md
··· 1 1 --- 2 2 title: "Year-end work: Open Source" 3 + image: "books-408220.jpg" 3 4 --- 4 5 5 6 Originally submitted on the 19th of April, 2021, today I'm releasing my year-end work describing open-source from a beginner standpoint. It is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a> and can be downloaded [as PDF](/static/Open%20Source.pdf).
img/thumbnail/books-408220.jpg

This is a binary file and will not be displayed.