Skip to content

Commit

Permalink
Link from publications to actual products/projects (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Jul 15, 2021
1 parent 852947e commit 31532f4
Show file tree
Hide file tree
Showing 36 changed files with 46 additions and 40 deletions.
4 changes: 4 additions & 0 deletions gatsby/lobid/src/components/helpers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export function simpleId(url) {
return url.slice(url.lastIndexOf("/") + 1);
}

export function stripLobidOrg(url) {
return url.replace(/https?:\/\/lobid.org\//, '/');
}
4 changes: 2 additions & 2 deletions gatsby/lobid/src/components/product.html.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import md5 from 'md5';
import { simpleId } from './helpers.js'
import md5 from "md5";
import { simpleId } from "./helpers.js";

import Header from "./header.html";
import Footer from "./footer.html";
Expand Down
4 changes: 2 additions & 2 deletions gatsby/lobid/src/components/project.html.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import md5 from 'md5';
import { simpleId } from './helpers.js'
import md5 from "md5";
import { simpleId } from "./helpers.js";

import Header from "./header.html";
import Footer from "./footer.html";
Expand Down
4 changes: 2 additions & 2 deletions gatsby/lobid/src/components/publications.html.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"

import { simpleId, stripLobidOrg } from "./helpers.js";
import jsonLdPng from "./images/json-ld.png";

export default class Publications extends React.Component {
Expand All @@ -19,7 +19,7 @@ export default class Publications extends React.Component {
<td><small>{publication.datePublished}</small></td>
<td><a target="_blank" rel="noopener noreferrer" href={publication.id}>{publication.name.de || publication.name.en || publication.id}</a></td>
<td>{publication.about && publication.about.map(a =>
<p key={a.id}><small><span className="glyphicon glyphicon-tag" aria-hidden="true"></span></small>&nbsp;<a href={a.id}>{a.id.slice(a.id.lastIndexOf("/")+1, a.id.lastIndexOf("."))}</a></p>
<p key={a.id}><small><span className="glyphicon glyphicon-tag" aria-hidden="true"></span></small>&nbsp;<a href={stripLobidOrg(a.id)}>{simpleId(a.id)}</a></p>
)}</td>
<td align="right"><small><a href={"https://schema.org/" + publication.type}>{publication.type}</a></small></td>
<td><a title="Beschreibung als JSON-LD anzeigen" href={publication.fields.jsonFile}><img height="20px" src={jsonLdPng} alt="JSON-LD" /></a></td>
Expand Down
3 changes: 2 additions & 1 deletion gatsby/lobid/src/templates/product.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from "react";
import { graphql } from "gatsby";
import { Product } from "../components/product.html";
import { simpleId } from '../components/helpers.js'

export default function ProductPage({ data, location, pageContext }) {
const product = data.allFile.edges.slice(-1).pop().node.childProductJson
return (<Product
product={product}
pubs={data.allPublicationJson.edges
.map(edge => edge.node)
.filter(p => p.about && p.about.find(a => a.id.includes(pageContext.id)))
.filter(p => p.about && p.about.find(a => simpleId(a.id) === pageContext.id))
.sort((a, b) => b.datePublished.localeCompare(a.datePublished))
}
contactName="Kontakt"
Expand Down
3 changes: 2 additions & 1 deletion gatsby/lobid/src/templates/project.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from "react";
import { graphql } from "gatsby";
import { Project } from "../components/project.html";
import { simpleId } from '../components/helpers.js'

export default function ProjectPage({ data, location, pageContext }) {
const project = data.allFile.edges.slice(-1).pop().node.childProjectJson
return (<Project
project={project}
pubs={data.allPublicationJson.edges
.map(edge => edge.node)
.filter(p => p.about && p.about.find(a => a.id.includes(pageContext.id)))
.filter(p => p.about && p.about.find(a => simpleId(a.id) === pageContext.id))
.sort((a, b) => b.datePublished.localeCompare(a.datePublished))
}
contactName="Kontakt"
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/2020-02-oerdindex.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"about": [
{
"id": "https://oersi.de"
"id": "https://lobid.org/project/oersi"
}
],
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions gatsby/lobid/static/publication/2020-08-oersi-skohub.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
],
"about": [
{
"id": "https://oersi.de"
"id": "https://lobid.org/project/oersi"
},
{
"id": "https://skohub.io"
"id": "https://lobid.org/product/skohub"
}
],
"id": "http://slides.lobid.org/2020-08-oersi-skohub/",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/2020-zbiw.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"id": "https://slides.lobid.org/2020-zbiw/",
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"datePublished": "2020-10-08",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/bibcast16.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://slides.lobid.org/bibcast16/",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/bibframe-dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"about": [
{
"id": "https://skohub.io"
"id": "https://lobid.org/product/skohub"
}
],
"id": "https://blog.lobid.org/2019/01/31/bibframe-dataset.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/bibtag18.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://slides.lobid.org/bibtag18/",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/ebook-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://blog.lobid.org/2020/04/15/ebook-packages.html",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://blog.lobid.org/2020/04/27/gemeinfreie-titel-finden.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/gndcon18.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://slides.lobid.org/gndcon18",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/htw-chur-2019.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://slides.lobid.org/htw-chur-2019/",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/infoprax-2018.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://doi.org/10.11588/ip.2018.1.52445",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/infoprax-2019.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://doi.org/10.11588/ip.2019.1.52673",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/libreas2016.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"about": [
{
"id": "https://nwbib.de"
"id": "https://lobid.org/product/nwbib"
}
],
"id": "https://libreas.eu/ausgabe29/04pohl/",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/lobid-at-htw.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"about": [
{
"id": "https://nwbib.de"
"id": "https://lobid.org/product/nwbib"
}
],
"id": "https://blog.lobid.org/2019/04/04/lobid-at-htw.html",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://slides.lobid.org/lobid-entwicklungsprozess/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://blog.lobid.org/2019/11/29/lobid-gnd-https-change.html",
Expand Down
4 changes: 2 additions & 2 deletions gatsby/lobid/static/publication/metafacture-2020.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"@context": "https://schema.org",
"type": "PresentationDigitalDocument",
"name": {
"en": "MetIntroduction to Metafactureafacture"
"en": "Introduction to Metafacture"
},
"creator": [
{
Expand All @@ -17,7 +17,7 @@
],
"about": [
{
"id": "https://metafacture.org"
"id": "https://lobid.org/product/metafacture"
}
],
"id": "https://slides.lobid.org/metafacture-2020/",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/nrw-quiz-idee.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"about": [
{
"id": "https://nwbib.de"
"id": "https://lobid.org/product/nwbib"
}
],
"id": "https://blog.lobid.org/2019/10/22/nrw-quiz-idee.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/nwbib-at-cdv.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
"about": [
{
"id": "https://nwbib.de"
"id": "https://lobid.org/product/nwbib"
}
],
"id": "https://blog.lobid.org/2019/10/08/nwbib-at-cdv.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/nwbib-wikidatacon.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"about": [
{
"id": "https://nwbib.de"
"id": "https://lobid.org/product/nwbib"
}
],
"id": "http://slides.lobid.org/nwbib-wikidatacon/",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/open-api-lookup.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://blog.lobid.org/2019/07/19/open-api-lookup.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/openrefine-examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://blog.lobid.org/2019/09/30/openrefine-examples.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/openrefine.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"about": [
{
"id": "https://lobid.org"
"id": "https://lobid.org/product/lobid"
}
],
"id": "https://blog.lobid.org/2019/08/19/openrefine.html",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"about": [
{
"id": "https://skohub.io"
"id": "https://lobid.org/product/skohub"
}
],
"id": "https://blog.lobid.org/2019/09/27/presenting-skohub-vocabs.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/skohub-apconf.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"about": [
{
"id": "https://skohub.io"
"id": "https://lobid.org/product/skohub"
}
],
"id": "https://blog.lobid.org/2020/10/09/skohub-apconf.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/skohub-editor.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"about": [
{
"id": "https://skohub.io"
"id": "https://lobid.org/product/skohub"
}
],
"id": "https://blog.lobid.org/2020/03/31/skohub-editor.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/skohub-ffm.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
"about": [
{
"id": "https://skohub.io"
"id": "https://lobid.org/product/skohub"
}
],
"id": "https://slides.lobid.org/skohub-ffm/",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/skohub-pubsub.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"about": [
{
"id": "https://skohub.io"
"id": "https://lobid.org/product/skohub"
}
],
"id": "https://blog.lobid.org/2020/06/25/skohub-pubsub.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/skohub-talk-at-swib19.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"about": [
{
"id": "https://skohub.io"
"id": "https://lobid.org/product/skohub"
}
],
"id": "https://blog.lobid.org/2020/01/29/skohub-talk-at-swib19.html",
Expand Down
2 changes: 1 addition & 1 deletion gatsby/lobid/static/publication/skohub.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"about": [
{
"id": "https://skohub.io"
"id": "https://lobid.org/product/skohub"
}
],
"id": "https://blog.lobid.org/2019/05/17/skohub.html",
Expand Down

0 comments on commit 31532f4

Please sign in to comment.