pithos.sia: /l/<id>/<name> opens the public link at navigate.st/sia
This commit is contained in:
parent
7eb61b703a
commit
fac9f77af2
1 changed files with 3 additions and 0 deletions
|
|
@ -392,6 +392,9 @@
|
|||
(function () {
|
||||
var inTheseus = location.hostname === 'pithos.sia';
|
||||
var path = location.pathname.replace(/^\/bns\/pithos\.sia(?=\/|$)/, '').replace(/^\/pithos(?=\/|$)/, '') || '/';
|
||||
// pithos.sia/l/<id>/<name>: a public link; the file lives at navigate.st/sia
|
||||
var link = /^\/l\/([A-Za-z0-9_-]{4,64}(?:\/.*)?)$/.exec(path);
|
||||
if (link) { location.replace('https://navigate.st/sia/' + link[1] + location.search); return; }
|
||||
var sitePage = /^\/(index\.html|vs(\.html)?|docs(\/.*)?|llms\.txt)?$/.test(path);
|
||||
var appPath = sitePage ? '/' : path;
|
||||
var href = inTheseus ? (sitePage ? '/app' : path) : 'http://127.0.0.1:47621/open?path=' + encodeURIComponent(appPath);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue