diff --git a/docs/contributing.md b/docs/contributing.md deleted file mode 120000 index 44fcc63439..0000000000 --- a/docs/contributing.md +++ /dev/null @@ -1 +0,0 @@ -../CONTRIBUTING.md \ No newline at end of file diff --git a/spec/example_app/app/controllers/docs_controller.rb b/spec/example_app/app/controllers/docs_controller.rb index f551a24fab..bdea74c234 100644 --- a/spec/example_app/app/controllers/docs_controller.rb +++ b/spec/example_app/app/controllers/docs_controller.rb @@ -1,4 +1,11 @@ class DocsController < ApplicationController + SPECIAL_FILES = [ + { + file: 'CONTRIBUTING', + page: 'contributing' + } + ].freeze + REDCARPET_CONFIG = { fenced_code_blocks: true, autolink: true, @@ -9,11 +16,23 @@ def index end def show - render_page "docs/#{params[:page]}" + render_correct_page end private + def find_special_file + SPECIAL_FILES.select { |page| page[:page] == params[:page] }.first + end + + def render_correct_page + if !find_special_file.nil? + render_page(find_special_file[:file]) + else + render_page("docs/#{params[:page]}") + end + end + def render_page(name) path = full_page_path(name)