diff --git a/README.md b/README.md index ca89362..d39c855 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ bundle exec jekyll serve ## Enhancements -Adding `?linktarget=top` to the URL for a page on this site will add `target="_top"` to each link on said page, allowing it to be used in a iframe with less wonkiness. This should allow smoother integration with Canvas once I get around to it. +Adding `?for_iframe=true` to the URL for a page on this site will add `target="_top"` to each link on said page and hide the header and footer, allowing it to be used in a iframe with less wonkiness. This should allow smoother integration with Canvas once I get around to it. "Shell and Slurm Practice" is meh; it'd be nice to have a `find` thrown in there (plus material on `find`), and make it more open-ended and amenable to combining sed/grep/awk. diff --git a/_includes/head.html b/_includes/head.html index 0cd6bea..af75557 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -8,6 +8,14 @@ {%- if jekyll.environment == 'production' and site.google_analytics -%} {%- include google-analytics.html -%} {%- endif -%} + + + + + - + \ No newline at end of file diff --git a/assets/make-iframes-work.js b/assets/make-iframes-work.js index 7a17a99..4424f87 100644 --- a/assets/make-iframes-work.js +++ b/assets/make-iframes-work.js @@ -1,13 +1,16 @@ // Adds `target="_top" to every link on the page so that the page can be used by iframes if 'linktarget=top' is in the link parameters; for use with Canvas document.addEventListener('DOMContentLoaded', function () { - var UrlParams = new URLSearchParams(window.location.search); - if (UrlParams.get('linktarget') === 'top') { + const UrlParams = new URLSearchParams(window.location.search); + if (UrlParams.get('for_iframe') === 'true') { + // Add target="_top" to links var links = document.getElementsByTagName('a'); for(var i=0; i