-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #343 by adding google scholar compliant meta tags to HTML for ETDs only, and replacing sitemap with new sitemap that only includes ETDs (for now)
- Loading branch information
Showing
17 changed files
with
160 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ class GwWork < ActiveFedora::Base | |
end | ||
|
||
include ::Hyrax::BasicMetadata | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%= render 'shared/twitter_citations' %> | ||
<%= render 'shared/schoolie_citations' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% content_for(:schoolie_meta) do %> | ||
<% if @presenter.scholarly? %> | ||
<%schoolie_tags(@presenter).html_safe%> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<% content_for(:twitter_meta) do %> | ||
<meta name="twitter:card" content="product" /> | ||
<meta name="twitter:site" content="<%= t('hyrax.product_twitter_handle') %>" /> | ||
<meta name="twitter:creator" content="<%= @presenter.tweeter %>" /> | ||
<meta property="og:site_name" content="<%= application_name %>" /> | ||
<meta property="og:type" content="object" /> | ||
<meta property="og:title" content="<%= @presenter.title.first %>" /> | ||
<meta property="og:description" content="<%= @presenter.description.first.truncate(200) rescue @presenter.title.first %>" /> | ||
<meta property="og:image" content="<%= @presenter.download_url %>" /> | ||
<meta property="og:url" content="<%= polymorphic_url([main_app, @presenter]) %>" /> | ||
<meta name="twitter:data1" content="<%= @presenter.keyword.join(', ') %>" /> | ||
<meta name="twitter:label1" content="Keywords" /> | ||
<meta name="twitter:data2" content="<%= @presenter.rights_statement.first %>" /> | ||
<meta name="twitter:label2" content="Rights Statement" /> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Master's Thesis: | ||
- M.A. | ||
- M.S. | ||
- M.P.H. | ||
- LL.M. | ||
- M.F.A. | ||
- M.A.T. | ||
- M.P.S. | ||
- M.B.A. | ||
- M.F.S. | ||
- M.Int.St. | ||
- M.P.H. | ||
- M.P.P. | ||
Dissertation: | ||
- Ph.D. | ||
- Ed.D. | ||
- D.Engr. | ||
- Dr.P.H. | ||
- D.Sc. | ||
- S.J.D. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
static: | ||
citation_institution: George Washington University | ||
attributes: | ||
citation_title: title | ||
citation_author: creator | ||
citation_type: resource_type | ||
dc.type: resource_type | ||
citation_date: publication_date | ||
citation_keywords: keyword | ||
citation_pdf_url: download_url |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'json' | ||
require 'nokogiri' | ||
|
||
namespace :schoolie do | ||
desc "Creates Google Scholar compliant sitemap for GwEtd works" | ||
task sitemap: :environment do | ||
date_field = 'system_modified_dtsi' | ||
result = Hyrax::SolrService.new.get("has_model_ssim:GwEtd", | ||
fl: "id,#{date_field}", | ||
rows: 1_000_000) | ||
ids = result['response']['docs'].map do |x| | ||
["https://scholarspace.library.gwu.edu/etd/#{x['id'].to_s}", x[date_field].to_s] | ||
end | ||
builder = Nokogiri::XML::Builder.new do |sitemap| | ||
sitemap.urlset("xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", | ||
xmlns: "http://www.sitemaps.org/schemas/sitemap/0.9", | ||
"xsi:schemaLocation": "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd") { | ||
ids.each { |url, date| | ||
sitemap.url { | ||
sitemap.loc url | ||
sitemap.lastmod date | ||
} | ||
} | ||
} | ||
end | ||
File.open(Rails.root.join("public", "sitemap.xml"), "w") { |f| f.write(builder.to_xml) } | ||
end | ||
end |