diff --git a/app/models/research/journal/article.rb b/app/models/research/journal/article.rb index 57373a9bb2be3f86faf1b96b4cfbcc53d131bc50..e4c27aa309013f9424b4695c1a82ef3f70f9678d 100644 --- a/app/models/research/journal/article.rb +++ b/app/models/research/journal/article.rb @@ -51,10 +51,6 @@ class Research::Journal::Article < ApplicationRecord scope :ordered, -> { order(:published_at, :created_at) } - def pdf_path - "/assets/articles/#{id}/#{pdf.filename}" - end - def git_path(website) "content/articles/#{published_at.year}/#{published_at.strftime "%Y-%m-%d"}-#{slug}.html" if published_at end diff --git a/app/models/research/journal/volume.rb b/app/models/research/journal/volume.rb index f8280422f40294e55e6ecb466d7634ad688e7995..6724c4399cb70268ffb6426dabe9593ba5e51e79 100644 --- a/app/models/research/journal/volume.rb +++ b/app/models/research/journal/volume.rb @@ -55,6 +55,10 @@ class Research::Journal::Volume < ApplicationRecord [self] + active_storage_blobs end + def path + "#{published_at&.year}/#{slug}" if published_at + end + def to_s "##{ number } #{ title }" end diff --git a/app/views/admin/research/journal/articles/static.html.erb b/app/views/admin/research/journal/articles/static.html.erb index a096e62f3c28f29615be347bb2e0041f796762d9..1f6f1684491ab620bc46b8280feb7b6a2788e20d 100644 --- a/app/views/admin/research/journal/articles/static.html.erb +++ b/app/views/admin/research/journal/articles/static.html.erb @@ -1,10 +1,15 @@ --- title: "<%= @article.title %>" -description: "<%= @article.abstract %>" -volume: "<%= @article.volume.id %>" -publication: "<%= @article.published_at %>" -pdf: "<%= @article.pdf_path %>/" -keywords: "<%= @article.keywords %>" +description: > + <%= @article.abstract %> +<% if @article.volume && @article.volume.path %> +volumes: + - "<%= @article.volume.path %>" +<% end %> +weight: 1 +date: <%= @article.published_at %> UTC +keywords: > + <%= @article.keywords %> researchers: <% @article.researchers.each do |researcher| %> - "<%= researcher.id %>" diff --git a/app/views/admin/research/journal/volumes/static.html.erb b/app/views/admin/research/journal/volumes/static.html.erb index 11d064ae24fa68a5a25e8b68e851d8bedc6ed3f2..8839171b488846642de95b2c5d25a0ec2667e607 100644 --- a/app/views/admin/research/journal/volumes/static.html.erb +++ b/app/views/admin/research/journal/volumes/static.html.erb @@ -1,16 +1,14 @@ --- title: "<%= @volume.title %>" +slug: "<%= @volume.slug %>" number: <%= @volume.number %> issn: "<%= @volume.journal.issn %>" -keywords: "<%= @volume.keywords %>" -date: "<%= @volume.published_at %>" +keywords: > + <%= @volume.keywords %> +date: <%= @volume.published_at %> UTC <% if @volume.featured_image.attached? %> image: "<%= @volume.featured_image.blob.id %>" image_alt: "<%= @volume.featured_image_alt %>" <% end %> -articles: -<% @volume.articles.each do |article| %> -- <%= article.path %> -<% end %> --- <%= @volume.description %>