From 4185f33c152487a3dfeaca917ca20847295a2496 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Mon, 18 Jun 2018 09:00:00 -0500 Subject: [PATCH] Adds markdown-it-anchor plugin --- .eleventy.js | 18 ++++++++++++++++++ css/index.css | 18 ++++++++++++++++++ package.json | 4 +++- posts/firstpost.md | 2 ++ posts/secondpost.md | 2 ++ posts/thirdpost.md | 2 ++ 6 files changed, 45 insertions(+), 1 deletion(-) diff --git a/.eleventy.js b/.eleventy.js index 9f32509..6d13f5c 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -22,6 +22,24 @@ module.exports = function(eleventyConfig) { eleventyConfig.addPassthroughCopy("img"); eleventyConfig.addPassthroughCopy("css"); + /* Markdown Plugins */ + let markdownIt = require("markdown-it"); + let markdownItAnchor = require("markdown-it-anchor"); + let options = { + html: true, + breaks: true, + linkify: true + }; + let opts = { + permalink: true, + permalinkClass: "direct-link", + permalinkSymbol: "#" + }; + + eleventyConfig.setLibrary("md", markdownIt(options) + .use(markdownItAnchor, opts) + ); + return { templateFormats: [ "md", diff --git a/css/index.css b/css/index.css index 6bdbf72..dbe0741 100644 --- a/css/index.css +++ b/css/index.css @@ -183,3 +183,21 @@ a[href].tag:visited { .warning ol:only-child { margin: 0; } + +/* Direct Links / Markdown Headers */ +.direct-link { + font-family: sans-serif; + text-decoration: none; + font-style: normal; + margin-left: .1em; +} +a[href].direct-link, +a[href].direct-link:visited { + color: transparent; +} +a[href].direct-link:focus, +a[href].direct-link:focus:visited, +:hover > a[href].direct-link, +:hover > a[href].direct-link:visited { + color: #aaa; +} \ No newline at end of file diff --git a/package.json b/package.json index 14516b7..f13c129 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,8 @@ "@11ty/eleventy": "^0.3.6", "@11ty/eleventy-plugin-rss": "^1.0.2", "@11ty/eleventy-plugin-syntaxhighlight": "^1.0.5", - "luxon": "^1.0.0" + "luxon": "^1.0.0", + "markdown-it": "^8.4.1", + "markdown-it-anchor": "^4.0.0" } } diff --git a/posts/firstpost.md b/posts/firstpost.md index aab569f..55f3af9 100644 --- a/posts/firstpost.md +++ b/posts/firstpost.md @@ -9,6 +9,8 @@ Leverage agile frameworks to provide a robust synopsis for high level overviews. Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. +## Section Header + Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. ``` text/2-3 diff --git a/posts/secondpost.md b/posts/secondpost.md index 45797ee..c7afa5f 100644 --- a/posts/secondpost.md +++ b/posts/secondpost.md @@ -7,6 +7,8 @@ layout: layouts/post.njk --- Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. +## Section Header + First post Third post diff --git a/posts/thirdpost.md b/posts/thirdpost.md index 4951a7f..d128384 100644 --- a/posts/thirdpost.md +++ b/posts/thirdpost.md @@ -17,4 +17,6 @@ function myCommand() { Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. +## Section Header + Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.