Skip to content

Instantly share code, notes, and snippets.

Avatar

Ahmad Ajmi ahmadajmi

View GitHub Profile
View prism
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/plugins/autoloader/prism-autoloader.min.js" integrity="sha512-fTl/qcO1VgvKtOMApX2PdZzkziyr2stM65GYPLGuYMnuMm1z2JLJG6XVU7C/mR+E7xBUqCivykuhlzfqxXBXbg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
View subscribe-list.hbs
<ul class='c-subscribe-list'>
{{#if @custom.apple_podcasts}}
<li class='c-subscribe-list__item'>
<a href='{{ @custom.apple_podcasts }}' class='c-subscribe-list__link' target='_blank' rel='noopener noreferrer'>
<div class='c-subscribe-list__media'>
<img class='c-subscribe-list__icon lazyload' data-src='{{ asset 'icons/apple.svg' }}' alt='Apple Podcasts icon' width='20' height='20'>
</div>
<span class='c-subscribe-list__name'>Apple Podcasts</span>
</a>
</li>
View social-icons.hbs
{{#if @site.twitter}}
<li class='c-nav__item c-nav__item--hasIcon'>
<a href='{{ twitter_url }}'>
<span class='c-nav__item__icon' data-icon='ei-sc-twitter' data-size='s'></span>
<span class='u-hidden-visually'>Twitter</span>
</a>
</li>
{{/if}}
{{#if @site.facebook}}
View sidebar-social-icons.hbs
<div class='c-widget'>
<ul class='c-social-icons o-plain-list'>
{{#if @site.twitter}}
<li class='c-social-icons__item'>
<a href='{{ twitter_url }}'>
<span class='c-social-icons__icon' data-icon='ei-sc-twitter' data-size='s'></span>
<span class='u-screenreader-only'>Twitter</span>
</a>
</li>
{{/if}}
View dark.html
// Copy the follwing to Code Injection.
<style>
:root {
--color-mode: 'dark';
--color-brand: var(--ghost-accent-color);
--color-white: #FFFFFF;
--color-dark: #010101;
--color-text: #FFFFFF;
--color-gray: #E5EFF5;
View gist:fa6e5979484fbf404c20a4d15d755ea3
// Replace YOUR_LIGHT_COLOR_HERE with your light background.
// Replace YOUR_DARK_COLOR_HERE in two lines with your dark background.
<style>
:root {
--nav-background: YOUR_LIGHT_COLOR_HERE;
}
@media (prefers-color-scheme: dark) {
:root:not([data-user-color-scheme]) {
View gist:78b456b3e81af58c6f71ae2db3c556ed
<style>
.c-content .kg-callout-card.kg-callout-card-grey { background: rgba(124,139,154,.13); }
.c-content .kg-callout-card.kg-callout-card-blue { background: rgba(33,172,232,.12); }
.c-content .kg-callout-card.kg-callout-card-green { background: rgba(52,183,67,.12); }
.c-content .kg-callout-card.kg-callout-card-yellow { background: rgba(240,165,15,.13); }
.c-content .kg-callout-card.kg-callout-card-red { background: rgba(209,46,46,.11); }
.c-content .kg-callout-card.kg-callout-card-pink { background: rgba(225,71,174,.11); }
.c-content .kg-callout-card.kg-callout-card-purple { background: rgba(135,85,236,.12); }
.c-content .kg-callout-card.kg-callout-card-accent { background: var(--ghost-accent-color); }
</style>
View gist:8e14ff3d62287abb358492d685c41d0f
{{#unless access}}
<aside class='c-post-upgrade-cta'>
{{#has visibility='members'}}
<h4 class='c-post-upgrade-cta__title'>{{t 'This page is for subscribers only'}}</h4>
{{/has}}
{{#has visibility='paid'}}
<h4 class='c-post-upgrade-cta__title'>{{t 'This page is for paying subscribers only'}}</h4>
{{/has}}
View home.hbs
<div class='c-section'>
{{#get 'pages' slug='PAGE_SLUG' as |page| }}
{{#page}}
<div class='c-content'>
{{ content }}
</div>
{{/page}}
{{/get}}
</div>
View page-header.hbs
{{!--
Used in the post.hbs & page.hbs file
--}}
<header class='c-page-header'>
<div class='{{#if custom_excerpt}}o-grid o-grid--2-columns{{/if}} {{#unless custom_excerpt}}no-custom_excerpt{{/unless}}'>
<div>
<h1 class='c-page-header__heading u-font-heading'>{{ title }}</h1>
{{#match primary_tag.slug 'writing'}}
<time class='u-color-text-secondary u-font-size-small u-mt-8' datetime='{{ date format='YYYY-MM-DD' }}'>{{ date format='MMM D, YYYY' }}</time>