Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The logo option should link to the configured site_url #238

msudol opened this issue Mar 30, 2017 · 13 comments

The logo option should link to the configured site_url #238

msudol opened this issue Mar 30, 2017 · 13 comments


Copy link

@msudol msudol commented Mar 30, 2017


The site logo currently has html source that looks like this

<a href="../.." title="My Docs" class="md-logo md-header-nav__button">

Expected behavior

Expected behavior would be that the yml configuration for site_url would be here if it is configured.

Actual behavior

The site_url configuration is not made available anywhere within the material theme.

Steps to reproduce the bug

  1. Set a logo in config
  2. Set a site_url in config
  3. Serve site in material theme

Package versions

  • Python: 3.6.0
  • MkDocs: 0.16.2
  • Material: 1.5.0

Project configuration

# Project information
site_name: My Docs Example
site_description: My Test Documentation Site
site_author: John Do
repo_name: 'My Docs Example'
repo_url: ''

# Copyright
copyright: 'Copyright &copy; 2016 - 2017 John Doe'

# Theme
theme: 'material'
theme_dir: 'theme'

  - 'css/extra.css'
# Options
  logo: 'assets/images/logo.svg'
    primary: 'blue grey'
    accent: 'deep orange'
    text: 'Roboto'
    code: 'Roboto Mono'

# Settings
docs_dir: 'docs'
site_dir: 'site'

# Extensions
    - admonition
    - smarty
    - codehilite
    - footnotes
    - meta
    - toc(permalink=true)
    - pymdownx.arithmatex
    - pymdownx.betterem(smart_enable=all)
    - pymdownx.caret
    - pymdownx.critic
    - pymdownx.inlinehilite
    - pymdownx.magiclink
    - pymdownx.mark
    - pymdownx.smartsymbols
    - pymdownx.superfences
    - pymdownx.tasklist(custom_checkbox=true)
    - pymdownx.tilde  

# Pages    
    - Home: ''
    - User Guide: 
        - 'Step 1': 'user-guide/'
        - 'Step 2': 'user-guide/'
        - 'Step 3': 'user-guide/'
    - About:
        - 'License': 'about/'
        - 'Release Notes': 'about/'    

System information

  • OS: Windows 10
  • Browser: Firefox
Copy link

@squidfunk squidfunk commented Mar 30, 2017

That's actually a good point and interesting that nobody noted it up to now. Makes sense to me, because sometimes you may want to link to another page and not to the index page of the docs.

@squidfunk squidfunk self-assigned this Mar 30, 2017
@squidfunk squidfunk added this to the 1.5.1 milestone Mar 30, 2017
Copy link

@msudol msudol commented Mar 30, 2017

Thanks, and amazing work on this theme by the way. I've been trying to settle on a framework for documentation and as a node.js developer wanted something node based.. but this theme along with how MkDocs is just so easy to get setup, it won me over.

Copy link

@squidfunk squidfunk commented Mar 30, 2017

Fixed in 1.5.1 which was just released.

@squidfunk squidfunk closed this Mar 30, 2017
Copy link

@borekb borekb commented Feb 19, 2018

I'm not sure this still works in the latest release – the icon links to in my case (I'm running the Docker container).

Copy link

@borekb borekb commented Feb 20, 2018

Strange, this is the generated HTML:

<div class="md-flex__cell md-flex__cell--shrink">
        <a href="" title="Example Docs" class="md-header-nav__button md-logo">
            <i class="md-icon">school</i>

Wondering if this has something to do with Docker: I'm on Windows where is not even valid. I can browse the docs in the browser at http://localhost:8000/ but when I click the home icon, the site doesn't load:


This is from my mkdocs.yml:

site_name: Example Docs
site_url: ''

(tried also without quotes).

Copy link

@borekb borekb commented Feb 20, 2018

For reference:

CMD ["serve", "--dev-addr="]

@squidfunk squidfunk reopened this Feb 20, 2018
Copy link

@squidfunk squidfunk commented Feb 20, 2018

I will investigate.

@squidfunk squidfunk added bug and removed enhancement labels Feb 20, 2018
Copy link

@squidfunk squidfunk commented Feb 21, 2018

The header correctly sets the link containing the logo to thesite_url specified in the mkdocs.yml. When you inspect the source on the Material documentation, the link is exactly the site_url. If no site_url is specified, Material falls back to the home page of the documentation.

However, when MkDocs is run in watch mode, it sets the site_url to localhost:8000 by default. The address was set to be in the dev container to ease testing on mobile devices on the same network. Maybe the best option would be to drop the --dev-addr flag on the Docker container, so MkDocs should expose the docs on localhost:8000. This suggests that the logo will always link to this very address in the watch mode.

I will remove the --dev-addr flag from the Docker container. Let's see if users complain about it.

Copy link

@squidfunk squidfunk commented Feb 21, 2018

Removed in bdf24e2, will be released as part of 2.6.4 in a minute.

In case there are still problems, please re-open.

@squidfunk squidfunk closed this Feb 21, 2018
Copy link

@borekb borekb commented Feb 22, 2018

Unfortunately, I'm unable to connect to the web server in 2.6.4 and my colleague on a Mac reports the same; --dev-adr= seems to be a necessity.

What was not intuitive to me at all is that when dev_addr is set, my custom site_url is overwritten. I'm not sure it's the right behavior, or at least it should be documented in; I'm going to report an upstream bug.

Copy link

@squidfunk squidfunk commented Feb 22, 2018

Oops, I didn't test it properly myself and the smoke test on Travis did not catch it, as it only builds the documentation. Just released 2.6.5 which reverts the change in the Dockerfile.

Copy link

@borekb borekb commented Feb 22, 2018

Thanks. The upstream issue is mkdocs/mkdocs#1414.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.