enzostvs HF Staff commited on
Commit
72358e0
·
1 Parent(s): a2c35f4

add tag only when creating

Browse files
Files changed (1) hide show
  1. server.js +6 -6
server.js CHANGED
@@ -102,12 +102,12 @@ app.post("/api/deploy", checkUser, async (req, res) => {
102
  });
103
  }
104
 
105
- // add add the end of the body (before all the <script></script>) a paragraph with the mention this has been generated by DeepSite
106
- // and add a link to the website (https://enzostvs-deepsite.hf.space) + the logo "/logo.svg"
107
- const newHtml = html.replace(
108
- /<\/body>/,
109
- `<p style="text-align: center; font-size: 12px; color: #888; margin-top: 16px;">This website has been generated by <a href="https://enzostvs-deepsite.hf.space" target="_blank">DeepSite</a> <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;"></p></body>`
110
- );
111
 
112
  const file = new Blob([newHtml], { type: "text/html" });
113
  file.name = "index.html"; // Add name property to the Blob
 
102
  });
103
  }
104
 
105
+ if (!path) {
106
+ const newHtml = html.replace(
107
+ /<\/body>/,
108
+ `<p style="text-align: center; font-size: 12px; color: #888; margin-top: 16px;">This website has been generated by <a href="https://enzostvs-deepsite.hf.space" target="_blank">DeepSite</a> <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;"></p></body>`
109
+ );
110
+ }
111
 
112
  const file = new Blob([newHtml], { type: "text/html" });
113
  file.name = "index.html"; // Add name property to the Blob