Created
November 22, 2017 02:33
-
-
Save jovianlin/57ead07b79eb8e3458867612cc87cdaf to your computer and use it in GitHub Desktop.
Ghost Injection for Header & Footer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
===== BLOG HEADER ===== | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/agate.min.css"> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script> | |
<style> | |
.inner { max-width:50em; } | |
pre .lines { margin-top:-12px; } | |
</style> | |
===== BLOG FOOTER ===== | |
<script> | |
activateHighlight = function() { | |
document.querySelectorAll("pre code").forEach( | |
function(currentValue, currentIndex, listObj) { | |
hljs.highlightBlock(currentValue); | |
} | |
); | |
} | |
if (window.attachEvent) { | |
window.attachEvent('onload', loadHighlight); | |
} else { | |
if (window.onload) { | |
var originalOnload = window.onload; | |
var newOnload = function(evt) { | |
originalOnload(evt); | |
activateHighlight(evt); | |
}; | |
window.onload = newOnload; | |
} else { | |
window.onload = activateHighlight; | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment