Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ikrong committed Jun 29, 2024
1 parent 23dc3ed commit 916f45c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ async function replaceHTML(file) {
delete el.attribs.nonce
if (!el.attribs.src) {
const content = $(el).text();
if (String(content).includes("www.googletagmanager.com")) {
if ([
'www.googletagmanager.com',
].some(u => content.includes(u))
) {
$(el).remove();
}
continue;
Expand Down
2 changes: 2 additions & 0 deletions vue/Dockerfile.vue2
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ COPY . /app

RUN /app/tools/install.sh

RUN NODE_PATH=$(npm root --quiet -g) node /app/replace-2.js /app/source/

RUN cd /app/source/ && \
npm i -g pnpm && \
pnpm i && \
Expand Down
6 changes: 6 additions & 0 deletions vue/replace-2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const fs = require("fs");
const path = require("path");


const adTextEjs = path.join(HOST_DIR, "themes/vue/layout/partials/ad-text.ejs");
fs.writeFileSync(adTextEjs, "")

0 comments on commit 916f45c

Please sign in to comment.