Nerd

This page has links, code, and stuff that I refer to often with regards to building and maintaining this site.

Comments for this website.

Post the comment code right after

{% block content %}
    <article class="content">
        {% if post.feature_image %}
            <figure class="post-feature-image">
                <img src="{{ post.feature_image }}" alt="{{ title }}">
            </figure>
        {% endif %}
<div class="comments-block">
    <button id="show-comments" onclick="disqus();return false;">CLICK/TAP HERE TO LOAD COMMENTS</button>
</div>

<div id="disqus_thread"></div>

<script>
var disqus_loaded = false;
var disqus_shortname = 'bershatsky-net'; //Add your shortname here

function disqus() {

    if (!disqus_loaded)  {
        disqus_loaded = true;

        var e = document.createElement("script");
        e.type = "text/javascript";
        e.async = true;
        e.src = "//" + disqus_shortname + ".disqus.com/embed.js";
        (document.getElementsByTagName("head")[0] ||
        document.getElementsByTagName("body")[0])
        .appendChild(e);

        //Hide the button after opening
        document.getElementById("show-comments").style.display = "none";
    }
}

//Opens comments when linked to directly
var hash = window.location.hash.substr(1);
if (hash.length > 8) {
    if (hash.substring(0, 8) == "comment-") {
        disqus();
    }
}

//Remove this if you don't want to load comments for search engines
if(/bot|google|baidu|bing|msn|duckduckgo|slurp|yandex/i.test(navigator.userAgent)) {
   disqus();
}
</script>
Shows Disqus comments when clicked and maintains a Google Page Speed of 100.
This is photo is being posted here for the purpose of saving it to Netlify. Once on Netlify, I copied the URL which is https://bershatsky.net/assets/images/Z1Tn5Ww-FrontPageBackgroundBW.jpg Once that was done, I altered eleventy-starter-ghost/src/_includes/partials/header.njk with the link above instead of the helper handlebards {{ site.cover_image }}.