From: Ardis Lu Date: Mon, 27 Sep 2021 06:45:34 +0000 (-0700) Subject: Add edit button to articles X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=5d9ce248bdb43c3f9b703fc0ff4c1d0ce2dcf342;p=ardislu.dev Add edit button to articles --- 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