Skip to content

Commit

Permalink
List publications on person pages
Browse files Browse the repository at this point in the history
See #445
  • Loading branch information
fsteeg committed Mar 4, 2021
1 parent 384b980 commit 7b97cfa
Show file tree
Hide file tree
Showing 35 changed files with 1,120 additions and 3 deletions.
6 changes: 6 additions & 0 deletions gatsby/lobid/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ module.exports = {
path: `${__dirname}/static/team/`,
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/static/publication/`,
}
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`
],
Expand Down
22 changes: 21 additions & 1 deletion gatsby/lobid/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require("path");
const { createFilePath } = require(`gatsby-source-filesystem`)

exports.createPages = async ({ graphql, actions }) => {
const { createRedirect } = actions
Expand Down Expand Up @@ -48,4 +49,23 @@ exports.createPages = async ({ graphql, actions }) => {
context: { id: member },
});
});
};
};

// Create `fields.jsonFile` fields to link to static publication JSON files
exports.onCreateNode = ({ node, getNode, actions }) => {
const { createNodeField } = actions
if (node.internal.type === "PublicationJson") {

const relativeFilePath = createFilePath({
node,
getNode,
trailingSlash: false,
})

createNodeField({
node,
name: "jsonFile",
value: `/publication${relativeFilePath}.json`,
})
}
}
27 changes: 26 additions & 1 deletion gatsby/lobid/src/components/member.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,34 @@ export class Member extends React.Component {
</table>
</div>
<div className="col-md-3">
<img alt={this.props.member.name.label} id="index-image" src={this.props.member.image || `https://gravatar.com/avatar/${md5(this.props.member.email)}?s=300&d=identicon`}/>
<img alt={this.props.member.name.label} id="index-image" src={this.props.member.image || `https://gravatar.com/avatar/${md5(this.props.member.email)}?s=300&d=identicon`} />
</div>
</div>
{this.props.pubs.length > 0 &&
<div className="row">
<div className="col-md-12">
<p className="lead">{this.props.publications}</p>
<table className="table table-striped table-condensed">
<thead>
<tr><th width="10%" /><th width="70%" /><th width="10%" /><th width="10%" /></tr>
</thead>
<tbody>
{this.props.pubs.map(publication =>
<tr>
<td><small>{publication.datePublished}</small></td>
<td><a href={publication.id}>{publication.name.label || publication.id}</a></td>
<td>{publication.about && publication.about.map(a => <p><a href={a.id}>{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>
</tr>
)}

</tbody>
<tfoot />
</table>
</div>
</div>
}
<Footer companyDetails={this.props.companyDetails} privacy={this.props.privacy} />
</div>
</div>
Expand Down
32 changes: 31 additions & 1 deletion gatsby/lobid/src/templates/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ import { graphql } from "gatsby";
import { Member } from "../components/member.html";

export default function MemberPage({ data, location, pageContext }) {
const member = data.allFile.edges[0].node.childTeamJson
return (<Member
member={data.allFile.edges[0].node.childTeamJson}
member={member}
pubs={data.allPublicationJson.edges
.map(edge => edge.node)
.filter(p => p.creator.find(c => c.id === member.id))
.sort((a, b) => b.datePublished.localeCompare(a.datePublished))
}
contactName="Kontakt"
subtitle="Dateninfrastruktur für Bibliotheken"
publications="Publikationen"
Expand Down Expand Up @@ -38,5 +44,29 @@ export const query = graphql`
}
}
}
allPublicationJson {
edges {
node {
id
type
creator {
id
}
name {
label: de
}
description {
label: de
}
about {
id
}
datePublished
fields {
jsonFile
}
}
}
}
}
`;
36 changes: 36 additions & 0 deletions gatsby/lobid/static/publication/2020-02-oerdindex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"@context": "https://schema.org",
"type": "PresentationDigitalDocument",
"name": {
"de": "OER Search Index"
},
"creator": [
{
"id": "http://lobid.org/team/ap#!",
"type": "Person",
"name": "Adrian Pohl"
}
],
"description": {
"de": "Vortrag am 2020-02-26 in Bochum"
},
"about": [
{
"id": "https://oersi.de"
}
],
"keywords": [
"oer",
"open educational resources",
"resource discovery"
],
"id": "http://slides.lobid.org/2020-02-oerindex/",
"datePublished": "2020-02-26",
"inLanguage": [
"de"
],
"audience": [
"library managers"
],
"license": "https://creativecommons.org/licenses/by/4.0/"
}
38 changes: 38 additions & 0 deletions gatsby/lobid/static/publication/2020-08-oersi-skohub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"@context": "https://schema.org",
"type": "PresentationDigitalDocument",
"name": {
"de": "OERSI & SkoHub"
},
"creator": [
{
"id": "http://lobid.org/team/ap#!",
"type": "Person",
"name": "Adrian Pohl"
}
],
"description": {
"de": "Präsentation am 2020-08-26"
},
"keywords": [
"oer",
"open educational resources",
"resource discovery",
"oersi",
"skohub"
],
"about": [
{
"id": "https://oersi.de"
},
{
"id": "https://skohub.io"
}
],
"id": "http://slides.lobid.org/2020-08-oersi-skohub/",
"datePublished": "2020-08-24",
"inLanguage": [
"de"
],
"license": "https://creativecommons.org/licenses/by/4.0/"
}
51 changes: 51 additions & 0 deletions gatsby/lobid/static/publication/2020-zbiw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"@context": "https://schema.org",
"type": "PresentationDigitalDocument",
"name": {
"de": "Offene Infrastruktur für bibliothekarische Daten: Linked Open Data, JSON & OpenRefine in der Praxis"
},
"creator": [
{
"id": "http://lobid.org/team/ap#!",
"type": "Person",
"name": "Adrian Pohl"
},
{
"id": "http://lobid.org/team/fs#!",
"type": "Person",
"name": "Fabian Steeg"
}
],
"keywords": [
"lobid",
"JSON-LD",
"Linked Open Data",
"libraries"
],
"id": "https://slides.lobid.org/2020-zbiw/",
"about": [
{
"id": "https://lobid.org"
}
],
"datePublished": "2020-10-08",
"inLanguage": [
"de"
],
"audience": [
"librarians",
"developers"
],
"isBasedOn": [
{
"id": "https://slides.lobid.org/htw-chur-2019/"
},
{
"id": "https://slides.lobid.org/beirat2019/"
},
{
"id": "https://slides.lobid.org/dhc-2020/"
}
],
"license": "https://creativecommons.org/licenses/by/4.0/"
}
40 changes: 40 additions & 0 deletions gatsby/lobid/static/publication/bibcast16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"@context": "https://schema.org",
"type": "PresentationDigitalDocument",
"name": {
"de": "lobid-organisations: Ein umfassender Index deutscher Informationseinrichtungen"
},
"creator": [
{
"id": "http://lobid.org/team/ap",
"type": "Person",
"name": "Adrian Pohl"
}
],
"description": {
"de": "Diese Folien wurden zur Präsentation des eines Vortrags am 9.3.2016 innerhalb der BibCast-Reihe verwendet. URL: http://bibcast.openbiblio.eu/lobid-organisations-ein-umfassender-index-deutscher-informationseinrichtungen/"
},
"keywords": [
"lobid",
"libraries",
"organisation index",
"API",
"web development"
],
"about": [
{
"id": "https://lobid.org"
}
],
"id": "https://slides.lobid.org/bibcast16/",
"datePublished": "2016-03-09",
"inLanguage": [
"de"
],
"audience": [
"web developers",
"librarians"
],
"isBasedOn": "http://hbz.github.io/slides/swib-15/",
"license": "https://creativecommons.org/licenses/by/4.0/"
}
25 changes: 25 additions & 0 deletions gatsby/lobid/static/publication/bibframe-dataset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"@context": "https://schema.org",
"type": "BlogPosting",
"name": {
"en": "Indexing the Bibframe works dataset as JSON-LD"
},
"creator": [
{
"id": "http://lobid.org/team/ap#!",
"type": "Person",
"name": "Adrian Pohl"
}
],
"about": [
{
"id": "https://skohub.io"
}
],
"id": "https://blog.lobid.org/2019/01/31/bibframe-dataset.html",
"datePublished": "2019-01-31",
"inLanguage": [
"en"
],
"license": "https://creativecommons.org/licenses/by/4.0/"
}
37 changes: 37 additions & 0 deletions gatsby/lobid/static/publication/bibtag18.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"@context": "https://schema.org",
"type": "PresentationDigitalDocument",
"name": {
"de": "lobid – offene, webbasierte Infrastruktur für zentrale bibliothekarische Daten"
},
"creator": [
{
"id": "http://lobid.org/team/ap",
"type": "Person",
"name": "Adrian Pohl"
}
],
"description": {
"de": "Vortrag beim 107. Bibliothekartag in Berlin, gehalten am 14. Juni 2018"
},
"keywords": [
"lobid",
"libraries",
"gnd"
],
"about": [
{
"id": "https://lobid.org"
}
],
"id": "https://slides.lobid.org/bibtag18/",
"datePublished": "2018-06-14",
"inLanguage": [
"de"
],
"audience": [
"web developers",
"librarians"
],
"license": "https://creativecommons.org/licenses/by/4.0/"
}
25 changes: 25 additions & 0 deletions gatsby/lobid/static/publication/ebook-packages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"@context": "https://schema.org",
"type": "BlogPosting",
"name": {
"de": "Verbesserte Metadaten zur Zugehörigkeit von Titeln zu E-Book-Paketen"
},
"creator": [
{
"id": "http://lobid.org/team/ap#!",
"type": "Person",
"name": "Adrian Pohl"
}
],
"about": [
{
"id": "https://lobid.org"
}
],
"id": "https://blog.lobid.org/2020/04/15/ebook-packages.html",
"datePublished": "2020-04-15",
"inLanguage": [
"de"
],
"license": "https://creativecommons.org/licenses/by/4.0/"
}
Loading

0 comments on commit 7b97cfa

Please sign in to comment.