Add logic for /users/username userdirs

This commit is contained in:
Robert Miles 2021-02-02 17:18:27 +00:00
parent da2ab023fe
commit f720b2e549
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,9 @@ BACKLINKS = "gemini://geminispace.info/backlinks"
def determine_capsule(parsed):
capsule = parsed.netloc
if parsed.path.startswith("/~"): # allow for each userdir to be its own capsule
capsule+="/"+parsed.path.split("/")[1]
capsule+="/"+parsed.path.split("/")[1][1:]
if parsed.path.startswith("/users/"): # gemini.circumlunar.space uses this format as well
capsule+="/"+parsed.path.split("/",3)[2]
return capsule
# Required links.