Skip to content

Commit 5401f3a

Browse files
committed
added abaout project page
1 parent ac82bbc commit 5401f3a

4 files changed

Lines changed: 42 additions & 2 deletions

File tree

source/config/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
# Parse all the config in the settings.ini file and put them into a global variable
12-
# these will be accessible via config.scopus_api_key in all the other modules
12+
# these will be accessible via e.g. config.scopus_api_key in all the other modules
1313
# where they have import config.config as config
1414

1515
# See if there is a config file specified from the command line, if not then
@@ -72,6 +72,7 @@
7272
WEB_PAGE_SHOW_ZOTERO_TAGS = config.getboolean('pages', 'web_page_show_zotero_tags', fallback = True)
7373
web_page_is_in_iframe = config.getboolean('pages', 'web_page_is_in_iframe', fallback = False)
7474
WEB_PAGE_REPORTS = config.get('pages', 'web_page_reports', fallback = None)
75+
WEB_PAGE_PROJECT_ABOUT_HTML_FILE = config.get('pages', 'web_page_project_about_html_file', fallback = None)
7576

7677
except Exception as e:
7778
print('Problem with the settings file')

source/web_pages/build_htmlv2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def build_all(papers, papers_with_keywords, papers_with_abstract_text):
2020
page_wordclouds.build_abstract_word_cloud(papers_with_abstract_text)
2121
page_keywords.build_mesh(papers)
2222
page_about.build_about()
23+
page_about.build_about_study()
2324
page_search.build_search(papers)
2425
page_css.build_css_colour_scheme()
2526
page_metrics.build_metrics(papers, age_weighted_citations, age_weighted_citations_data)

source/web_pages/common_html.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ def build_common_body(breadcrumb, nav_path):
170170
html += '<ul class="navgroup">'
171171
html += '<li><a href="' + nav_path + 'index.html">Home</a></li>'
172172
html += '<li><a href="' + nav_path + 'about/index.html">About</a></li>'
173+
if config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE is not None:
174+
html += '<li><a href="' + nav_path + 'about/project.html">About project</a></li>'
175+
176+
173177
html += '<li><a href="' + nav_path + 'search/index.html">Search</a></li>'
174178

175179
if config.WEB_PAGE_SHOW_ZOTERO_TAGS:

source/web_pages/page_about.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import logging
2+
import os
13
from config import config
24
from . import common_html as ch
35

46
###########################################################
5-
# Help Page
7+
# About Page
68
###########################################################
79
def build_about():
810

@@ -88,3 +90,35 @@ def build_about():
8890

8991
temp = ch.build_common_foot("../")
9092
html_file.write(temp)
93+
94+
###########################################################
95+
# About study Page
96+
###########################################################
97+
def build_about_study():
98+
99+
print("\n###HTML - about page###")
100+
101+
if config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE is not None:
102+
103+
if not os.path.isfile(config.config_dir + '/' + config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE):
104+
logging.error("The file " + config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE + " does not exist.")
105+
return
106+
107+
with open(config.config_dir + '/' + config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE, 'r', encoding='utf-8') as input_html_file:
108+
input_html = input_html_file.read()
109+
110+
output_html_file = open(config.html_dir + '/about/project.html', 'w', encoding='utf-8')
111+
112+
# # Put html together for this page
113+
114+
temp = ch.build_common_head("../", "")
115+
temp += ch.build_common_body('<p id="breadcrumbs"><a href="../index.html">Home</a> &gt; About the project</p>', "../")
116+
117+
temp += '<h1 id="pagetitle">About the project</h1>'
118+
119+
temp += input_html
120+
121+
output_html_file.write(temp)
122+
123+
temp = ch.build_common_foot("../")
124+
output_html_file.write(temp)

0 commit comments

Comments
 (0)