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 ...@@ -76,7 +76,7 @@ class Communication::Website::Page < ApplicationRecord
# Override from WithGithubFiles # Override from WithGithubFiles
def github_path_generated def github_path_generated
"_pages/#{path}/index.html".gsub('///', '/').gsub('//', '/') "_pages/#{path}/index.html".gsub(/\/+/, '/')
end end
def list_of_other_pages def list_of_other_pages
......
...@@ -14,7 +14,7 @@ module WithGithubFiles ...@@ -14,7 +14,7 @@ module WithGithubFiles
end end
def github_path_generated def github_path_generated
"_#{self.class.name.demodulize.pluralize.underscore}/#{self.id}.md" "_#{self.class.name.demodulize.pluralize.underscore}/#{self.id}.html"
end end
def to_jekyll(github_file) def to_jekyll(github_file)
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
# fk_rails_... (university_id => universities.id) # fk_rails_... (university_id => universities.id)
# #
class Research::Journal < ApplicationRecord class Research::Journal < ApplicationRecord
include WithGithubFiles
belongs_to :university belongs_to :university
has_many :websites, class_name: 'Communication::Website', as: :about has_many :websites, class_name: 'Communication::Website', as: :about
has_many :volumes, foreign_key: :research_journal_id has_many :volumes, foreign_key: :research_journal_id
...@@ -32,7 +34,8 @@ class Research::Journal < ApplicationRecord ...@@ -32,7 +34,8 @@ class Research::Journal < ApplicationRecord
"#{title}" "#{title}"
end end
def github_path def github_path_generated
# Override from WithGithubFiles
"_data/journal.yml" "_data/journal.yml"
end end
......
...@@ -56,10 +56,6 @@ class Research::Journal::Article < ApplicationRecord ...@@ -56,10 +56,6 @@ class Research::Journal::Article < ApplicationRecord
"#{ title }" "#{ title }"
end end
def github_path
"_articles/#{id}.html"
end
private private
def update_researchers def update_researchers
......
...@@ -46,9 +46,4 @@ class Research::Journal::Volume < ApplicationRecord ...@@ -46,9 +46,4 @@ class Research::Journal::Volume < ApplicationRecord
def to_s def to_s
"##{ number } #{ title }" "##{ number } #{ title }"
end end
def github_path
"_volumes/#{id}.html"
end
end end
...@@ -37,7 +37,8 @@ class Research::Researcher < ApplicationRecord ...@@ -37,7 +37,8 @@ class Research::Researcher < ApplicationRecord
"#{ first_name } #{ last_name }" "#{ first_name } #{ last_name }"
end end
def github_path def github_path_generated
# Override from WithGithubFiles
"_authors/#{self.id}.md" "_authors/#{self.id}.md"
end end
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