diff --git a/_config.yml b/_config.yml index f145151..7bb7837 100644 --- a/_config.yml +++ b/_config.yml @@ -19,7 +19,7 @@ description: >- # this means to ignore newlines until "baseurl:" A blog that serves as a documentation of my progress learning anything tech-related, mostly programming and engineering. Yes, one of those blogs... -baseurl: "/blog/" # the subpath of your site, e.g. /blog +baseurl: "/blog" # the subpath of your site, e.g. /blog url: "https://foo-dogsquared.github.io" # the base hostname & protocol for your site, e.g. http://example.com codepen_username: foo-dogsquared @@ -29,7 +29,7 @@ gitlab_username: foo-dogsquared linkedin_username: gabriel-arazas twitter_username: foo_dogsquared paginate: 10 -paginate_path: '/blog/page:num/' +paginate_path: '/page:num/' # Enabling Disqus disqus: diff --git a/_includes/addl-post-fns.html b/_includes/addl-post-fns.html index 8034657..722382b 100644 --- a/_includes/addl-post-fns.html +++ b/_includes/addl-post-fns.html @@ -3,7 +3,6 @@ function insertHeaderLink() { const HEADINGS = document.querySelectorAll(`article.post div[itemprop="articleBody"] h1[id], h2[id]`); const MAIN_NODE_LIST = document.querySelector('div.post-content[itemprop="articleBody"]'); - console.log(HEADINGS); if (HEADINGS.length === 0) return null; // creating an element containing the links to the selected headers @@ -36,14 +35,37 @@ function resourcesLink() { const RESOURCES = document.querySelector("article.post .post-content h2#resources"); - if (RESOURCES === null) return; + if (RESOURCES === null) return null; else if (RESOURCES.nextElementSibling.tagName === 'UL') { - const LIST_OF_LINKS = Array.from(RESOURCES.nextElementSibling.children) - LIST_OF_LINKS.forEach(listedLinks => listedLinks.children[0].setAttribute("target", "_blank")); + const LIST_OF_HEADERS = Array.from(RESOURCES.nextElementSibling.children); + console.log(LIST_OF_HEADERS) + LIST_OF_HEADERS.forEach(source_li => { + const INNER_LIST_OF_LINKS = source_li.children[1]; + if (INNER_LIST_OF_LINKS === undefined) return null; + INNER_LIST_OF_LINKS.setAttribute("class", "resources-link"); + const LIST_OF_LINKS = Array.from(INNER_LIST_OF_LINKS.children); + console.log(LIST_OF_LINKS); + LIST_OF_LINKS.forEach(li => { + li.children[0].innerHTML = `${li.children[0].innerHTML}`; + li.children[0].setAttribute("target", "_blank"); + }) + }); }; } + function convert_to_wpm(number_of_words = document.querySelectorAll(".no-of-mins")) { + // const imgs = document.querySelectorAll("main > .wrapper .post-content[itemprop='articleBody'] center > img"); + number_of_words.forEach((num) => { + const wpm = 225 /* avg wpm for an adult */ + num.textContent = Math.round((Number(num.textContent) / wpm) + 1 /*+ (imgs.length * 0.2) */); + return; + }) + } + insertHeaderLink(); // insertCenterTags(); resourcesLink(); + + convert_to_wpm(); + \ No newline at end of file diff --git a/_includes/footer.html b/_includes/footer.html index f01168b..11945b6 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -33,9 +33,17 @@ +
+Built with Jekyll and hosted by GitHub
+Icons from The Noun Project
+© Gabriel Arazas
Updated: {{ page.updatedOn | escape }}
+ {%- endif -%} + \ No newline at end of file diff --git a/_layouts/home.html b/_layouts/home.html index 15ec0d3..e94ee83 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -18,51 +18,68 @@ layout: default {%- if site.posts.size > 0 -%}subscribe via RSS
{%- endif -%} diff --git a/_layouts/post.html b/_layouts/post.html index 33e9782..720dff5 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -9,19 +9,8 @@ layout: default {% if page.alt_title %}