iquidus / explorer

An open source block explorer
BSD 3-Clause "New" or "Revised" License
750 stars 1.33k forks source link

Google Adsense #500

Closed Zetalon0 closed 1 year ago

Zetalon0 commented 1 year ago

Possible to include ads?

uaktags commented 1 year ago

Sure, you can add it to the html portion of the views.

Zetalon0 commented 1 year ago

Thx but where is that?

uaktags commented 1 year ago

https://github.com/iquidus/explorer/blob/master/views/layout.pug

this is the overall layout of the Explorer (head + body). You'll have to write your script in pug format, but that should be pretty straightforward looking at how scripts are added in the layout.

So you're probably looking at something like

script(async, src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-#####"
     crossorigin="anonymous")
ins.adsbygoogle(style="display:block", data-ad-client="ca-pub-####", data-ad-slot="####", data-ad-format="auto", data-full-width-responsive="true")
script.
     (adsbygoogle = window.adsbygoogle || []).push({});

Note that you can always use a resource like https://html2pug.vercel.app/ to convert html to being Pug/Jade compatible.

Zetalon0 commented 1 year ago

thx