Browse Source

reorganize stuff

main
James Fenn 9 months ago
parent
commit
bbd960a37c
7 changed files with 74 additions and 5 deletions
  1. +3
    -1
      .eleventy.js
  2. +3
    -2
      Makefile
  3. +1
    -1
      _includes/head.liquid
  4. +61
    -0
      assets/js/utils.js
  5. +5
    -0
      meta/CNAME.njk
  6. +1
    -1
      pages/index.html
  7. +0
    -0
      resume.pdf

+ 3
- 1
.eleventy.js View File

@@ -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"] })


+ 3
- 2
Makefile View File

@@ -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:


+ 1
- 1
_includes/head.liquid View File

@@ -51,7 +51,7 @@

<link href="//fonts.googleapis.com/css?family=Crete+Round|Roboto|Montserrat" rel="stylesheet">
<link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="/assets/css/styles.css" rel="stylesheet">
<link href="/css/styles.css" rel="stylesheet">

<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="{{ head_title }}">


+ 61
- 0
assets/js/utils.js View File

@@ -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 {};
};

+ 5
- 0
meta/CNAME.njk View File

@@ -0,0 +1,5 @@
---
permalink: /CNAME
eleventyExcludeFromCollections: true
---
{{ meta.domainurl.split('/') | last }}

+ 1
- 1
pages/index.html View File

@@ -17,7 +17,7 @@ permalink: /
<p>
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
<a href="/files/resume.pdf">my resume</a> here, along with a few ways to <a href="/contact/">contact me</a>.
<a href="/resume.pdf">my resume</a> here, along with a few ways to <a href="/contact/">contact me</a>.
</p>

{% assign links = "twitter fediverse github linkedin" | split: " " %}


assets/files/resume.pdf → resume.pdf View File


Loading…
Cancel
Save