Browse Source

about changes to CN article page

main
Cailean Finn 6 months ago
parent
commit
74feb9e61d
  1. 5
      app.py
  2. 8
      templates/base.html

5
app.py

@ -309,7 +309,8 @@ class WikiApp(Flask):
data = response.json()
main_navigation_elements = {}
for page_title, page_data in data['query']['results'].items():
main_navigation_elements[page_title] = {'title':page_data.get('fulltext', '')}
title = page_data.get('fulltext', '')
main_navigation_elements[page_title] = {'title':title}
reversed_main_navigation = list(main_navigation_elements.items())[::-1]
reversed_main_navigation = dict(reversed_main_navigation)
return reversed_main_navigation
@ -376,4 +377,4 @@ class WikiApp(Flask):
app = WikiApp(__name__)
if __name__ == '__main__':
app.run(debug=False)
app.run(debug=True)

8
templates/base.html

@ -14,7 +14,13 @@
</div>
<div class='nav-element-cont'>
{% for key, element in nav_elements.items() %}
<div class='nav-element'><a href="{{ url_for('page_content', title=element.title.lower()) }}">{{ element.title }}</a><div class='spinning-star'>🞱</div></div>
<div class='nav-element'><a href="{{ url_for('page_content', title=element.title) }}">
{% if element.title == 'Concept Null' %}
About
{% else %}
{{ element.title }}
{% endif %}
</a><div class='spinning-star'>🞱</div></div>
{% endfor %}
</div>

Loading…
Cancel
Save