squidfunk / mkdocs-material

Documentation that simply works
https://squidfunk.github.io/mkdocs-material/
MIT License
20.74k stars 3.52k forks source link

"previous" "next" button produce incorrect url #870

Closed zorgrian closed 6 years ago

zorgrian commented 6 years ago

Description

The buttons at the bottom for previous and next article bow do not work with mkdocs, version 1.0.2

Expected behavior

We expect the generated URL to be collected from the YAML file Nav: list. This was working correctly but now does not

Actual behavior

What actually occurs is a mixup of the current URL and the URL collected from the YAML file Nav: list.

Steps to reproduce the bug

Try this on any YAML setup that was previously working and you will see that it now does not function correctly

Package versions

Project configuration

site_name: YooFab™ - Join The Makerspace Revolution
site_description: Doumentation for YooFab™ kits, guides and information on making electronic projects, working with materials, setting up a workshop and more...

nav:
- HOME: 'index.md'
- SHOP: 'http://www.macrovend.com'
- ABOUT:
    - 'About YooFab': 'about/about.md'
    - 'Contact': 'about/contact.md'
    - 'Disclaimer': 'about/disclaimer.md'
- KITS:
    - 'The YooFab 40 Meter regenerative receiver': 'kits/regenReceiver/regenKitMk7.md'
    - 'The YooFab QRP Headphone amplifier': 'kits/amplifier/headphone.md'
- LEARN:
    - 'Learn with Yoofab': 'learn/learn.md'
    - 'Makerspace workshops': 'learn/workshop.md'
    - ARDUINO:
       - 'List of Arduino types': 'learn/arduino/arduinoTypes.md'
       - 'The Arduino derivatives': 'learn/arduino/arduinoDerivatives.md'
       - 'Arduino code': 'learn/arduino/arduinoCode.md'
       - 'Arduino projects': 'learn/arduino/projects.md'
    - SOLDERING:
        - 'An introduction to soldering': 'learn/soldering/basicSolder.md'
    - ELECTRONICS:
        - 'Introduction to the electronics learn section': 'learn/electronics/introduction.md'
        - 'Basics of electricity and electronics': 'learn/electrics.md'
        - 'Back to Basics Tutorial - Voltage & Current in capacitors & inductors': 'learn/electronics/currentVoltageCL.md'
        - COMPONENTS:
            - 'Resistors': 'learn/electronics/components/resistor.md'
            - 'Capacitors': 'stub.md'
            - 'Does current flow through a capacitor?': 'learn/electronics/components/currentCap.md'
            - 'Inductors': 'stub.md'
        - ANALOGUE:
            - 'Introduction to analogue electronics': 'stub.md'
        - DIGITAL:
            - 'Introduction to digital electronics': 'stub.md'
            - 'Using a ROM to replace combined logic circuits': learn/electronics/digital/usingRomToRplace.md
        - CIRCUIT BLOCKS:
            - 'Introduction to circuit blocks': 'learn/electronics/blocks/introduction.md'
            - ELECTRONIC BLOCKS:
                - 'Introduction to basic electronic knowledge': 'stub.md'
                - 'Detectors (Radio)': 'learn/electronics/blocks/detector.md'
                - VOLTAGE SUPPLY & REGULATION:
                    - 'Introduction to VOLTAGE SUPPLY & REGULATION': 'stub.md'
                - TRANSISTOR AMPLIFIER STAGES:
                    - 'Introduction to TRANSISTOR AMPLIFIER STAGES': 'stub.md'
                - OSCILLATORS:
                    - 'Introduction to OSCILLATORS': 'learn/electronics/blocks/oscillators/oscillators.md'
                - PREAMPLIFIERS:
                    - 'A universal Preamplifier': 'learn/electronics/blocks/amplifiers/universalPreamp.md'
                -  DIFFERENTIAL AMPLIFIERS:
                    - 'What is a differential amplifier?': 'learn/electronics/blocks/diff/diffWhat.md'
                    - 'The long tail pair': 'learn/electronics/blocks/diff/longTail.md'
    - RADIO:
            - 'QRP receiver schematics and notes': 'learn/radio/schematics.md'
            - 'QRP on the web': 'learn/radio/web.md'
            - 'QRP DDS and clock sources': 'learn/radio/ddsClock.md'
            - 'Crystal grinding, adjusting and scribbling': 'learn/radio/grind.md'
            - TRF & CRYSTAL SET RADIOS:
                - "The MK484 - TA4672": 'learn/radio/TRF/MK484.md'
- OFF-TOPIC:
    - KNOWLEDGE & POWER:
        - 'The evolution of knowledge': 'off-topic/ThenextStep.md'
markdown_extensions:
  - admonition
  - meta
  - footnotes
  - pymdownx.arithmatex
  - pymdownx.betterem:
      smart_enable: all
  - pymdownx.caret
  - pymdownx.critic
  - pymdownx.details
  - pymdownx.emoji:
      emoji_generator: !!python/name:pymdownx.emoji.to_png
  - pymdownx.inlinehilite
  - pymdownx.magiclink
  - pymdownx.mark
  - pymdownx.smartsymbols
  - pymdownx.superfences
  - pymdownx.tasklist:
      custom_checkbox: true
  - pymdownx.tilde
  - pymdownx.snippets
theme:
  name: 'material'
  custom_dir: 'theme'
  palette:
    primary: 'Blue Grey'
  logo: 'images/logo.svg'
  favicon: 'images/favicon.ico'

System information

zorgrian commented 6 years ago

OS: Manjaro linux but also UBUNTU and any linux Browser ----> any

squidfunk commented 6 years ago

Did you override the footer.html partial? From your theme configuration I can see that you include custom_dir: theme which indicates that you overrode partials. If so, please check the original footer.html partial and make any adjustments that were made for MkDocs 1.0 compatibility.

zorgrian commented 6 years ago

Yes I did override the footer.html partial

Thanks for your reply

  1. I will check this now
  2. Then make any sensible adjustments
  3. Post results

Thanks --- Zorgrian

zorgrian commented 6 years ago

Removed the override

As I really just wanted to add a copyright string, I realised that the modded footer.html partial was not needed and indeed is an impediment as it will add unnecessary complexity/ versioning issues. Instead I have now used the preferred copyright method.

Thanks --- Zorgrian

climbonbelay commented 6 years ago

Could this be re-opened? Overriding the footer will do this even without modifying anything in the footer. It's something to do with the relative path, as if it's adding the new url to the current one on instead of replacing it.

URL should be http://127.0.0.1:8000/topicA/page2 but ends up as http://127.0.0.1:8000/topicA/page1/topicA/page2/

I get a similar issue in the nav if I copy the base.html to a new local template with no modifications and point a page to it using YML metadata. There, it adds a duplicate link for the active page and url for the duplicate follows the same pattern. I figured out a workaround for that issue by hiding label.md-nav__link--active in a style sheet.

I'm running theme v3.0.3 & mkdocs v1.0.2

squidfunk commented 6 years ago

Is this really a theme issue or related to MkDocs? Could you try and check if this also happens with the default MkDocs theme? If it doesn't, please create a new issue with everything that is needed to reproduce it.

climbonbelay commented 6 years ago

After I posted this, I started investigating just that. Go ahead and close this back up and I'll open a new issue if needed.