Skip to content
Permalink
Browse files

convert to mdx

  • Loading branch information
Arcath committed Mar 9, 2020
1 parent ed73059 commit 4dac6e26813a19409c5356c7bf0a1f77d87551d2
Showing with 1,083 additions and 324 deletions.
  1. +3 −0 .vscode/settings.json
  2. +49 −49 gatsby-config.js
  3. +3 −3 gatsby/create-pages.js
  4. +1 −1 gatsby/on-create-node.js
  5. +942 −202 package-lock.json
  6. +4 −0 package.json
  7. +33 −20 src/components/content.tsx
  8. 0 src/content/books/snow-crash/{index.md → index.mdx}
  9. 0 src/content/books/the-rise-and-fall-of-dodo/{index.md → index.mdx}
  10. 0 src/content/notes/2017-04-11-jekyll-atom-2-0-0/{index.md → index.mdx}
  11. 0 src/content/notes/2018-08-01-a-nice-wallpaper/{index.md → index.mdx}
  12. 0 src/content/pages/{about.md → about.mdx}
  13. 0 src/content/pages/{contact.md → contact.mdx}
  14. 0 src/content/pages/{uses.md → uses.mdx}
  15. 0 src/content/posts/2013-08-28-expects/{index.md → index.mdx}
  16. 0 src/content/posts/2013-08-28-issue-37/{index.md → index.mdx}
  17. 0 src/content/posts/2013-08-29-active-record-like-search-results/{index.md → index.mdx}
  18. 0 src/content/posts/2013-11-02-cancan-route-constraints/{index.md → index.mdx}
  19. 0 src/content/posts/2014-02-12-deploying-adobe-air-and-air-apps/{index.md → index.mdx}
  20. 0 src/content/posts/2014-02-18-powershell-script-to-update-sims-fms/{index.md → index.mdx}
  21. 0 src/content/posts/2014-04-02-a-jekyll-extension-for-atom/{index.md → index.mdx}
  22. 0 src/content/posts/2015-05-27-creating-the-less-compiler-for-compile-watch/{index.md → index.mdx}
  23. 0 src/content/posts/2015-06-23-jekyll-atom-1-0-0/{index.md → index.mdx}
  24. 0 src/content/posts/2015-07-14-caching-apple-downloads/{index.md → index.mdx}
  25. 0 src/content/posts/2015-07-14-sodb/{index.md → index.mdx}
  26. 0 src/content/posts/2015-07-15-caching-apple-downloads-on-a-windows-server/{index.md → index.mdx}
  27. 0 src/content/posts/2015-11-10-motorway/{index.md → index.mdx}
  28. 0 src/content/posts/2016-01-12-less-in-a-wordpress-theme/{index.md → index.mdx}
  29. 0 src/content/posts/2016-01-22-improving-speed-in-jekyll-atom/{index.md → index.mdx}
  30. 0 src/content/posts/2016-01-22-state-of-the-universe/{index.md → index.mdx}
  31. 0 src/content/posts/2016-01-25-jekyll-atom-1-1-0/{index.md → index.mdx}
  32. 0 src/content/posts/2016-02-01-building-windows-10-images/{index.md → index.mdx}
  33. 0 src/content/posts/2016-02-04-ajax-page-loading-in-jekyll-or-any-static-site/{index.md → index.mdx}
  34. 0 src/content/posts/2016-02-23-setting-up-lunr-js-in-jekyll/{index.md → index.mdx}
  35. 0 src/content/posts/2016-02-25-using-jekyll-atom-from-start-to-finish/{index.md → index.mdx}
  36. 0 src/content/posts/2016-03-01-jekyll-atom-1-2-0/{index.md → index.mdx}
  37. 0 src/content/posts/2016-03-29-react/{index.md → index.mdx}
  38. 0 src/content/posts/2016-07-22-radius-with-windows-server-2012r2/{index.md → index.mdx}
  39. 0 src/content/posts/2016-08-18-everything-option-theme/{index.md → index.mdx}
  40. 0 src/content/posts/2016-09-07-surface-pro-3-review/{index.md → index.mdx}
  41. 0 src/content/posts/2016-09-13-plugin-highlight-crop-thumbnails/{index.md → index.mdx}
  42. 0 src/content/posts/2016-09-23-wp-controls/{index.md → index.mdx}
  43. 0 src/content/posts/2016-10-04-post-formats-theme/{index.md → index.mdx}
  44. 0 src/content/posts/2016-11-01-squirrel-release-server/{index.md → index.mdx}
  45. 0 src/content/posts/2016-11-08-electron-app-customer-support/{index.md → index.mdx}
  46. 0 src/content/posts/2016-11-15-screeps-part-1-rc1-rc2/{index.md → index.mdx}
  47. 0 src/content/posts/2016-11-17-screeps-part-2-rc3/{index.md → index.mdx}
  48. 0 src/content/posts/2016-11-21-screeps-part-3-rc4-surprise/{index.md → index.mdx}
  49. 0 src/content/posts/2016-11-22-osticket-api-proxy/{index.md → index.mdx}
  50. 0 src/content/posts/2016-11-23-screeps-part-4/{index.md → index.mdx}
  51. 0 ...ontent/posts/2016-11-27-screeps-part-5-finishing-rc4-rewriting-creeps-gcl2/{index.md → index.mdx}
  52. 0 src/content/posts/2016-11-30-screeps-part-6-poking-enemy/{index.md → index.mdx}
  53. 0 src/content/posts/2016-12-06-screeps-part-7-a-complete-re-write/{index.md → index.mdx}
  54. 0 src/content/posts/2016-12-14-screeps-part-8-constructors-defcon/{index.md → index.mdx}
  55. 0 src/content/posts/2016-12-20-pac-file-system/{index.md → index.mdx}
  56. 0 src/content/posts/2016-12-22-remove-guided-access-mode-ipad/{index.md → index.mdx}
  57. 0 src/content/posts/2017-01-02-gcl3-another-respawn/{index.md → index.mdx}
  58. 0 src/content/posts/2017-01-11-screeps-part-10-rc6-twice-third-room/{index.md → index.mdx}
  59. 0 src/content/posts/2017-01-27-screeps-part-11-the-great-depression/{index.md → index.mdx}
  60. 0 src/content/posts/2017-03-29-theme-options/{index.md → index.mdx}
  61. 0 src/content/posts/2017-05-23-etch-router/{index.md → index.mdx}
  62. 0 src/content/posts/2017-06-06-b4rn/{index.md → index.mdx}
  63. 0 src/content/posts/2017-06-22-screeps-part-12-start-again/{index.md → index.mdx}
  64. 0 src/content/posts/2017-07-02-screeps-part-13-building-up/{index.md → index.mdx}
  65. 0 src/content/posts/2017-07-05-screeps-part-14-more-improvements-and-a-respawn/{index.md → index.mdx}
  66. 0 src/content/posts/2017-07-10-screeps-part-15-new-empire/{index.md → index.mdx}
  67. 0 src/content/posts/2017-07-14-screeps-part-16-party-time/{index.md → index.mdx}
  68. 0 src/content/posts/2017-07-24-screeps-part-17-room-planning/{index.md → index.mdx}
  69. 0 src/content/posts/2017-09-04-screeps-part-18-typescript/{index.md → index.mdx}
  70. 0 src/content/posts/2017-09-07-creating-an-msi-transform-with-super-orca/{index.md → index.mdx}
  71. 0 src/content/posts/2017-09-20-office-update-remover/{index.md → index.mdx}
  72. 0 src/content/posts/2017-09-28-screeps-part-19-operating-systems/{index.md → index.mdx}
  73. 0 src/content/posts/2017-10-12-screeps-part-20-bunkers/{index.md → index.mdx}
  74. 0 src/content/posts/2017-11-22-screeps-part-21-optimizing-the-os/{index.md → index.mdx}
  75. 0 src/content/posts/2017-12-20-screeps-part-22-war-and-claiming-another-shard/{index.md → index.mdx}
  76. 0 ...tent/posts/2018-02-08-disable-windows-10-colour-filter-shortcut-with-a-gpo/{index.md → index.mdx}
  77. 0 src/content/posts/2018-07-06-wp_enqueue_less-a-replacement-for-wp-less/{index.md → index.mdx}
  78. +1 −2 src/content/posts/2018-12-04-moving-to-gatsby/{index.md → index.mdx}
  79. 0 src/content/posts/2018-12-08-robocopy/{index.md → index.mdx}
  80. 0 src/content/posts/2019-01-19-netlify-cms-on-the-filesystem-with-gatsby/{index.md → index.mdx}
  81. 0 src/content/posts/2019-01-23-generated-social-images/{index.md → index.mdx}
  82. 0 src/content/posts/2019-02-14-wp-update-provider/{index.md → index.mdx}
  83. 0 src/content/posts/2019-02-27-wp-camo/{index.md → index.mdx}
  84. 0 src/content/posts/2019-03-08-using-wix-to-create-an-msi/{index.md → index.mdx}
  85. 0 src/content/posts/2019-04-23-dark-mode/{index.md → index.mdx}
  86. 0 src/content/posts/2019-05-15-using-htmr-to-bring-life-to-links-in-gatsby/{index.md → index.mdx}
  87. 0 ...posts/2019-10-18-setting-swiggle-as-the-default-search-provider-for-chrome/{index.md → index.mdx}
  88. 0 src/content/posts/2019-11-25-destructuring-in-javascript/{index.md → index.mdx}
  89. 0 src/content/posts/2020-02-14-deploying-swiggle-screen-cover/{index.md → index.mdx}
  90. 0 src/content/posts/2020-02-20-css-grid-layout/{index.md → index.mdx}
  91. 0 src/content/projects/pac-file-tester/{index.md → index.mdx}
  92. 0 src/content/projects/post-formats/{index.md → index.mdx}
  93. 0 src/content/projects/sodb/{index.md → index.mdx}
  94. 0 src/content/projects/the-book-lounge/{index.md → index.mdx}
  95. 0 src/content/projects/theme-options/{index.md → index.mdx}
  96. 0 src/content/projects/use-form/{index.md → index.mdx}
  97. +1 −1 src/pages/articles.tsx
  98. +3 −3 src/pages/index.tsx
  99. +1 −1 src/pages/projects.tsx
  100. +9 −9 src/templates/book.tsx
  101. +8 −8 src/templates/note.tsx
  102. +8 −8 src/templates/page.tsx
  103. +8 −8 src/templates/post.tsx
  104. +8 −8 src/templates/project.tsx
  105. +1 −1 src/templates/tag.tsx
@@ -3,5 +3,8 @@
"activityBar.background": "#4834d4",
"titleBar.activeBackground": "#686de0",
"titleBar.activeForeground": "#FDF9F8"
},
"[mdx]": {
"editor.wordWrap": "on"
}
}
@@ -1,5 +1,47 @@
'use strict'

const REMARK_PLUGINS = [
`@weknow/gatsby-remark-twitter`,
{
resolve: 'gatsby-remark-responsive-iframe',
options: {
wrapperStyle: 'margin-bottom: 1rem'
}
},
{
resolve: 'gatsby-remark-custom-blocks',
options: {
blocks: {
fullWidthImage: {
classes: 'full-width-image'
},
floatLeft: {
classes: 'float-left'
},
figure: {
classes: 'figure'
}
}
}
},
'gatsby-remark-prismjs',
'gatsby-remark-copy-linked-files',
'gatsby-remark-smartypants',
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 1920,
quality: 90,
linkImagesToOriginal: false,
withWebp: true,
tracedSVG: {
threshold: 10,
color: '#4834d4'
}
}
}
]

module.exports = {
siteMetadata: {
title: 'Adam Laycock',
@@ -51,49 +93,9 @@ module.exports = {
}
},
{
resolve: 'gatsby-transformer-remark',
resolve: `gatsby-plugin-mdx`,
options: {
plugins: [
`@weknow/gatsby-remark-twitter`,
{
resolve: 'gatsby-remark-responsive-iframe',
options: {
wrapperStyle: 'margin-bottom: 1rem'
}
},
{
resolve: 'gatsby-remark-custom-blocks',
options: {
blocks: {
fullWidthImage: {
classes: 'full-width-image'
},
floatLeft: {
classes: 'float-left'
},
figure: {
classes: 'figure'
}
}
}
},
'gatsby-remark-prismjs',
'gatsby-remark-copy-linked-files',
'gatsby-remark-smartypants',
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 1920,
quality: 90,
linkImagesToOriginal: false,
withWebp: true,
tracedSVG: {
threshold: 10,
color: '#4834d4'
}
}
}
]
gatsbyRemarkPlugins: REMARK_PLUGINS
}
},
'gatsby-transformer-json',
@@ -177,10 +179,9 @@ module.exports = {
],
// How to resolve each field's value for a supported node type
resolvers: {
// For any node of type MarkdownRemark, list how to resolve the fields' values
MarkdownRemark: {
Mdx: {
title: node => node.frontmatter.title,
content: node => node.rawMarkdownBody,
content: node => node.frontmatter.lead,
url: node => node.fields.slug,
lead: node => node.frontmatter.lead,
date: node => node.frontmatter.date,
@@ -208,23 +209,22 @@ module.exports = {
feeds: [
{
serialize: ({ query: { site, allMarkdownRemark } }) => {
return allMarkdownRemark.edges.map(edge => {
return allMdx.edges.map(edge => {
return Object.assign(
{},
{
title: edge.node.frontmatter.title || 'New post by Adam Laycock',
description: edge.node.fields.lead || edge.node.excerpt,
date: edge.node.fields.date,
url: site.siteMetadata.siteUrl + edge.node.fields.slug,
guid: site.siteMetadata.siteUrl + edge.node.fields.slug,
custom_elements: [{ 'content:encoded': edge.node.html }]
guid: site.siteMetadata.siteUrl + edge.node.fields.slug
}
)
})
},
query: `
{
allMarkdownRemark(
allMdx(
limit: 10,
filter: {
fields: {slug: {regex: "/^\/20/"}}
@@ -5,7 +5,7 @@ module.exports = async ({graphql, actions}) => {

const allMarkdown = await graphql(`
{
allMarkdownRemark(limit: 1000) {
allMdx(limit: 1000) {
edges {
node {
fields {
@@ -17,7 +17,7 @@ module.exports = async ({graphql, actions}) => {
}
}
posts: allMarkdownRemark(
posts: allMdx(
filter: {fields: {layout: {glob: "+(post|book|note)"}}},
sort: {fields: [fields___date], order: DESC}
){
@@ -38,7 +38,7 @@ module.exports = async ({graphql, actions}) => {

let allTags = []

allMarkdown.data.allMarkdownRemark.edges.forEach(({ node }, i) => {
allMarkdown.data.allMdx.edges.forEach(({ node }, i) => {
const {slug, layout, tags} = node.fields

if(tags){
@@ -7,7 +7,7 @@ module.exports = ({node, actions, getNode}) => {
const {createNodeField} = actions

switch (node.internal.type) {
case 'MarkdownRemark': {
case 'Mdx': {
let {permalink, layout, lead, date, tags} = node.frontmatter
const {relativePath} = getNode(node.parent)

0 comments on commit 4dac6e2

Please sign in to comment.
You can’t perform that action at this time.