BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6c0473ef
Commit
6c0473ef
authored
Sep 21, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hide-frontmatter-help-page' into 'master'
Do not show YAML frontmatter for doc pages under /help See merge request gitlab-org/gitlab-ce!14345
parents
3ce36140
52ddf8e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
help_controller.rb
app/controllers/help_controller.rb
+8
-2
No files found.
app/controllers/help_controller.rb
View file @
6c0473ef
...
...
@@ -3,8 +3,13 @@ class HelpController < ApplicationController
layout
'help'
# Taken from Jekyll
# https://github.com/jekyll/jekyll/blob/3.5-stable/lib/jekyll/document.rb#L13
YAML_FRONT_MATTER_REGEXP
=
%r!
\A
(---
\s
*
\n
.*?
\n
?)^((---|
\.\.\.
)
\s
*$
\n
?)!m
def
index
@help_index
=
File
.
read
(
Rails
.
root
.
join
(
'doc'
,
'README.md'
))
# Remove YAML frontmatter so that it doesn't look weird
@help_index
=
File
.
read
(
Rails
.
root
.
join
(
'doc'
,
'README.md'
)).
sub
(
YAML_FRONT_MATTER_REGEXP
,
''
)
# Prefix Markdown links with `help/` unless they are external links
# See http://rubular.com/r/X3baHTbPO2
...
...
@@ -22,7 +27,8 @@ class HelpController < ApplicationController
path
=
File
.
join
(
Rails
.
root
,
'doc'
,
"
#{
@path
}
.md"
)
if
File
.
exist?
(
path
)
@markdown
=
File
.
read
(
path
)
# Remove YAML frontmatter so that it doesn't look weird
@markdown
=
File
.
read
(
path
).
gsub
(
YAML_FRONT_MATTER_REGEXP
,
''
)
render
'show.html.haml'
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment