Skip to content
Snippets Groups Projects
Unverified Commit 16e3a218 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

github path generated clean

parent 60bde73e
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@ class Communication::Website::Page < ApplicationRecord
# Override from WithGithubFiles
def github_path_generated
"_pages/#{path}/index.html".gsub('///', '/').gsub('//', '/')
"_pages/#{path}/index.html".gsub(/\/+/, '/')
end
def list_of_other_pages
......
......@@ -14,7 +14,7 @@ module WithGithubFiles
end
def github_path_generated
"_#{self.class.name.demodulize.pluralize.underscore}/#{self.id}.md"
"_#{self.class.name.demodulize.pluralize.underscore}/#{self.id}.html"
end
def to_jekyll(github_file)
......
......@@ -21,6 +21,8 @@
# fk_rails_... (university_id => universities.id)
#
class Research::Journal < ApplicationRecord
include WithGithubFiles
belongs_to :university
has_many :websites, class_name: 'Communication::Website', as: :about
has_many :volumes, foreign_key: :research_journal_id
......@@ -32,7 +34,8 @@ class Research::Journal < ApplicationRecord
"#{title}"
end
def github_path
def github_path_generated
# Override from WithGithubFiles
"_data/journal.yml"
end
......
......@@ -56,10 +56,6 @@ class Research::Journal::Article < ApplicationRecord
"#{ title }"
end
def github_path
"_articles/#{id}.html"
end
private
def update_researchers
......
......@@ -46,9 +46,4 @@ class Research::Journal::Volume < ApplicationRecord
def to_s
"##{ number } #{ title }"
end
def github_path
"_volumes/#{id}.html"
end
end
......@@ -37,7 +37,8 @@ class Research::Researcher < ApplicationRecord
"#{ first_name } #{ last_name }"
end
def github_path
def github_path_generated
# Override from WithGithubFiles
"_authors/#{self.id}.md"
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment