From 5d9ce248bdb43c3f9b703fc0ff4c1d0ce2dcf342 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sun, 26 Sep 2021 23:45:34 -0700 Subject: [PATCH] Add edit button to articles --- 404.html | 4 ++++ pencil.svg | 1 + 2 files changed, 5 insertions(+) create mode 100644 pencil.svg diff --git a/404.html b/404.html index 61e244b..559bb7e 100644 --- a/404.html +++ b/404.html @@ -16,6 +16,9 @@ Home + + Edit this article +
@@ -54,6 +57,7 @@ const proxyUrl = 'https://script.google.com/macros/s/AKfycbzMHxwypbwsccBq6RH8LDCAOpM02C4gbkljbcKHKFsoQTRE-f4XTIyswiaO0vshs-Kr/exec'; const documentId = window.location.pathname.split('/').pop(); const url = `${proxyUrl}?https://docs.googleapis.com/v1/documents/${documentId}`; + document.getElementById('edit').setAttribute('href', `https://docs.google.com/document/d/${documentId}/edit`); await fetch(url) .then((httpResponse) => httpResponse.json()) diff --git a/pencil.svg b/pencil.svg new file mode 100644 index 0000000..768af96 --- /dev/null +++ b/pencil.svg @@ -0,0 +1 @@ + \ No newline at end of file -- 2.47.3