diff --git a/blog/index.html b/blog/index.html index df37c52..8133b7b 100644 --- a/blog/index.html +++ b/blog/index.html @@ -8,7 +8,7 @@ body {font-family: "Open Sans", sans-serif} .h0 {font-size: 30pt;} nav a[target="_blank"]:after {content: url("/static/icons8-external-link-50.png"); - filter: invert(100%);} + filter: invert(100%);} .current-page {opacity: .3;} @@ -43,10 +43,16 @@
+ +
Blog Posts
+ +
\ No newline at end of file diff --git a/index.html b/index.html index 4287b5d..20dba0a 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ body {font-family: "Open Sans", sans-serif} .h0 {font-size: 30pt;} nav a[target="_blank"]:after {content: url("/static/icons8-external-link-50.png"); - filter: invert(100%);} + filter: invert(100%);} .current-page {opacity: .3;} diff --git a/projects.html b/projects.html index dfdeb76..33820fe 100644 --- a/projects.html +++ b/projects.html @@ -8,7 +8,7 @@ body {font-family: "Open Sans", sans-serif} .h0 {font-size: 30pt;} nav a[target="_blank"]:after {content: url("/static/icons8-external-link-50.png"); - filter: invert(100%);} + filter: invert(100%);} .current-page {opacity: .3;} diff --git a/static/_external_link.png b/static/_external_link.png new file mode 100644 index 0000000..9616096 Binary files /dev/null and b/static/_external_link.png differ diff --git a/static/_nav.js b/static/_nav.js new file mode 100644 index 0000000..767ab67 --- /dev/null +++ b/static/_nav.js @@ -0,0 +1,47 @@ + +var splitPath = function(path) { + var result = path.replace(/\\/g, "/").match(/(.*\/)?(\..*?|.*?)(\.[^.]*?)?(#.*$|\?.*$|$)/); + return { + dirname: result[1] || "", + filename: result[2] || "", + extension: result[3] || "", + params: result[4] || "" + }; +}; + + +d = window.document + + +var getCurrentPageName = function() { + + if (location.pathname == '/') return 'about' + + page_name = splitPath(d.URL).filename + + if (page_name == 'index') return 'about' + + if (!['projects', 'index'].includes(page_name)) return 'blog' + + return page_name + +} + + +window.onload = function() { + current_page_name = getCurrentPageName() + nav = d.getElementById('nav') + Array.prototype.forEach.call(nav.children, function(child, index){ + if (current_page_name == child.text.toLowerCase()) { + child.className = child.className.concat(' current-page') + } + }) + title_element = d.getElementById('title') + if (current_page_name == 'blog') { + d.title = d.title.concat(' | Blog') + title_element.text = title_element.text.concat("\'s Blog") + } else if (current_page_name == 'projects') { + d.title = d.title.concat(' | Projects') + title_element.text = title_element.text.concat("\'s Projects") + } +}