danielfrg / mkdocs-jupyter

Use Jupyter Notebook in mkdocs
https://mkdocs-jupyter.danielfrg.com
Apache License 2.0
367 stars 45 forks source link

How can I put the adsense banner above the jupyter notebook pages? #145

Closed hellojinwoo closed 9 months ago

hellojinwoo commented 1 year ago
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
danielfrg commented 9 months ago

You should be able to do this just extending mkdocs. closing as not an issue with this project