Skip to content

Commit d2e68f1

Browse files
Link new resources & fix mobile styling
1 parent 28b8981 commit d2e68f1

File tree

12 files changed

+704
-57
lines changed

12 files changed

+704
-57
lines changed

.eleventy.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const passthroughFiles = [
55
{ from: 'src/assets', to: 'assets' },
66
{ from: 'src/data/graph.json', to: 'data/graph.json' },
77
{ from: 'src/css', to: 'css' },
8+
{ from: 'src/site.webmanifest', to: 'site.webmanifest' },
89
];
910

1011
/** @param {import('@11ty/eleventy').UserConfig} eleventyConfig */
@@ -32,6 +33,44 @@ export default function (eleventyConfig) {
3233
return date.toISOString().split('T')[0];
3334
});
3435

36+
eleventyConfig.addNunjucksFilter('isExternalLink', (href) => {
37+
if (!href) {
38+
return false;
39+
}
40+
return href.startsWith('http://') || href.startsWith('https://') || href.startsWith('//');
41+
});
42+
43+
eleventyConfig.addNunjucksFilter('getNodeDepth', (nodeId, graphData) => {
44+
if (!graphData || !graphData.links) {
45+
return 0;
46+
}
47+
48+
// Build parent map - include both belongsTo and relates links
49+
const parents = new Map();
50+
for (const link of graphData.links) {
51+
if (link.kind === 'belongsTo' || link.kind === 'relates') {
52+
parents.set(link.target, link.source);
53+
}
54+
}
55+
56+
// Calculate depth
57+
let depth = 0;
58+
let current = nodeId;
59+
while (parents.has(current)) {
60+
current = parents.get(current);
61+
depth += 1;
62+
}
63+
64+
return depth;
65+
});
66+
67+
eleventyConfig.addNunjucksFilter('findNodeById', (nodes, nodeId) => {
68+
if (!nodes || !nodeId) {
69+
return null;
70+
}
71+
return nodes.find(node => node.id === nodeId) || null;
72+
});
73+
3574
eleventyConfig.addGlobalData('graphData', async () => {
3675
const file = resolve('src/data/graph.json');
3776
const content = await readFile(file, 'utf-8');

esbuild.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async function prepareOutDir() {
1212
}
1313

1414
const baseConfig = {
15-
entryPoints: ['src/js/graph.ts', 'src/js/search.ts', 'src/js/analytics.ts'],
15+
entryPoints: ['src/js/graph.ts', 'src/js/search.ts', 'src/js/analytics.ts', 'src/js/glitch.ts'],
1616
outdir,
1717
bundle: true,
1818
sourcemap: true,
@@ -28,6 +28,7 @@ const baseConfig = {
2828
'process.env.NODE_ENV': JSON.stringify(watch ? 'development' : 'production'),
2929
},
3030
minify: !watch,
31+
entryNames: '[name]',
3132
};
3233

3334
async function writeMetaFile(metafile) {
@@ -53,6 +54,7 @@ async function runBuild() {
5354
splitting: true,
5455
chunkNames: 'chunks/[name]-[hash]',
5556
metafile: true,
57+
entryNames: '[name]',
5658
loader: {
5759
'.json': 'json',
5860
},
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{% macro renderNodeList(nodes, parentId, graphData) %}
2+
{% set children = [] %}
3+
{% for link in graphData.links %}
4+
{% if link.source === parentId and (link.kind === 'belongsTo' or link.kind === 'relates') %}
5+
{% for node in nodes %}
6+
{% if node.id === link.target %}
7+
{% set children = (children.push(node), children) %}
8+
{% endif %}
9+
{% endfor %}
10+
{% endif %}
11+
{% endfor %}
12+
13+
{% if children.length > 0 %}
14+
<ul class="nodes-list__nested">
15+
{% for node in children %}
16+
{% set depth = node.id | getNodeDepth(graphData) %}
17+
<li class="nodes-list__item" data-depth="{{ depth }}">
18+
<a href="{{ node.href }}" {% if node.href | isExternalLink %}target="_blank" rel="noopener"{% endif %}>{{ node.label }}</a>
19+
{% if node.description %}<p class="nodes-list__description">{{ node.description }}</p>{% endif %}
20+
{{ renderNodeList(nodes, node.id, graphData) }}
21+
</li>
22+
{% endfor %}
23+
</ul>
24+
{% endif %}
25+
{% endmacro %}
26+

src/_includes/partials/footer.njk

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
<p>Hands-on graph databases, knowledge graphs, and GNNs. Cypher, GQL, RDF/SPARQL. Graph models, performance, and viz.</p>
66
</div>
77
<div class="footer-links">
8-
<a href="/" data-prefetch>Home</a>
9-
<a href="https://x.com/i/communities/1977449294861881612" target="_blank" rel="noopener">Community</a>
10-
<a href="https://x.com/bronzeagecto/status/1977502404041199995" target="_blank" rel="noopener">Rules</a>
11-
<a href="/spaces/" data-prefetch>Spaces</a>
12-
<a href="https://x.com/i/communities/1977449294861881612/hashtag/KnowledgeGraphs" target="_blank" rel="noopener">Knowledge Graphs</a>
8+
<a href="https://github.com/GraphTechnologyDevelopers" target="_blank" rel="noopener">GitHub Org</a>
9+
<a href="https://github.com/codegraphtheory" target="_blank" rel="noopener">GitHub Profile</a>
1310
<a href="https://github.com/GraphTechnologyDevelopers/graphtech.dev" target="_blank" rel="noopener">Fork this website</a>
1411
</div>
1512
</div>

src/_includes/partials/head.njk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@
2020
<link rel="preconnect" href="https://plausible.io" crossorigin>
2121
<link rel="preconnect" href="https://x.com" crossorigin>
2222
<link rel="preconnect" href="https://github.com" crossorigin>
23-
<link rel="preload" href="/spaces/" as="document">
23+
<link rel="preload" href="/spaces/" as="fetch">
2424

2525
<meta property="og:type" content="website">
2626
<meta property="og:site_name" content="{{ site.title }}">
2727
<meta property="og:title" content="{{ pageTitle }}">
2828
<meta property="og:description" content="{{ description }}">
2929
<meta property="og:url" content="{{ canonicalUrl }}">
30-
<meta property="og:image" content="{{ site.url }}/assets/og-default.png">
30+
<meta property="og:image" content="{{ site.url }}/assets/graph-technology-developers-splash.png">
3131
<meta property="og:image:alt" content="Graph Technology Developers">
3232

3333
<meta name="twitter:card" content="summary_large_image">
3434
<meta name="twitter:site" content="{{ site.handles.personal }}">
3535
<meta name="twitter:title" content="{{ pageTitle }}">
3636
<meta name="twitter:description" content="{{ description }}">
37-
<meta name="twitter:image" content="{{ site.url }}/assets/og-default.png">
37+
<meta name="twitter:image" content="{{ site.url }}/assets/graph-technology-developers-splash.png">
3838

3939
<link rel="stylesheet" href="/css/base.css">
4040
<link rel="stylesheet" href="/css/graph.css">

src/_includes/partials/header.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<header class="site-header" role="banner">
22
<div class="header-inner">
33
<div class="logo-wordmark">
4-
<span class="logo-wordmark__brand">Graph Technology Developers</span>
4+
<a href="/" data-prefetch><span class="logo-wordmark__brand">Graph Technology Developers</span></a>
55
</div>
66
<nav class="site-nav" aria-label="Primary">
77
<ul class="site-nav__list">
88
<li><a href="/" data-prefetch>Home</a></li>
9+
<li><a href="#resources">Resources</a></li>
910
<li><a href="https://x.com/i/communities/1977449294861881612" target="_blank" rel="noopener">Community</a></li>
1011
<li><a href="https://x.com/bronzeagecto/status/1977502404041199995" target="_blank" rel="noopener">Rules</a></li>
1112
<li><a href="/spaces/" data-prefetch>Spaces</a></li>
12-
<li><a href="https://x.com/i/communities/1977449294861881612/hashtag/KnowledgeGraphs" target="_blank" rel="noopener">Knowledge Graphs</a></li>
1313
</ul>
1414
</nav>
1515
</div>

src/_includes/partials/legend.njk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{% set categories = {
22
"hub": "Hub",
3+
"topic": "Topics",
34
"asset": "Destinations"
45
} %}
56

67
{% for key, label in categories %}
78
<button type="button" class="legend__pill" data-legend-filter="{{ key }}" aria-pressed="true">{{ label }}</button>
89
{% endfor %}
10+
11+
<button type="button" class="legend__pill" data-tag-filter="x" aria-pressed="true">X</button>
12+
<button type="button" class="legend__pill" data-tag-filter="github" aria-pressed="true">GitHub</button>
13+
914
<button type="button" class="legend__pill legend__pill--reset" data-legend-reset aria-label="Show all nodes">Reset</button>
1015

0 commit comments

Comments
 (0)