blog.trnck.dev
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add support for dynamic "share" links on posts

+32 -3
+13
_includes/social_media_share_url.html
··· 1 + {% if include.service == 'facebook' %} 2 + {% capture share_url %} 3 + https://www.facebook.com/sharer/sharer.php?u={{ include.permalink | prepend: site.url | prepend: site.baseurl | url_encode }} 4 + {% endcapture %} 5 + {% elsif include.service == 'linkedin' %} 6 + {% capture share_url %} 7 + https://www.linkedin.com/shareArticle?mini=true&url={{ include.permalink | prepend: site.url | prepend: site.baseurl | url_encode }}&title={{ include.title | url_encode }}&source=LinkedIn 8 + {% endcapture %} 9 + {% elsif include.service == 'twitter' %} 10 + {% capture share_url %} 11 + https://twitter.com/share?text={{ include.title | url_encode }}&url={{ include.permalink | prepend: site.url | prepend: site.baseurl | url_encode }} 12 + {% endcapture %} 13 + {% endif %}{{ share_url | strip }}
+16
_layouts/post.html
··· 24 24 <p class="f5"><a href="/" class="d-flex flex-items-center {% if site.style == 'dark' %}text-white{% endif %}">{% octicon chevron-left height:16 class:"mr-2 v-align-middle" fill:{{ icon_color }} aria-label:Home %}Home</a></p> 25 25 <h1 class="f00-light lh-condensed">{{ page.title }}</h1> 26 26 <p class="{% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %} mb-5">Published {{ page.date | date: "%b %d, %Y"}}</p> 27 + {% if site.social_media %} 28 + <div class="col-sm-4 col-lg-3 d-flex flex-wrap flex-items-center d-sm-block float-sm-right border rounded-2 bg-white p-3 mb-5 ml-md-5"> 29 + <h3 class="mr-3 mr-sm-0">Share</h3> 30 + <ul class="d-flex d-sm-block list-style-none"> 31 + {% for account in site.social_media %} 32 + <li class="mt-sm-3"> 33 + {% assign service_shortname = account[0] %} 34 + {% assign service = site.data.social_media[service_shortname] %} 35 + <a href="{% include social_media_share_url.html service=service_shortname title=page.title permalink=page.url %}" title="Share on {{ service.name }}" class="d-flex flex-items-center"> 36 + <div style="width:32px">{{ service.icon_svg }}</div><span class="d-none d-sm-inline-block text-gray-light">{{ service.name }}</span> 37 + </a> 38 + </li> 39 + {% endfor %} 40 + </ul> 41 + </div> 42 + {% endif %} 27 43 <div class="article"> 28 44 {{ content }} 29 45 </div>
+3 -3
_sass/_highlight-syntax.scss
··· 1 - .highlight { background: #ffffff; } 1 + .highlight { width: 100%; overflow: auto; background: #ffffff; } 2 2 .highlight .c { color: #999988; font-style: italic } /* Comment */ 3 3 .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 4 4 .highlight .k { font-weight: bold } /* Keyword */ ··· 60 60 .highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ 61 61 62 62 /* Make line numbers unselectable: excludes line numbers from copy-paste user ops */ 63 - .highlight .lineno {-webkit-user-select: none;-moz-user-select: none; -o-user-select: none;} 63 + .highlight .lineno {-webkit-user-select: none;-moz-user-select: none; -o-user-select: none;} 64 64 .lineno::-moz-selection {background-color: transparent;} /* Mozilla specific */ 65 - .lineno::selection {background-color: transparent;} /* Other major browsers */ 65 + .lineno::selection {background-color: transparent;} /* Other major browsers */