Skip to content
Snippets Groups Projects
Commit d4be86c2 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

fix paper and volume path

parent da315dc7
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ class Research::Journal::Paper < ApplicationRecord
scope :ordered, -> { order(published_at: :desc, created_at: :desc) }
def git_path(website)
"#{git_path_content_prefix(website)}papers/#{published_at.year}/#{published_at.strftime "%Y-%m-%d"}-#{slug}.html" if (volume.nil? || volume.published_at) && published_at
"#{git_path_content_prefix(website)}papers/#{published_at.year}#{path}.html" if published_at
end
def template_static
......@@ -89,7 +89,7 @@ class Research::Journal::Paper < ApplicationRecord
end
def path
"/#{slug}"
"/#{published_at.strftime "%Y-%m-%d"}-#{slug}" if published_at
end
protected
......
......@@ -54,7 +54,7 @@ class Research::Journal::Volume < ApplicationRecord
end
def git_path(website)
"#{git_path_content_prefix(website)}volumes/#{published_at.year}/#{slug}/_index.html" if published_at
"#{git_path_content_prefix(website)}volumes/#{published_at.year}#{path}/_index.html" if published_at
end
def template_static
......@@ -77,7 +77,7 @@ class Research::Journal::Volume < ApplicationRecord
end
def path
"/#{published_at&.year}/#{slug}" if published_at
"/#{published_at&.year}-#{slug}" if published_at
end
def to_s
......
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