Skip to content

Commit

Permalink
added abaout project page
Browse files Browse the repository at this point in the history
  • Loading branch information
OllyButters committed Aug 2, 2024
1 parent ac82bbc commit 5401f3a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
3 changes: 2 additions & 1 deletion source/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


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

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

except Exception as e:
print('Problem with the settings file')
Expand Down
1 change: 1 addition & 0 deletions source/web_pages/build_htmlv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def build_all(papers, papers_with_keywords, papers_with_abstract_text):
page_wordclouds.build_abstract_word_cloud(papers_with_abstract_text)
page_keywords.build_mesh(papers)
page_about.build_about()
page_about.build_about_study()
page_search.build_search(papers)
page_css.build_css_colour_scheme()
page_metrics.build_metrics(papers, age_weighted_citations, age_weighted_citations_data)
Expand Down
4 changes: 4 additions & 0 deletions source/web_pages/common_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ def build_common_body(breadcrumb, nav_path):
html += '<ul class="navgroup">'
html += '<li><a href="' + nav_path + 'index.html">Home</a></li>'
html += '<li><a href="' + nav_path + 'about/index.html">About</a></li>'
if config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE is not None:
html += '<li><a href="' + nav_path + 'about/project.html">About project</a></li>'


html += '<li><a href="' + nav_path + 'search/index.html">Search</a></li>'

if config.WEB_PAGE_SHOW_ZOTERO_TAGS:
Expand Down
36 changes: 35 additions & 1 deletion source/web_pages/page_about.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import logging
import os
from config import config
from . import common_html as ch

###########################################################
# Help Page
# About Page
###########################################################
def build_about():

Expand Down Expand Up @@ -88,3 +90,35 @@ def build_about():

temp = ch.build_common_foot("../")
html_file.write(temp)

###########################################################
# About study Page
###########################################################
def build_about_study():

print("\n###HTML - about page###")

if config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE is not None:

if not os.path.isfile(config.config_dir + '/' + config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE):
logging.error("The file " + config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE + " does not exist.")
return

with open(config.config_dir + '/' + config.WEB_PAGE_PROJECT_ABOUT_HTML_FILE, 'r', encoding='utf-8') as input_html_file:
input_html = input_html_file.read()

output_html_file = open(config.html_dir + '/about/project.html', 'w', encoding='utf-8')

# # Put html together for this page

temp = ch.build_common_head("../", "")
temp += ch.build_common_body('<p id="breadcrumbs"><a href="../index.html">Home</a> &gt; About the project</p>', "../")

temp += '<h1 id="pagetitle">About the project</h1>'

temp += input_html

output_html_file.write(temp)

temp = ch.build_common_foot("../")
output_html_file.write(temp)

0 comments on commit 5401f3a

Please sign in to comment.