Commit 4333fbf2 authored by Joshua Sooter's avatar Joshua Sooter Committed by Lin Jen-Shin

Added support for custom wiki sidebar using _sidebar.md in the wiki root. If...

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
parent 551b9e10
......@@ -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)
......
......@@ -11,11 +11,14 @@
.blocks-container
.block.block-first
%ul.wiki-pages
= render @sidebar_wiki_entries, context: 'sidebar'
- if @sidebar_page
= render_wiki_content(@sidebar_page)
- else
%ul.wiki-pages
= render @sidebar_wiki_entries, context: 'sidebar'
.block
= link_to project_wikis_pages_path(@project), class: 'btn btn-block' do
= s_("Wiki|More Pages")
.block
= link_to project_wikis_pages_path(@project), class: 'btn btn-block' do
= s_("Wiki|More Pages")
= render 'projects/wikis/new'
---
title: "Custom Wiki Sidebar Support Issue 14995"
merge_request:
author: Josh Sooter
type: added
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment