Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Community Directory WIP #1551

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"contentDir": "content",
"collections": {
"BareArticle": { "path": "/bare/", "type": "vue" },
"Platform": { "path": "/use/", "type": "md" }
"Platform": { "path": "/use/", "type": "md" },
"Person": { "path": "/people/", "type": "md" }
},
"categories": {
"/blog": "blog",
Expand Down
4 changes: 3 additions & 1 deletion content/0examples/non-vue/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ date: 2021-04-25
days: 1
continent: EU
contact: Strong Mad
contact_url: https://example.com
contacts:
- id: strong-mad
name: Strong Mad
authors: Marzipan
location: Strong Badia
location_url: https://www.youtube.com/watch?v=hfUqRp4E0L8&t=37s
Expand Down
6 changes: 5 additions & 1 deletion content/0examples/vue-remark/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ date: 2021-04-25
days: 2
continent: EU
contact: people
contact_url: https://example.com
contacts:
- id: jose
name: Jose
- id: me
name: Me
authors: Jose and me
location: Strong Badia
location_url: 'https://www.youtube.com/watch?v=hfUqRp4E0L8&t=37s'
Expand Down
5 changes: 3 additions & 2 deletions content/events/2019-04-bioit/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ location_url: "http://www.giiconference.com/chi653337/"
external_url:
image: /events/2019-04-bioit/bioitworld19.png
gtn: false
contact: "Presenters"
contact_url: "/people/jeremy-goecks/"
contacts:
- id: jeremy-goecks
name: Presenters
tags: [ cofest ]
subsites: [global, us]
---
Expand Down
5 changes: 4 additions & 1 deletion content/events/2022-10-27-community-call/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ location: "Galaxy Community Call, Online, Global"
location_url: "/community/community-calls/"
external_url:
gtn: false
contact: "Helena Rasche & Saskia Hiltemann"
contacts:
- id: helena-rasche
name: Helena Rasche
- name: Saskia Hiltemann
links:
tags: ["community-call"]
subsites: [all]
Expand Down
12 changes: 12 additions & 0 deletions content/groups/wg-goats/main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: GOATS Working Group
---

Coordinate and guide Galaxy's Outreach & Training efforts, as well as user, admin, and developer support and documentation. Galaxy Outreach And Training (And) Support = GOATS!

* [GitHub Project](https://github.com/orgs/galaxyproject/projects/15)
* [Google Drive](https://drive.google.com/drive/folders/1KIircdXhvS7-00XZy1uIs6Dmja29yjAW)
* [Gitter Channel](https://gitter.im/galaxyproject/wg-goat)
* [Support Charter and Priorities](https://docs.google.com/document/d/1YsTnGUAbh1g3z2WSmR7TKGhSPUTWCsQrz5hcCgbsTKY/edit#heading=h.9cp679lig0rf)
* Leadership: [Delphine Lariviere](/people/delphine-lariviere/)

31 changes: 31 additions & 0 deletions content/people/0example/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Strong Bad
subsites: ["eu"]
main_subsite: "eu"
groups: [wg-goats, iuc]
email: sbad@homestarrunner.com
phone: (808) 867-5309
website: homestarrunner.com
github: sbad
orcid: 0000-0002-1825-0097
gitter: sbad
matrix: sbad
linkedin: strongbad
twitter: StrongBadActual
google-scholar: q5GpTJYAAAJZ
researchgate: Strong_Bad
galaxy_help: sbad
affiliations:
- id: cgnu
name: Crazy Go Nuts University
- id: psu
name: Penn State University
location:
city: The Stick
country: Strong Badia
geo:
lat: '0.0'
lon: '0.0'
image:
draft: true
---
Binary file added content/people/assunta/adesanto_book_resize.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions content/people/assunta/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Assunta DeSanto
subsites: [us]
groups: [wg-goats]
github: assuntad23
image: adesanto_book_resize.png
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use an alt-text here for folks to self-describe their image.

affiliations:
- id: psu
name: Penn State University
ama: Crafting, Coding, or Education!
---
Hello! My name is Assunta DeSanto, and I'm (primarily) a developer for Galaxy's UI.

I'm **really** cool!
4 changes: 4 additions & 0 deletions content/people/helena-rasche/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
name: Helena Rasche
---

# Helena Rasche

- Galaxy Committer
Expand Down
25 changes: 25 additions & 0 deletions gridsome.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,23 @@ module.exports = function (api) {
});

// Populate the derived fields.
let directoryData = { groups: new Set(), orgs: new Set() };
api.onCreateNode((node, collection) => {
let typeName = node.internal.typeName;
node.filename = node.fileInfo.name;
// Collect the set of metadata values that exist in the Community Directory
if (typeName === "Person") {
if (node.affiliations) {
node.affiliations.forEach((org) => {
directoryData.orgs.add(org.id);
});
}
if (node.groups) {
node.groups.forEach((group) => {
directoryData.groups.add(group);
});
}
}
return nodeModifier.processNewNode(node, collection, typeName);
});

Expand Down Expand Up @@ -366,6 +380,17 @@ module.exports = function (api) {
});
}
}
// Community Directory autogenerated aggregated pages
for (let group of directoryData.groups) {
createPage({
path: `/groups/${group}`,
component: "./src/components/pages/Group.vue",
context: {
group: group,
mainPath: `/insert:/groups/${group}/main/`,
},
});
}
});

// Workaround for lack of access to GraphQL in `afterBuild()` hook.
Expand Down
11 changes: 9 additions & 2 deletions src/components/ArticleHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@
</li>
<li v-if="article.contact">
<span class="metakey">Contact: </span>
<a v-if="article.contact_url" :href="article.contact_url">{{ article.contact }}</a>
<template v-else>{{ article.contact }}</template>
{{ article.contact }}
</li>
<li v-else-if="article.contacts">
<span class="metakey">Contact: </span>
<template v-for="(contact, index) in article.contacts">
<template v-if="index > 0">, </template>
<a v-if="contact.id" :href="`/people/${contact.id}/`" :key="contact.id">{{ contact.name }}</a>
<span v-else :key="index">{{ contact.name }}</span>
</template>
</li>
<li v-if="article.links.length > 0">
<span class="metakey">Links: </span>
Expand Down
5 changes: 5 additions & 0 deletions src/components/ArticleTableEvents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
title="Training offered by GTN Member"
/>
</a>
<span v-for="(contact, index) in article.contacts" :key="contact.id || index">
<template v-if="index > 0">, </template>
<a v-if="contact.id" :href="`/people/${contact.id}/`">{{ contact.name }}</a>
<span v-else>{{ contact.name }}</span>
</span>
{{ article.contact }}
</td>
</tr>
Expand Down
4 changes: 4 additions & 0 deletions src/components/pages/Events.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ fragment articleFields on Article {
location_url
continent
contact
contacts {
id
name
}
external_url
gtn
links {
Expand Down
86 changes: 86 additions & 0 deletions src/components/pages/Group.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<template>
<Layout>
<h1 class="page-title">{{ $page.main ? $page.main.title : $context.group }}</h1>
<div v-if="hasContent($page.main)">
<div class="content markdown" v-html="$page.main.content" />
</div>
<p>{{ $page.allPerson.totalCount }} members:</p>
<table class="table table-striped">
<thead>
<tr>
<th>Member</th>
<th>GitHub</th>
</tr>
</thead>
<tbody>
<tr v-for="edge in $page.allPerson.edges" :key="edge.node.id">
<td>
<g-link :to="edge.node.path">{{ edge.node.name }}</g-link>
</td>
<td>
<a v-if="edge.node.github" :href="`https://github.com/${edge.node.github}`">
@{{ edge.node.github }}
</a>
</td>
</tr>
</tbody>
</table>
</Layout>
</template>

<script>
import { hasContent } from "~/lib/pages.mjs";
export default {
methods: {
hasContent,
},
metaInfo() {
return {
title: this.$page.main ? this.$page.main.title : this.$context.group,
};
},
};
</script>

<page-query>
query($group: String, $mainPath: String) {
main: insert(path: $mainPath) {
id
title
content
fileInfo {
path
}
}
allPerson(
filter: { groups: {contains: [$group]}, draft: {ne: true} }
) {
totalCount
edges {
node {
id
path
name
image
images
groups
subsites
main_subsite
github
location {
city
country
geo {
lat
lon
}
}
affiliations {
id
name
}
}
}
}
}
</page-query>
5 changes: 4 additions & 1 deletion src/templates/Article.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ query Article($path: String!) {
date (format: "YYYY-MM-DD")
end (format: "YYYY-MM-DD")
contact
contact_url
contacts {
id
name
}
authors
location
location_url
Expand Down