diff options
author | Joshua Sooter <jsooter@itstraingle.net> | 2018-01-04 15:10:17 -0700 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-03-23 00:30:54 +0800 |
commit | 4333fbf2e4a6103b24b973304d1952f31ef16eac (patch) | |
tree | 24984b4baa92365398f8daa03e18a2acf920590d /app/controllers/projects/wikis_controller.rb | |
parent | 551b9e109eef575bdcaac62d4629c6ade9c90e1d (diff) | |
download | gitlab-ce-4333fbf2e4a6103b24b973304d1952f31ef16eac.tar.gz |
Added support for custom wiki sidebar using _sidebar.md in the wiki root. If _sidebar.md exists it will be parsed and rendered otherwise the default sidebar file list will display
deleted _sidebar_custom.html.haml and modified _sidebar.html.haml to check for sidebar_page and render it or the default wiki page list. Also removed white space.
fix indent in show.html.haml
restore newline at end of ile
Add a newline at the end of changelogs/custom_wiki_sidebar.yml
Diffstat (limited to 'app/controllers/projects/wikis_controller.rb')
-rw-r--r-- | app/controllers/projects/wikis_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb index c4930d3d18d..f7aa0ed44e8 100644 --- a/app/controllers/projects/wikis_controller.rb +++ b/app/controllers/projects/wikis_controller.rb @@ -107,6 +107,8 @@ class Projects::WikisController < Projects::ApplicationController # Call #wiki to make sure the Wiki Repo is initialized @project_wiki.wiki @sidebar_wiki_entries = WikiPage.group_by_directory(@project_wiki.pages(limit: 15)) + # Optional _sidebar.md page + @sidebar_page = @project_wiki.find_page('_sidebar', params[:version_id]) rescue ProjectWiki::CouldNotCreateWikiError flash[:notice] = "Could not create Wiki Repository at this time. Please try again later." redirect_to project_path(@project) |