From 40f5df18b55c7f15f2153e0a9b3bfc1bdb7a485c Mon Sep 17 00:00:00 2001 From: benjaminramey Date: Wed, 30 Sep 2020 17:06:54 -0500 Subject: [PATCH] Fix highlighting and get tag pages --- gatsby-node.js | 19 ++++++- ...arepoint-2010-documents-in-a-new-window.md | 2 +- ...ome-as-its-parent-got-rendering-instead.md | 4 +- ...efinity-5-1-pagesselector-in-javascript.md | 6 +-- ...010-page-layout-button-javascript-error.md | 2 +- ...esigner-field-auto-generation-is-flawed.md | 4 +- ...ie-date-parsing-doesnt-work-like-chrome.md | 4 +- ...ntication-and-group-based-authorization.md | 6 +-- src/templates/page.js | 1 + src/templates/tag.js | 50 +++++++++++++++++++ 10 files changed, 82 insertions(+), 16 deletions(-) create mode 100644 src/templates/tag.js diff --git a/gatsby-node.js b/gatsby-node.js index 0e11758..71150bd 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -19,7 +19,7 @@ exports.createPages = async ({ graphql, actions }) => { const result = await graphql(` query { - allMarkdownRemark { + postsRemark: allMarkdownRemark { edges { node { fields { @@ -28,10 +28,15 @@ exports.createPages = async ({ graphql, actions }) => { } } } + tagsGroup: allMarkdownRemark { + group(field: frontmatter___tags) { + fieldValue + } + } } `); - result.data.allMarkdownRemark.edges.forEach(({ node }) => { + result.data.postsRemark.edges.forEach(({ node }) => { createPage({ path: node.fields.slug, component: path.resolve(`./src/templates/post.js`), @@ -40,4 +45,14 @@ exports.createPages = async ({ graphql, actions }) => { } }); }); + + result.data.tagsGroup.group.forEach((tag) => { + createPage({ + path: `/tags/${tag.fieldValue}/`, + component: path.resolve(`./src/templates/tag.js`), + context: { + tag: tag.fieldValue + } + }); + }); }; \ No newline at end of file diff --git a/src/posts/2011/04/25/opening-all-sharepoint-2010-documents-in-a-new-window.md b/src/posts/2011/04/25/opening-all-sharepoint-2010-documents-in-a-new-window.md index d443961..4e3b784 100644 --- a/src/posts/2011/04/25/opening-all-sharepoint-2010-documents-in-a-new-window.md +++ b/src/posts/2011/04/25/opening-all-sharepoint-2010-documents-in-a-new-window.md @@ -10,7 +10,7 @@ We wanted an easy solution to open every document in a SharePoint from a documen I don’t know of any way to do this via a setting in SharePoint, but a little JavaScript employing jQuery does the job just perfectly. -```javascript %} +```javascript $(document).ready( function () { // has to be on an interval for grouped doc libraries diff --git a/src/posts/2012/08/09/rendering-must-have-placeholder-chrome-as-its-parent-got-rendering-instead.md b/src/posts/2012/08/09/rendering-must-have-placeholder-chrome-as-its-parent-got-rendering-instead.md index cb9a54a..836069e 100644 --- a/src/posts/2012/08/09/rendering-must-have-placeholder-chrome-as-its-parent-got-rendering-instead.md +++ b/src/posts/2012/08/09/rendering-must-have-placeholder-chrome-as-its-parent-got-rendering-instead.md @@ -9,7 +9,7 @@ tags: [sitecore] ## Problem I got the error message (in my Firebug console) in the Sitecore Page Editor on a page where I had a nested sublayout. I had a basic two-column layout for the main sublayout of the page. Then, in the right column, I had another sublayout that further divided up the right column as I needed. Here is what the nested sublayout looked like: -```html %} +```html