This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git
The following commit(s) were added to refs/heads/master by this push:
new 2de6d60 feat: show netlify tip in Preview mode (#806)
2de6d60 is described below
commit 2de6d60beb42452ca312b9f4b02d31e2d5ff8525
Author: 琚致远 <[email protected]>
AuthorDate: Mon Dec 13 09:35:22 2021 +0800
feat: show netlify tip in Preview mode (#806)
---
website/config/ssrTemplate.js | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/website/config/ssrTemplate.js b/website/config/ssrTemplate.js
index 43f5ea7..e7e2ea8 100644
--- a/website/config/ssrTemplate.js
+++ b/website/config/ssrTemplate.js
@@ -31,5 +31,13 @@ module.exports = {
<% }); %>
<%~ it.postBodyTags %>
</body>
+ <script>
+ window.onload = function() {
+ if (window.location.host.endsWith(".netlify.app")) {
+ var footerDOM = document.querySelector('footer');
+ footerDOM.insertAdjacentHTML('afterend', '<div style="text-align:
right;padding: 48px 0;">This site is powered by <a
href="https://www.netlify.com/" target="_blank">Netlify</a></div>');
+ }
+ }
+ </script>
</html>`
}