From bbd960a37c637adfaf76ae2bb40c3cd1cd942555 Mon Sep 17 00:00:00 2001 From: James Fenn Date: Fri, 11 Dec 2020 21:04:45 -0500 Subject: [PATCH] reorganize stuff --- .eleventy.js | 4 +- Makefile | 5 ++- _includes/head.liquid | 2 +- assets/js/utils.js | 61 ++++++++++++++++++++++++++ meta/CNAME.njk | 5 +++ pages/index.html | 2 +- assets/files/resume.pdf => resume.pdf | Bin 7 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 assets/js/utils.js create mode 100644 meta/CNAME.njk rename assets/files/resume.pdf => resume.pdf (100%) diff --git a/.eleventy.js b/.eleventy.js index 5426c05..9a34216 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -13,9 +13,11 @@ module.exports = function(eleventyConfig) { eleventyConfig.addLayoutAlias("page", "layouts/page.liquid"); eleventyConfig.addPassthroughCopy("favicon.ico"); - eleventyConfig.addPassthroughCopy("assets"); + eleventyConfig.addPassthroughCopy("resume.pdf"); eleventyConfig.addPassthroughCopy({"assets/images": "images"}); eleventyConfig.addPassthroughCopy({"assets/files": "files"}); + eleventyConfig.addPassthroughCopy({"assets/css": "css"}); + eleventyConfig.addPassthroughCopy({"assets/js": "js"}); const markdownItRenderer = new _markdown({ html: true }) .use(require('markdown-it-prism'), { plugins: ["autoloader"] }) diff --git a/Makefile b/Makefile index df5fafc..48f437c 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,9 @@ deploy: prune install assets/css/styles.css ${NPX} @11ty/eleventy git add -f _site/ git commit -m 'deploy' - git subtree split --prefix _site -b main - git push -f deploy main:main + git subtree split --prefix _site -b temp + git push -f deploy temp:main + git branch -D temp git reset HEAD~ prune: diff --git a/_includes/head.liquid b/_includes/head.liquid index 98174dd..5e261a7 100644 --- a/_includes/head.liquid +++ b/_includes/head.liquid @@ -51,7 +51,7 @@ - + diff --git a/assets/js/utils.js b/assets/js/utils.js new file mode 100644 index 0000000..282f8ef --- /dev/null +++ b/assets/js/utils.js @@ -0,0 +1,61 @@ +var ElementUtil = {}; + +ElementUtil.createElement = function(html) { + var fragment = document.createDocumentFragment(); + var temp = document.createElement('div'); + temp.innerHTML = html; + while (temp.firstChild) { + fragment.appendChild(temp.firstChild); + } + + return fragment; +}; + +ElementUtil.clearElement = function(element) { + while (element.firstChild) { + element.removeChild(element.firstChild); + } +}; + +var StringUtil = {}; + +StringUtil.format = function(string, value) { + return string.replace(/\${}/g, value); +}; + +StringUtil.titleize = function(string) { + return string.split("_").join(" ") + .split("-").join(" ") + .replace(/([a-z])([A-Z])/g, "$1 $2") + .replace(/([A-Z])([A-Z][a-z])/g, "$1 $2"); +}; + +var UrlUtil = {}; + +UrlUtil.stringToArguments = function(args) { + var array = args.split("&"); + var args = {}; + for (var i = 0; i < array.length; i++) { + if (array[i].indexOf("=") >= 0) { + var argArray = array[i].split("="); + args[argArray[0]] = argArray[1]; + } else args[array[i]] = true; + } + + return args; +}; + +UrlUtil.argumentsToString = function(args) { + var string = ""; + for (var i in args) { + string += i + "=" + args[i] + "&"; + } + + return string.substring(0, string.length - 1); +}; + +UrlUtil.getCurrentArguments = function() { + if (window.location.search) + return UrlUtil.stringToArguments(window.location.search.replace("?", "")); + else return {}; +}; diff --git a/meta/CNAME.njk b/meta/CNAME.njk new file mode 100644 index 0000000..eeddbd0 --- /dev/null +++ b/meta/CNAME.njk @@ -0,0 +1,5 @@ +--- +permalink: /CNAME +eleventyExcludeFromCollections: true +--- +{{ meta.domainurl.split('/') | last }} \ No newline at end of file diff --git a/pages/index.html b/pages/index.html index b70924b..d18bf17 100644 --- a/pages/index.html +++ b/pages/index.html @@ -17,7 +17,7 @@ permalink: /

The main purpose of this site is to document my work in order to make it more accessible to the public. It also serves as a basic portfolio - if you are interested in hiring me, you can find - my resume here, along with a few ways to contact me. + my resume here, along with a few ways to contact me.

{% assign links = "twitter fediverse github linkedin" | split: " " %} diff --git a/assets/files/resume.pdf b/resume.pdf similarity index 100% rename from assets/files/resume.pdf rename to resume.pdf -- GitLab