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.

Home Page:https://daux.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Having only a single page fails with a confusing error

onigoetz opened this issue · comments

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.

Released in version 0.18.0