diff --git a/modules/Render.py b/modules/Render.py
index 4bd6d3b..efd6b69 100644
--- a/modules/Render.py
+++ b/modules/Render.py
@@ -38,10 +38,11 @@ def headers(server, code):
server.end_headers()
-def head(title="", description="", image="", config={}):
+def head(title="", description="", image="", config={}, author=""):
if image.startswith("/"): image = config.get("url","")+image
+
favicon = config.get("favicon", "/icon/internet")
html = """
@@ -65,6 +66,32 @@ def head(title="", description="", image="", config={}):
+ """
+
+ # Author tags.
+
+ if author:
+ account = accounts().get(author, {})
+ name = account.get("title", account)
+ mastodon = account.get("mastodon", "")
+
+ try:
+ if "/" in mastodon:
+ mastodon = mastodon.replace("https://", "").replace("http://", "")
+ mastodon = mastodon.split("/")[1]+"@"+mastodon.split("/")[0]
+ except:
+ pass
+
+ if mastodon:
+
+ html = html + """
+
+
+
+ """
+
+ html = html + """
+
@@ -406,7 +433,9 @@ def ArticlePage(server, url):
# Generating
html = head(title = Articles.get(article, {}).get("title", article),
description = Articles.get(article, {}).get("description", ""),
- config = config
+ image = Articles.get(article, {}).get("thumbnail", ""),
+ config = config,
+ author = Articles.get(article, {}).get("author")
)
@@ -550,68 +579,71 @@ def AccountPage(server, account):
html = html + ''
+
+ # Protecting emails and stuff from scrubbers
+ if len(str(server.cookie)) == 50:
- # Website
-
- website = Safe(Accounts.get(account, {}).get("website" , ""))
- if website:
+ # Website
- webtitle = website.replace("https://", "").replace("http://", "")
- if not website.startswith("http"): website = "http://"+website
-
- html = html + ''
- html = html + ''
- html = html + ' '+webtitle+''
- html = html + ''
+ website = Safe(Accounts.get(account, {}).get("website" , ""))
+ if website:
- # Email
-
- email = Safe(Accounts.get(account, {}).get("email" , ""))
- if email:
-
- html = html + ''
- html = html + ''
- html = html + ' '+email+''
- html = html + ''
-
- # Mastodon
-
- mastodon = Safe(Accounts.get(account, {}).get("mastodon" , ""))
- if mastodon:
-
- # It could be mastodon url and not handle.
- try:
- if "/" in mastodon:
- mastodon = mastodon.replace("https://", "").replace("http://", "")
- mastodon = mastodon.split("/")[1]+"@"+mastodon.split("/")[0]
-
- mastolink = "https://"+mastodon[1:].split("@")[1]+"/@"+mastodon[1:].split("@")[0]
+ webtitle = website.replace("https://", "").replace("http://", "")
+ if not website.startswith("http"): website = "http://"+website
html = html + ''
- html = html + ''
- html = html + ' '+mastodon+''
+ html = html + ''
+ html = html + ' '+webtitle+''
html = html + ''
- except:
- pass
- # Matrix
+ # Email
- matrix = Safe(Accounts.get(account, {}).get("matrix" , ""))
- if matrix:
+ email = Safe(Accounts.get(account, {}).get("email" , ""))
+ if email:
- # Matrix could be the matrix.to link
- if "/" in matrix:
- matrix = matrix[matrix.rfind("/")+1:]
-
- matrixlink = "https://matrix.to/#/"+matrix
-
- html = html + ''
- html = html + ''
- html = html + ' '+matrix+''
- html = html + ''
+ html = html + ''
+ html = html + ''
+ html = html + ' '+email+''
+ html = html + ''
- if any((website, email, mastodon, matrix)):
- html = html + '
'
+ # Mastodon
+
+ mastodon = Safe(Accounts.get(account, {}).get("mastodon" , ""))
+ if mastodon:
+
+ # It could be mastodon url and not handle.
+ try:
+ if "/" in mastodon:
+ mastodon = mastodon.replace("https://", "").replace("http://", "")
+ mastodon = mastodon.split("/")[1]+"@"+mastodon.split("/")[0]
+
+ mastolink = "https://"+mastodon[1:].split("@")[1]+"/@"+mastodon[1:].split("@")[0]
+
+ html = html + ''
+ html = html + ''
+ html = html + ' '+mastodon+''
+ html = html + ''
+ except:
+ pass
+
+ # Matrix
+
+ matrix = Safe(Accounts.get(account, {}).get("matrix" , ""))
+ if matrix:
+
+ # Matrix could be the matrix.to link
+ if "/" in matrix:
+ matrix = matrix[matrix.rfind("/")+1:]
+
+ matrixlink = "https://matrix.to/#/"+matrix
+
+ html = html + ''
+ html = html + ''
+ html = html + ' '+matrix+''
+ html = html + ''
+
+ if any((website, email, mastodon, matrix)):
+ html = html + '
'
html = html + ''