protected function getPathname(Page $page)
    {
        // force pathname of a file node page (ie: "section/index.md")
        if ($page->getName() == 'index') {
            return $page->getPath().'/'.$this->config->get('output.filename');
        } else {
            // custom extension, ex: 'manifest.json'
            if (!empty(pathinfo($page->getPermalink(), PATHINFO_EXTENSION))) {
                return $page->getPermalink();
            }
            // underscore prefix, ex: '_redirects'
            if (strpos($page->getPermalink(), '_') === 0) {
                return $page->getPermalink();
            }

            return $page->getPermalink().'/'.$this->config->get('output.filename');
        }
    }