I am using mkdocs-jupyter plugins to put my jupyter notebook files on the mkdocs blog.
I am curious to know if it is possible to put the adsense banners at the top of the jupyter notebook pages (i.e. above the jupyter notebook pages) when it is rendered.
This is what I have tried to put an adsense banner at the top of the webpage created with mkdocs-jupyter but didn't work.
1. Create a folder named templates in your MkDocs project, if it doesn't already exist.
2. Inside the templates folder, create a new file named custom_notebook.html.
3. In the custom_notebook.html file, extend the base.html template and override the content block with your AdSense code:
{% extends "base.html" %}
{% block content %}
<!-- Google AdSense Code -->
... (I put mt google adsense code here. Didn't include it here for a security reason)
<!-- End Google AdSense Code -->
<!-- Render the notebook content -->
{{ super() }}
{% endblock %}
4. Update the mkdocs.yml configuration file to use the custom template:
plugins:
- search
- mkdocs-jupyter:
exclude: .ipynb_checkpoints
template: templates/custom_notebook.html
I am using mkdocs-jupyter plugins to put my jupyter notebook files on the mkdocs blog.
I am curious to know if it is possible to put the adsense banners at the top of the jupyter notebook pages (i.e. above the jupyter notebook pages) when it is rendered.
This is what I have tried to put an adsense banner at the top of the webpage created with mkdocs-jupyter but didn't work.