Drassil / git-wiki-theme

A revolutionary full-featured wiki for github pages and jekyll. You don't need to compile it!
http://drassil.github.io/git-wiki/
MIT License
212 stars 293 forks source link

GitHub links like `Add new` should work for `wiki_folder=""` #85

Closed 2shea closed 3 years ago

2shea commented 4 years ago

Describe the bug If wiki_folder is an empty string, the GitHub links are broken because they assume that the wiki pages will always go into a folder (i.e. wiki_folder is never "").

I'm building a wiki where the whole site is a wiki. I don't necessarily need pages to be in a folder - I'd like to put them in the root directory. (Alternatively, I wanted to put them in a directory, but I couldn't find a way to not have that folder as part of the url path for the pages, and I don't want my users to need that extra bit in the url. Permalink doesn't seem to affect the entire url path.)

It would be great if the code in _includes/git-wiki/components/action_btn/page_actions.html would also work for the wiki folder being the root directory:

    <span class="tools-element"><a target="_blank" href="{{ site.github.repository_url }}/new/{{site.git_branch | escape}}?filename={{ site.site_root | default: '/' }}{{ site.wiki_folder }}/">Add new</a></span>

To reproduce Steps to reproduce the behavior:

  1. Set wiki_folder to empty string
  2. Click on Add new
  3. Try adding a new page
  4. See error: image

Expected behavior Adding a new file via the Add new link with the wiki_folder set to the home directory (i.e. wiki_folder="") should successfully add a new file to the root of the project.

Desktop (please complete the following information):

Yehonal commented 4 years ago

Hello! thank you for using git-wiki ;)

As you can see it's already like this:

?filename={{ site.site_root | default: '/' }}{{ site.wiki_folder }}/

the filename will be the site_root or "/", then if you don't have the wiki_folder config, then the root folder will be used.

Can you link that wiki so I can help you to find out the issue?