diff --git a/config.toml b/config.toml index 7740352f..4c7ca208 100644 --- a/config.toml +++ b/config.toml @@ -2,7 +2,8 @@ baseURL = "https://www.donaldharper.com/" languageCode = "en-us" title = "Donald Harper Photographs" paginate = 5 -Copyright = "All Rights Reserved - 2006 -" +#Copyright = "All Rights Reserved - 2006 -" +Copyright = "2006-2019" canonifyurls = true theme = "Bleach" @@ -14,16 +15,32 @@ theme = "Bleach" tag = "tags" series = "series" +[privacy] + # Google Analytics privacy settings - https://gohugo.io/about/hugo-and-gdpr/index.html#googleanalytics + [privacy.googleAnalytics] + # set to true to disable service + disable = false + # set to true to meet General Data Protection Regulation (GDPR) + anonymizeIP = false + respectDoNotTrack = false + useSessionStorage = false + [params] - paginate = 5 - copyright = "All Rights Reserved - 2006 -" - email = "don@donaldharper.com" - description = "Donald Harper Photographs" - cover = "/images/user.jpg" + #copyright = "All Rights Reserved - 2006 -" author = "don" authorlocation = "3rd rock from the Sun" authorwebsite = "https://www.duckland.org" + cover = "/images/user.jpg" + description = "Donald Harper Photographs" + email = "don@donaldharper.com" + bio = [ + "Don is a computer guy stumbling through life trying to raise his kids and take some pictures" + ] + copyright = [ + "© 2006-2019 Don Harper" + ] logo = "/images/user.png" + paginate = 5 # Optional RSS-Link, if not provided it defaults to the standard index.xml RSSLink = "rss.xml" githubName = "duckunix" @@ -40,10 +57,14 @@ theme = "Bleach" github = "https://github.com/duckunix" # linkedin = "https://linkedin.com" -[outputs] - home = [ "RSS", "HTML"] - -[outputFormats] - [outputFormats.RSS] - mediatype = "application/rss" - path = "feed" + [params.writers] + [params.writers."Don Harper"] + link = "https://www.duckland.org/" + email = "duck@duckland.org" + bio = [ + "Don is a computer guy stumbling through life trying to raise his kids and take some pictures" + ] + twitter = "https://twitter.com/duckunix" + linkedin = "https://www.linkedin.com/in/donaldharper" + instagram = "https://www.instagram.com/duckunix/" + github = "https://github.com/duckunix" diff --git a/content/posts/2019/08/16/p52-32-folded-notes.md b/content/posts/2019/08/16/p52-32-folded-notes.md new file mode 100644 index 00000000..b8dff46d --- /dev/null +++ b/content/posts/2019/08/16/p52-32-folded-notes.md @@ -0,0 +1,7 @@ ++++ +date = "2019-08-16T04:00:00-07:00" +title = "P52-32 : Folded Notes" +image = "/wp-content/uploads/2019/08/20190813135911591518.jpg" +series = ["Project 52"] ++++ +![P52-32 : Folded Notes](/wp-content/uploads/2019/08/20190813135911591518.jpg) diff --git a/content/wp-content/uploads/2019/08/20190813135911591518.jpg b/content/wp-content/uploads/2019/08/20190813135911591518.jpg new file mode 100644 index 00000000..7929adc6 Binary files /dev/null and b/content/wp-content/uploads/2019/08/20190813135911591518.jpg differ diff --git a/resources/_gen/assets/js/js/index.js_a64a8f41489dfe65eddbff8447bd69ed.content b/resources/_gen/assets/js/js/index.js_a64a8f41489dfe65eddbff8447bd69ed.content new file mode 100644 index 00000000..9c536fce --- /dev/null +++ b/resources/_gen/assets/js/js/index.js_a64a8f41489dfe65eddbff8447bd69ed.content @@ -0,0 +1,402 @@ +function createEl(element) { + return document.createElement(element); +} + +function elem(selector, parent = document){ + let elem = parent.querySelector(selector); + return elem != false ? elem : false; +} + +function elems(selector, parent = document) { + let elems = parent.querySelectorAll(selector); + return elems.length ? elems : false; +} + +function pushClass(el, targetClass) { + // equivalent to addClass + if (el && typeof el == 'object' && targetClass) { + elClass = el.classList; + elClass.contains(targetClass) ? false : elClass.add(targetClass); + } +} + +function deleteClass(el, targetClass) { + // equivalent to removeClass + if (el && typeof el == 'object' && targetClass) { + elClass = el.classList; + elClass.contains(targetClass) ? elClass.remove(targetClass) : false; + } +} + +function modifyClass(el, targetClass) { + if (el && typeof el == 'object' && targetClass) { + elClass = el.classList; + elClass.contains(targetClass) ? elClass.remove(targetClass) : elClass.add(targetClass); + } +} + +function containsClass(el, targetClass) { + if (el && typeof el == 'object' && targetClass) { + return el.classList.contains(targetClass) ? true : false; + } +} + +function isChild(node, parentClass) { + let objectsAreValid = node && typeof node == 'object' && parentClass && typeof parentClass == 'string'; + return (objectsAreValid && node.closest(parentClass)) ? true : false; +} + +(function updateDate() { + var date = new Date(); + var year = date.getFullYear(); + elem('.year').innerHTML = year; +})(); + +(function() { + let bar = 'nav_bar-wrap'; + let navBar = elem(`.${bar}`); + let nav = elem('.nav-body'); + let open = 'nav-open'; + let exit = 'nav-exit'; + let drop = 'nav-drop'; + let pop = 'nav-pop'; + let navDrop = elem(`.${drop}`); + let hidden = 'hidden'; + + function toggleMenu(){ + modifyClass(navDrop, pop); + modifyClass(navBar, hidden); + let menuOpen = containsClass(nav, open); + let menuPulled = containsClass(nav, exit); + + let status = menuOpen || menuPulled ? true : false; + + status ? modifyClass(nav, exit) : modifyClass(nav, open); + status ? modifyClass(nav, open) : modifyClass(nav, exit); + } + + // $('.nav-bar, .nav-close').on('click', () => toggleMenu()); + navBar.addEventListener('click', function() { + toggleMenu(); + }); + elem('.nav-close').addEventListener('click', function() { + toggleMenu(); + }); + + elem('.nav-drop').addEventListener('click', function(e) { + e.target === this ? toggleMenu() : false; + }); + +})(); + +(function share(){ + let share = elem('.share'); + let open = 'share-open'; + let close = 'share-close'; + let button = elem('.share-trigger'); + + function showShare() { + pushClass(share, open); + deleteClass(share, close); + } + + function hideShare() { + pushClass(share, open); + deleteClass(share, close); + } + if (button) { + button.addEventListener('click', function() { + showShare(); + setTimeout(hideShare, 5000); + }); + } +})(); + +(function comments(){ + + let comments = elem('.comments'); + let form = elem('.form'); + let body = elem('body'); + let button = elem('.form_toggle'); + let replyNoticeTag = elem('.form .reply-notice') + let loading = 'form-loading'; + let open = 'form-open'; + let show = 'modal_show' + let toggled = 'toggled'; + + let successOutput = ['Review submitted', 'Thanks for your review! It will be shown on the site once it has been approved.']; + let errorOutput = ['Error', 'Sorry, there was an error with the submission!']; + + function handleForm(form) { + // clear form when reset button is clicked + elem('.form_input-reset').addEventListener('click', function (){ + clearForm(); + }); + + form.addEventListener('submit', function (event) { + pushClass(form, loading); + elem('.form_input-submit').value = 'Submitted'; // btn "submit" + + function resetForm() { + deleteClass(form, loading); + elem('.form_input-submit').value = 'Submit'; // btn "submit" + // $("form").trigger("reset"); + } + + function formActions(message) { + showModal(...message) // array destructuring + resetForm(); + } + + event.preventDefault(); + + + let url = [endpoint, 'v3/entry', gitProvider, username, repository, branch, 'comments'].join('/'); + fetch(url, { + method: "POST", + body: JSON.stringify(data), + headers: { + "Content-Type": "application/json" + } + }).then(function(res) { + if(res.ok) { + formActions(successOutput); + } else { + formActions(errorOutput); + } + }).catch(function(error) { + formActions(errorOutput); + console.error('Error:', error); + }); + }); + } + + form ? handleForm(form) : false; + function closeModal() { + elem('.modal_close').addEventListener('click', function () { + deleteClass(body, show); + deleteClass(form, loading); + elem('.form_input-submit').value = 'Submit'; // btn "submit" + deleteClass(form, open); + deleteClass(button, toggled); + button.textContent = 'Comment'; // change button text to original state + }); + } + + function showModal(title, message) { + elem('.modal_title').textContent = title; + elem('.modal_text').innerHTML = message; + + pushClass(body, show); + closeModal(); + clearForm(); + } + + (function toggleForm() { + if(button) { + button.addEventListener('click', function() { + modifyClass(form, open); + modifyClass(this, toggled); + this.textContent = containsClass(this, toggled) ? 'Cancel' : 'Comment'; + }); + } + })(); + + function clearForm() { + resetReplyTarget(); + // empty all text & hidden fields + elems('.form_input').forEach((form_input) => {form_input.value = ''}); + } + + function resetReplyTarget() { + elem('.form-comments .reply-notice .reply-name').textContent = ''; // reset reply target + let avatarTag = elem('.form-comments .reply-notice img'); + // using elem('.reply-notice-close-btn') doesn't return an operable object + if (avatarTag) { + replyNoticeTag.removeChild(avatarTag); // remove reply avatar + replyNoticeTag.removeChild(replyNoticeTag.lastChild); // remove the rightmost '×' button + pushClass(replyNoticeTag, 'hidden'); // hide reply target display + } + elem('.form-comments input[name="fields[replyThread]"]').value = ''; + elem('.form-comments input[name="fields[replyID]"]').value = ''; + elem('.form-comments input[name="fields[replyName]"]').value = ''; + } + + // record reply target when "reply to this comment" is pressed + (function toggleReplyNotice() { + if (comments) { + comments.addEventListener('click', function (evt){ + if (evt.target && containsClass(evt.target, 'comment_reply-btn')) { + // open the form in it's closed + if (!containsClass(form, open)) { + pushClass(form, open); + pushClass(button, toggled); + button.textContent = 'Cancel'; + } + resetReplyTarget(); + let comment = evt.target.parentNode; + let threadID = comment.getElementsByClassName('comment_threadID')[0].textContent; + elem('.form-comments input[name="fields[replyThread]"]').value = threadID; + elem('.form-comments input[name="fields[replyID]"]').value = comment.id; + let replyName = comment.getElementsByClassName('comment_name_span')[0].textContent; + elem('.form-comments input[name="fields[replyName]"]').value = replyName; + + // display reply target avatar and name + deleteClass(replyNoticeTag, 'hidden'); + elem('.form-comments .reply-name').textContent = replyName; + let avatarTag = createEl('img'); + avatarTag.className = 'comment_pic'; + avatarTag.src = comment.getElementsByClassName('comment_pic')[0].src; + let replyNameTag = replyNoticeTag.getElementsByClassName('reply-name')[0]; + replyNoticeTag.insertBefore(avatarTag, replyNameTag); + + // add button for removing reply target (static method would give error msg) + let closeReplyBtnTag = createEl('a'); + closeReplyBtnTag.className = 'reply-notice-close-btn'; + closeReplyBtnTag.textContent = '\u274C'; + // handle removal of reply target when '×' is pressed + closeReplyBtnTag.addEventListener('click', function(){ + resetReplyTarget(); + }); + replyNoticeTag.appendChild(closeReplyBtnTag); + } + }); + } + })(); +})(); + +function elemAttribute(elem, attr, value = null) { + if (value) { + elem.setAttribute(attr, value); + } else { + value = elem.getAttribute(attr); + return value ? value : false; + } +} + +(function(){ + let links = document.querySelectorAll('a'); + if(links) { + Array.from(links).forEach(function(link){ + let target, rel, blank, noopener, attr1, attr2, url, isExternal; + url = elemAttribute(link, 'href'); + isExternal = (url && typeof url == 'string' && url.startsWith('http')) && !containsClass(link, 'nav_item') && !isChild(link, '.post_item') && !isChild(link, '.pager') ? true : false; + if(isExternal) { + target = 'target'; + rel = 'rel'; + blank = '_blank'; + noopener = 'noopener'; + attr1 = elemAttribute(link, target); + attr2 = elemAttribute(link, noopener); + + attr1 ? false : elemAttribute(link, target, blank); + attr2 ? false : elemAttribute(link, noopener, noopener); + } + }); + } +})(); + +let headingNodes = [], results, link, icon, current, id, +tags = ['h2', 'h3', 'h4', 'h5', 'h6']; + + +current = document.URL; + +tags.forEach(function(tag){ + results = document.getElementsByTagName(tag); + Array.prototype.push.apply(headingNodes, results); +}); + +headingNodes.forEach(function(node){ + link = createEl('a'); + icon = createEl('img'); + icon.src = 'http://localhost:1313/images/icons/link.svg'; + link.className = 'link'; + link.appendChild(icon); + id = node.getAttribute('id'); + if(id) { + link.href = `${current}#${id}`; + node.appendChild(link); + pushClass(node, 'link_owner'); + } +}); + +const copyToClipboard = str => { + // Create a