Uprank myself temporarily to make the first subnode in [[agora]] a

better welcome to some visitors.
This commit is contained in:
Flancian 2020-12-29 20:22:49 +01:00
parent a95b5d8d0b
commit 11d57c0a81
2 changed files with 13 additions and 2 deletions

View file

@ -109,6 +109,8 @@ def pull(node):
def wikilink(node):
n = G.node(node)
n.subnodes = util.uprank(n.subnodes, user='flancian')
return render_template(
'node_rendered.html',
node=n,

View file

@ -17,9 +17,18 @@ from functools import lru_cache
parser = DateDataParser(languages=['en'])
def rank(l, user):
def rank(l, attribute):
# hack hack
return sorted(l, key=lambda x: x.user)
return sorted(l, key=lambda x: x.attribute)
def uprank(l, user):
# hack hack
def score(n):
if n.user == user:
return -1
return 0
return sorted(l, key=score)
def canonical_wikilink(wikilink):