diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /lib/gitlab/static_site_editor/config.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'lib/gitlab/static_site_editor/config.rb')
-rw-r--r-- | lib/gitlab/static_site_editor/config.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/static_site_editor/config.rb b/lib/gitlab/static_site_editor/config.rb index 65c567ec2a6..08ed6599a6e 100644 --- a/lib/gitlab/static_site_editor/config.rb +++ b/lib/gitlab/static_site_editor/config.rb @@ -3,7 +3,7 @@ module Gitlab module StaticSiteEditor class Config - SUPPORTED_EXTENSIONS = %w[.md].freeze + SUPPORTED_EXTENSIONS = %w[.md .md.erb].freeze def initialize(repository, ref, file_path, return_url) @repository = repository @@ -20,7 +20,7 @@ module Gitlab commit_id: commit_id, project_id: project.id, project: project.path, - namespace: project.namespace.path, + namespace: project.namespace.full_path, return_url: sanitize_url(return_url), is_supported_content: supported_content?.to_s, base_url: Gitlab::Routing.url_helpers.project_show_sse_path(project, full_path) @@ -42,11 +42,11 @@ module Gitlab end def extension_supported? - File.extname(file_path).in?(SUPPORTED_EXTENSIONS) + SUPPORTED_EXTENSIONS.any? { |ext| file_path.end_with?(ext) } end def file_exists? - commit_id.present? && repository.blob_at(commit_id, file_path).present? + commit_id.present? && !repository.blob_at(commit_id, file_path).nil? end def full_path |