Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,26 @@ const ready = waitForReady(browserUrl);
// landing page. Tracked upstream in a separate issue. Doing this
// after readiness avoids a race where JSS's init might rewrite the
// file on top of ours.
//
// Also seed pod-data/public/links.jsonld on first start so the /public/
// tile lands the user on something tangible instead of an empty
// container listing. This one is skip-if-exists (it's user content
// — never overwrite a customized version).
ready.then((ok) => {
if (!ok) return;
const src = join(__dirname, 'welcome.html');
const dst = join(options.root, 'index.html');
try {
if (existsSync(src)) copyFileSync(src, dst);
const indexSrc = join(__dirname, 'welcome.html');
const indexDst = join(options.root, 'index.html');
if (existsSync(indexSrc)) copyFileSync(indexSrc, indexDst);

const linksSrc = join(__dirname, 'links.jsonld');
const linksDst = join(options.root, 'public', 'links.jsonld');
if (existsSync(linksSrc) && !existsSync(linksDst)) {
copyFileSync(linksSrc, linksDst);
}
} catch {
// best-effort: if we can't write, the user just sees JSS's default
// best-effort: failures are silent; user falls back to whatever
// JSS already wrote (or nothing for links.jsonld).
}
});

Expand Down
28 changes: 28 additions & 0 deletions links.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"@context": {
"schema": "http://schema.org/",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#"
},
"@id": "",
"@type": "schema:WebPage",
"rdfs:label": "Links — places to take your Solid pod next",
"rdfs:comment": "A few starting points. Click any URI to navigate.",
"schema:hasPart": [
{
"@id": "https://solid-apps.github.io/pilot/",
"rdfs:label": "Pilot — a minimal Solid data browser"
},
{
"@id": "https://solidproject.org/apps",
"rdfs:label": "Browse more Solid apps"
},
{
"@id": "https://github.com/JavaScriptSolidServer/jspod",
"rdfs:label": "jspod source"
},
{
"@id": "https://github.com/JavaScriptSolidServer/JavaScriptSolidServer",
"rdfs:label": "JavaScriptSolidServer (the substrate jspod builds on)"
}
]
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jspod",
"version": "0.0.14",
"version": "0.0.15",
"description": "JavaScript Solid Pod - Just works, batteries included",
"type": "module",
"main": "index.js",
Expand All @@ -11,7 +11,8 @@
"index.js",
"data-browser.js",
"data-browser.css",
"welcome.html"
"welcome.html",
"links.jsonld"
],
"scripts": {
"start": "node index.js"
Expand Down