Mkdocs-material: Using Text as Logo.

Created on 23 Feb 2018  路  5Comments  路  Source: squidfunk/mkdocs-material

Note: There is another issue Text instead of logo in the template header, but the solution there didn't solve my problem.

I installed mkdocs and mkdocs-material both through pip. The official docs are suggesting me to create a new file my-site/partials/header.html and make the required changes, but it didn't work for me. There are two ways to install the theme, either through pip or by cloning the theme repo. I think the overriding partials method explained in the user-guide is applicable when we actually clone the repo, or am I missing something?

And @squidfunk, Thank you so much for the awesome work!

Most helpful comment

https://squidfunk.github.io/mkdocs-material/customization/#setup-and-theme-structure

Reference the Material theme as usual in your mkdocs.yml, and create a _new folder_ for overrides, e.g. theme, which you reference using _custom_dir_.

https://squidfunk.github.io/mkdocs-material/customization/#overriding-partials

In order to override the footer, we can replace the footer.html partial with our own partial. To do this, create the file partials/footer.html in the _theme_ directory. MkDocs will now use the new partial when rendering the theme. This can be done with any file.

  1. You need to create a folder (call it for example theme) inside your project (on the same level as assets folder).
  2. Move your partials folder to new theme folder.
  3. You also need to set custom_dir: 'theme' in theme options in your configuration file.

All 5 comments

Hi,

I have Material installed through pip and overriding partials is working fine for me.

Maybe show us your folder structure and configuration file.

Thank You @makshh for the response!

Following was my folder structure when I tried to override the default header.
screenshot from 2018-02-24 00-08-57

https://squidfunk.github.io/mkdocs-material/customization/#setup-and-theme-structure

Reference the Material theme as usual in your mkdocs.yml, and create a _new folder_ for overrides, e.g. theme, which you reference using _custom_dir_.

https://squidfunk.github.io/mkdocs-material/customization/#overriding-partials

In order to override the footer, we can replace the footer.html partial with our own partial. To do this, create the file partials/footer.html in the _theme_ directory. MkDocs will now use the new partial when rendering the theme. This can be done with any file.

  1. You need to create a folder (call it for example theme) inside your project (on the same level as assets folder).
  2. Move your partials folder to new theme folder.
  3. You also need to set custom_dir: 'theme' in theme options in your configuration file.

Thank You @makshh , the custom_dir setting in the mkdocs.yml worked for me.

Closing this as solved. Thanks @makshh for answering this one!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bborysenko picture bborysenko  路  4Comments

dbdevtop picture dbdevtop  路  4Comments

michael-nok picture michael-nok  路  3Comments

nikramakrishnan picture nikramakrishnan  路  3Comments

yogeshbeniwal picture yogeshbeniwal  路  4Comments