diff --git a/_config.yml b/_config.yml index 30fff85..38ab13f 100644 --- a/_config.yml +++ b/_config.yml @@ -19,7 +19,7 @@ description: >- # this means to ignore newlines until "baseurl:" Blog and portfolio for Em (Ethan) Ruszanowski. github_username: emrusz minimal_mistakes_skin: dark -search: false +search: true # Build settings markdown: kramdown @@ -59,6 +59,7 @@ author: name: "Em (Ethan) Ruszanowski" avatar: "/assets/images/avatar.jpg" bio: "Data engineer, polyglot developer, and RIT Computing and Information Technologies alum." + location: "Rochester, NY" links: - label: "Email" icon: "fas fa-fw fa-envelope" @@ -91,9 +92,6 @@ footer: icon: "fas fa-fw fa-heartbeat" url: "https://status.rusz.dev" -after_footer_scripts: - - assets/js/clipboard.js - social: type: names: @@ -121,6 +119,8 @@ defaults: layout: single author_profile: true +enable_copy_code_button: true + category_archive: type: liquid path: /categories/ diff --git a/_drafts/placeholder.md b/_drafts/placeholder.md new file mode 100644 index 0000000..e69de29 diff --git a/assets/js/clipboard.js b/assets/js/clipboard.js deleted file mode 100644 index 7febb0f..0000000 --- a/assets/js/clipboard.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * A nice little clipboard script provided by crykn. Thanks! - */ - -function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} - -async function onClickEffect(btn, style) { - btn.removeClass("btn-light"); - btn.addClass(style); - await sleep(250); - btn.removeClass(style); - btn.addClass("btn-light"); -} - -$(document).ready(function() { - // Create butons - $(".page__content pre > code").each(function() { - $(this).parent().prepend( - $(document.createElement('button')).prop({ - type: 'button', - innerHTML: '', - }) - .attr('title', 'Copy to clipboard') - .addClass('btn') - .addClass('btn--primary') - .css('position', 'absolute') - .css('right', '1em') - // Click listener - .on('click', function() { - let codeElement = $(this).parent().children('code').first(); - - if (!codeElement) { - throw new Error("Unexpected error! No corresponding code block was found for this button."); - } - - // Blink effect - onClickEffect($(this), "btn--success") - - // Copy to clipoard function - navigator.clipboard.writeText($(codeElement).text()).then(() => true, () => true); - return true; - }) - ); - }); -});