From 9d62c8b5a5bbdc4f0a5cdea336e1d7b64c006a68 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Thu, 2 Apr 2020 19:40:54 -0400 Subject: [PATCH] remove scripts --- website/scripts/_temp_fix_partials.js | 18 ------------- website/scripts/_temp_fix_unclosed_tags.js | 16 ----------- .../scripts/_temp_remove_sidebar_current.js | 13 --------- website/scripts/_temp_rename.sh | 9 ------- website/scripts/_temp_rename_partials.sh | 13 --------- website/scripts/_temp_transform_all.sh | 7 ----- website/scripts/changelog.md | 27 ------------------- 7 files changed, 103 deletions(-) delete mode 100644 website/scripts/_temp_fix_partials.js delete mode 100644 website/scripts/_temp_fix_unclosed_tags.js delete mode 100644 website/scripts/_temp_remove_sidebar_current.js delete mode 100644 website/scripts/_temp_rename.sh delete mode 100644 website/scripts/_temp_rename_partials.sh delete mode 100644 website/scripts/_temp_transform_all.sh delete mode 100644 website/scripts/changelog.md diff --git a/website/scripts/_temp_fix_partials.js b/website/scripts/_temp_fix_partials.js deleted file mode 100644 index 6a783a619..000000000 --- a/website/scripts/_temp_fix_partials.js +++ /dev/null @@ -1,18 +0,0 @@ -// This script removes any `layout` keys in mdx files in a given directory, -// recursively. In this project, we use a default layout for all topic content, -// so the layout key is not necessary unless a topic needs to render into a -// unique layout - -const glob = require('glob') -const path = require('path') -const fs = require('fs') -const matter = require('gray-matter') - -glob.sync(path.join(__dirname, '../pages/**/*.mdx')).map(fullPath => { - let { content, data } = matter.read(fullPath) - content = content.replace( - /<%=\s*partial[(\s]["'](.*)["'][)\s]\s*%>/gm, - (_, partialPath) => `@include '${partialPath}.mdx'` - ) - fs.writeFileSync(fullPath, matter.stringify(content, data)) -}) diff --git a/website/scripts/_temp_fix_unclosed_tags.js b/website/scripts/_temp_fix_unclosed_tags.js deleted file mode 100644 index 2fc05378d..000000000 --- a/website/scripts/_temp_fix_unclosed_tags.js +++ /dev/null @@ -1,16 +0,0 @@ -// This script replaces
, which is invalid in react, with
for all markdown files - -const glob = require('glob') -const path = require('path') -const fs = require('fs') - -glob.sync(path.join(__dirname, '../pages/**/*.mdx')).map(fullPath => { - let content = fs.readFileSync(fullPath, 'utf8') - - // fix unclosed br tag - content = content.replace(/
/g, '
') - // fix unclosed img tags - content = content.replace(/(]+)(?/g, (_, m1) => `${m1} />`) - - fs.writeFileSync(fullPath, content) -}) diff --git a/website/scripts/_temp_remove_sidebar_current.js b/website/scripts/_temp_remove_sidebar_current.js deleted file mode 100644 index 584e6e950..000000000 --- a/website/scripts/_temp_remove_sidebar_current.js +++ /dev/null @@ -1,13 +0,0 @@ -// This script removes the "sidebar_current" key from frontmatter, as it is -// no longer needed. - -const glob = require('glob') -const path = require('path') -const fs = require('fs') -const matter = require('gray-matter') - -glob.sync(path.join(__dirname, '../pages/**/*.mdx')).map(fullPath => { - let { content, data } = matter.read(fullPath) - delete data.sidebar_current - fs.writeFileSync(fullPath, matter.stringify(content, data)) -}) diff --git a/website/scripts/_temp_rename.sh b/website/scripts/_temp_rename.sh deleted file mode 100644 index 5c5f76617..000000000 --- a/website/scripts/_temp_rename.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Renames the slew of markdown extensions in middleman all to .mdx -# Call with the path to the root folder, will convert recursively -# For example, bash _temp_rename.bash pages/packer -# This file can be removed once we have finished porting from the old version! - -find $1 -name "*.html.md" -exec rename 's/\.html.md$/.mdx/' '{}' \; -find $1 -name "*.html.markdown" -exec rename 's/\.html.markdown$/.mdx/' '{}' \; -find $1 -name "*.html.md.erb" -exec rename 's/\.html.md.erb$/.mdx/' '{}' \; -find $1 -name "*.md" -exec rename 's/\.md$/.mdx/' '{}' \; diff --git a/website/scripts/_temp_rename_partials.sh b/website/scripts/_temp_rename_partials.sh deleted file mode 100644 index f8113a4cc..000000000 --- a/website/scripts/_temp_rename_partials.sh +++ /dev/null @@ -1,13 +0,0 @@ -# Renames the slew of markdown extensions in middleman all to .mdx -# Call with the path to the root folder, will convert recursively -# For example, bash _temp_rename.bash pages/packer -# This file can be removed once we have finished porting from the old version! - -find $1 -name "*.html.md" -exec rename 's/\.html.md$/.mdx/' '{}' \; -find $1 -name "*.html.markdown" -exec rename 's/\.html.markdown$/.mdx/' '{}' \; -find $1 -name "*.html.md.erb" -exec rename 's/\.html.md.erb$/.mdx/' '{}' \; -find $1 -name "*.md" -exec rename 's/\.md$/.mdx/' '{}' \; -find $1 -name "_" -exec echo 'foo' \; -rename -v 's/\/_(.*)/\/$1/' pages/partials/*/*.mdx -rename -v 's/\/_(.*)/\/$1/' pages/partials/*/*/*.mdx -rename -v 's/\/_(.*)/\/$1/' pages/partials/*/*/*/*.mdx diff --git a/website/scripts/_temp_transform_all.sh b/website/scripts/_temp_transform_all.sh deleted file mode 100644 index e2ad08b31..000000000 --- a/website/scripts/_temp_transform_all.sh +++ /dev/null @@ -1,7 +0,0 @@ -# runs all transforms needed for a fresh content port - -sh scripts/_temp_rename.sh pages/docs; -sh scripts/_temp_rename.sh pages/intro; -sh scripts/_temp_rename.sh pages/guides; -node scripts/_temp_fix_unclosed_tags.js; -node scripts/_temp_fix_partials.js; diff --git a/website/scripts/changelog.md b/website/scripts/changelog.md deleted file mode 100644 index f230cb4cd..000000000 --- a/website/scripts/changelog.md +++ /dev/null @@ -1,27 +0,0 @@ -# changes - -- `/intro/getting-started/install` redirects to `/intro/getting-started` -- `/guides/hcl` folders with only index changed to named individual files -- `/docs/install/index.html` to `docs/install.html` -- `/docs/other` dumped to root -- `/docs/basics/terminology` -> `/docs/terminology` -- `/docs/configuration/from-1.5` -> `/docs/from-1.5` -- `/docs/from-1.5/functions.html` -> `/docs/from-1.5/functions/index.html` -- [BREAKING] `/docs/from-1.5/functions/collection/index.html` -> `/docs/from-1.5/functions/collection/index-fn.html` -- `/docs/from-1.5/functions/*/overview.html` -> `/docs/from-1.5/functions/*/index.html` -- `/docs/builders/amazon-*` -> `/docs/builders/amazon/*` -- `/docs/builders/azure-*` -> `/docs/builders/azure/*` -- `/docs/builders/hyperv-*` -> `/docs/builders/hyperv/*` -- `/docs/builders/oracle-*` -> `/docs/builders/oracle/*` -- `/docs/builders/osc-*` -> `/docs/builders/outscale/*` -- `/docs/builders/outscale.html` -> `/docs/builders/outscale/index.html` -- `/docs/builders/parallels-*` -> `/docs/builders/parallels/*` -- `/docs/builders/virtualbox-*` -> `/docs/builders/virtualbox/*` -- `/docs/builders/vmware-*` -> `/docs/builders/vmware/*` -- `/docs/builders/vsphere-*` -> `/docs/builders/vmware/vsphere-*` - -# notes: - -- empty index files on all `from-1.5/functions/*` -- how do the generated docs work? can we keep it even with changes? -- should any of the other builders be nested under a subdirectory? like `alicloud-ecs`, `tencent-cvm` or `ucloud-uhost`?