From d9d75d769acc7b12496d78f63f4c756a9d068361 Mon Sep 17 00:00:00 2001 From: Daine Trinidad Date: Tue, 28 May 2024 08:36:26 -0700 Subject: [PATCH] chore: remove netlify leftover things (#359) --- README.md | 4 +- _redirects | 5 -- netlify.toml | 8 -- netlify/functions/submission-created.js | 45 ---------- src/_includes/layouts/admin.njk | 31 ------- src/admin/config.yml | 105 ------------------------ src/admin/index.md | 8 -- 7 files changed, 2 insertions(+), 204 deletions(-) delete mode 100644 _redirects delete mode 100644 netlify.toml delete mode 100644 netlify/functions/submission-created.js delete mode 100644 src/_includes/layouts/admin.njk delete mode 100644 src/admin/config.yml delete mode 100644 src/admin/index.md diff --git a/README.md b/README.md index d41e8d895..e93c1d3de 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ GC Design System Docs is a documentation website for GC Design System. You can f ## Tools -We are using [11ty](https://www.11ty.dev/docs/) and [Netlify](https://docs.netlify.com/) to build our documentation website. +We are using [11ty](https://www.11ty.dev/docs/) to build our documentation website.

@@ -81,7 +81,7 @@ Docs de Système de design GC est un site Web contenant de la documentation port ## Outils -Nous utilisons [11ty](https://www.11ty.dev/docs/) et [Netlify](https://docs.netlify.com/) pour construire notre site Web de documentation. +Nous utilisons [11ty](https://www.11ty.dev/docs/) pour construire notre site Web de documentation.

diff --git a/_redirects b/_redirects deleted file mode 100644 index ef205ce88..000000000 --- a/_redirects +++ /dev/null @@ -1,5 +0,0 @@ -https://design-system.alpha.canada.ca/ https://design-system.alpha.canada.ca/en -https://systeme-design.alpha.canada.ca/ https://systeme-design.alpha.canada.ca/fr -https://design-system.alpha.canada.ca/fr/* https://systeme-design.alpha.canada.ca/fr/:splat 301! -https://systeme-design.alpha.canada.ca/en/* https://design-system.alpha.canada.ca/en/:splat 301! -https://cds-design-snc.netlify.app/* https://design-system.alpha.canada.ca/:splat 301! diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index 5775f9a9c..000000000 --- a/netlify.toml +++ /dev/null @@ -1,8 +0,0 @@ -[[headers]] - for = "/*" - [headers.values] - X-Frame-Options = "DENY" - X-XSS-Protection = "1; mode=block" - Referrer-Policy = "no-referrer" - X-Content-Type-Options = "nosniff" - Permissions-Policy = "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=(), interest-cohort=()" \ No newline at end of file diff --git a/netlify/functions/submission-created.js b/netlify/functions/submission-created.js deleted file mode 100644 index 663570363..000000000 --- a/netlify/functions/submission-created.js +++ /dev/null @@ -1,45 +0,0 @@ -import axios from 'axios'; -const { EMAIL_TARGET, API_KEY, TEMPLATE_ID, ACCESS_TOKEN } = process.env; -exports.handler = async (event, context) => { - const name = JSON.parse(event.body).payload.name; - const email = JSON.parse(event.body).payload.email; - const message = JSON.parse(event.body).payload.body; - const submission_id = JSON.parse(event.body).payload.id; - - const headData = { - 'Authorization': `ApiKey-v1 ${API_KEY}`, - 'Content-Type': 'application/json', - }; - - const postData = JSON.stringify({ - email_address: EMAIL_TARGET, - template_id: TEMPLATE_ID, - personalisation: { - name: name, - email: email, - message: message, - }, - }); - - await axios - .post( - 'https://api.notification.canada.ca/v2/notifications/email', - postData, - { headers: headData }, - ) - .then(res => { - console.log('RESPONSE RECEIVED: ', res); - }) - .catch(err => { - console.log('AXIOS ERROR: ', err); - }); - - const deleteHeader = { - Authorization: `Bearer ${ACCESS_TOKEN}`, - }; - - const res = await axios.delete( - `https://api.netlify.com/api/v1/submissions/${submission_id}`, - { headers: deleteHeader }, - ); -}; diff --git a/src/_includes/layouts/admin.njk b/src/_includes/layouts/admin.njk deleted file mode 100644 index c21867745..000000000 --- a/src/_includes/layouts/admin.njk +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Content Manager - - - - - {{ content | safe }} - - - - - - - \ No newline at end of file diff --git a/src/admin/config.yml b/src/admin/config.yml deleted file mode 100644 index 1224a11d9..000000000 --- a/src/admin/config.yml +++ /dev/null @@ -1,105 +0,0 @@ -backend: - name: git-gateway - branch: main -media_folder: '_images/uploads' -collections: - - name: 'en' # Used in routes, e.g., /admin/collections/blog - label: 'English page' # Used in the UI - folder: 'src/en' # The path to the folder where the documents are stored - create: true # Allow users to create new documents in this collection - nested: { depth: 100 } - fields: # The fields for each document, usually in front matter - - { - label: 'Layout', - name: 'layout', - widget: 'hidden', - default: 'layouts/base.njk', - } - - { label: 'Title', name: 'title', widget: 'string' } - - { - label: 'Translation key', - name: 'translationKey', - widget: 'string', - hint: 'Unique key to link to French page', - } - - label: 'Navigation' - name: 'eleventyNavigation' - widget: 'object' - required: false - hint: 'Navigation setup' - fields: - - { label: 'Key', name: 'key', widget: 'string', required: false } - - { - label: 'Parent', - name: 'parent', - widget: 'string', - required: false, - } - - { label: 'Title', name: 'title', widget: 'string', required: false } - - { - label: 'Locale', - name: 'locale', - widget: 'string', - default: 'en', - hint: 'Remove to not display in main nav', - required: false, - } - - { - label: 'Order', - name: 'order', - widget: 'number', - value_type: 'int', - required: false, - } - - { label: 'Body', name: 'body', widget: 'markdown' } - meta: { path: { label: Parent, widget: parent, index_file: 'index' } } - - name: 'fr' # Used in routes, e.g., /admin/collections/blog - label: 'French page' # Used in the UI - folder: 'src/fr' # The path to the folder where the documents are stored - create: true # Allow users to create new documents in this collection - nested: { depth: 100 } - fields: # The fields for each document, usually in front matter - - { - label: 'Layout', - name: 'layout', - widget: 'hidden', - default: 'layouts/base.njk', - } - - { label: 'Title', name: 'title', widget: 'string' } - - { - label: 'Translation key', - name: 'translationKey', - widget: 'string', - hint: 'Unique key to link to English page', - } - - label: 'Navigation' - name: 'eleventyNavigation' - widget: 'object' - required: false - hint: 'Navigation setup' - fields: - - { label: 'Key', name: 'key', widget: 'string', required: false } - - { - label: 'Parent', - name: 'parent', - widget: 'string', - required: false, - } - - { label: 'Title', name: 'title', widget: 'string', required: false } - - { - label: 'Locale', - name: 'locale', - widget: 'string', - default: 'fr', - hint: 'Remove to not display in main nav', - required: false, - } - - { - label: 'Order', - name: 'order', - widget: 'number', - value_type: 'int', - required: false, - } - - { label: 'Body', name: 'body', widget: 'markdown' } - meta: { path: { label: Parent, widget: parent, index_file: 'index' } } diff --git a/src/admin/index.md b/src/admin/index.md deleted file mode 100644 index 67e6eab13..000000000 --- a/src/admin/index.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Admin -layout: 'layouts/admin.njk' -sitemap: - ignore: true -permalink: /admin/ -eleventyExcludeFromCollections: true ----