dauxio / daux.io

Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.
https://daux.io/
MIT License
794 stars 196 forks source link

Having only a single page fails with a confusing error #290

Closed onigoetz closed 2 years ago

onigoetz commented 2 years ago

Describe the bug When there is only one markdown file, the rendering of the homepage can't find the link to the "first page" It should either fail with an error message that two pages are needed or hide the button when it's not needed

To Reproduce Steps to reproduce the behavior:

  1. Create a docs folder with only index.md
  2. Run daux generate
    Fatal error: Uncaught Error: Call to a member function getUrl() on null in /daux/libs/Format/HTML/ContentPage.php:82
    Stack trace:
    #0 /daux/libs/Format/Base/SimplePage.php(20): Todaymade\Daux\Format\HTML\ContentPage->generatePage()
    #1 /daux/libs/Format/HTML/Generator.php(179): Todaymade\Daux\Format\Base\SimplePage->getContent()
    #2 /daux/libs/Console/RunAction.php(26): Todaymade\Daux\Format\HTML\Generator->Todaymade\Daux\Format\HTML\{closure}(Object(Closure))
    #3 /daux/libs/Format/HTML/Generator.php(188): Todaymade\Daux\Format\HTML\Generator->runAction('- index.html', 80, Object(Closure))

Expected behavior

Generates the documentation for that page

Desktop (please complete the following information): irrelevant

Smartphone (please complete the following information): irrelevant

Additional context Add any other context about the problem here.

onigoetz commented 2 years ago

Released in version 0.18.0