mirror of https://gitlab.com/bashrc2/epicyon
Instance about in markdown format
parent
768f2d4fe9
commit
3b227aa520
|
@ -3315,7 +3315,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
|
||||
linksFilename = baseDir + '/accounts/links.txt'
|
||||
aboutFilename = baseDir + '/accounts/about.txt'
|
||||
aboutFilename = baseDir + '/accounts/about.md'
|
||||
TOSFilename = baseDir + '/accounts/tos.md'
|
||||
|
||||
# extract all of the text fields into a dict
|
||||
|
|
|
@ -18,9 +18,9 @@ def htmlAbout(cssCache: {}, baseDir: str, httpPrefix: str,
|
|||
"""Show the about screen
|
||||
"""
|
||||
adminNickname = getConfigParam(baseDir, 'admin')
|
||||
if not os.path.isfile(baseDir + '/accounts/about.txt'):
|
||||
copyfile(baseDir + '/default_about.txt',
|
||||
baseDir + '/accounts/about.txt')
|
||||
if not os.path.isfile(baseDir + '/accounts/about.md'):
|
||||
copyfile(baseDir + '/default_about.md',
|
||||
baseDir + '/accounts/about.md')
|
||||
|
||||
if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'):
|
||||
if not os.path.isfile(baseDir + '/accounts/login-background.jpg'):
|
||||
|
@ -28,8 +28,8 @@ def htmlAbout(cssCache: {}, baseDir: str, httpPrefix: str,
|
|||
baseDir + '/accounts/login-background.jpg')
|
||||
|
||||
aboutText = 'Information about this instance goes here.'
|
||||
if os.path.isfile(baseDir + '/accounts/about.txt'):
|
||||
with open(baseDir + '/accounts/about.txt', 'r') as aboutFile:
|
||||
if os.path.isfile(baseDir + '/accounts/about.md'):
|
||||
with open(baseDir + '/accounts/about.md', 'r') as aboutFile:
|
||||
aboutText = aboutFile.read()
|
||||
|
||||
aboutForm = ''
|
||||
|
|
|
@ -17,6 +17,7 @@ from webapp_utils import headerButtonsFrontScreen
|
|||
from webapp_utils import htmlHeaderWithExternalStyle
|
||||
from webapp_utils import htmlFooter
|
||||
from webapp_utils import getBannerFile
|
||||
from webapp_utils import markdownToHtml
|
||||
|
||||
|
||||
def _linksExist(baseDir: str) -> bool:
|
||||
|
@ -411,11 +412,11 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
|
|||
adminNickname = getConfigParam(baseDir, 'admin')
|
||||
if adminNickname:
|
||||
if nickname == adminNickname:
|
||||
aboutFilename = baseDir + '/accounts/about.txt'
|
||||
aboutFilename = baseDir + '/accounts/about.md'
|
||||
aboutStr = ''
|
||||
if os.path.isfile(aboutFilename):
|
||||
with open(aboutFilename, 'r') as fp:
|
||||
aboutStr = fp.read()
|
||||
aboutStr = markdownToHtml(fp.read())
|
||||
|
||||
editLinksForm += \
|
||||
'<div class="container">'
|
||||
|
|
Loading…
Reference in New Issue