Skip to content

Commit

Permalink
Simon and Long working together to make the first w3 template build
Browse files Browse the repository at this point in the history
  • Loading branch information
sbillinge committed Dec 17, 2020
1 parent eb4d3fc commit 2d64e75
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
2 changes: 2 additions & 0 deletions regolith/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from regolith.builders.cvbuilder import CVBuilder
from regolith.builders.htmlbuilder import HtmlBuilder
from regolith.builders.bghtmlbuilder import BGhtmlBuilder
from regolith.builders.postdocadbuilder import PostdocadBuilder
from regolith.builders.preslistbuilder import PresListBuilder
from regolith.builders.publistbuilder import PubListBuilder
Expand All @@ -21,6 +22,7 @@
BUILDERS = {
"annual-activity": ActivitylogBuilder,
"beamplan": BeamPlanBuilder,
"bghtml": BGhtmlBuilder,
"current-pending": CPBuilder,
"cv": CVBuilder,
"figure": FigureBuilder,
Expand Down
31 changes: 21 additions & 10 deletions regolith/builders/bghtmlbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@
)


class HtmlBuilder(BuilderBase):
class BGhtmlBuilder(BuilderBase):
"""Build HTML files for website"""

btype = "html"
btype = "bghtml"

def __init__(self, rc):
super().__init__(rc)
# TODO: get this from the RC
self.cmds = [
"root_index",
"people",
"projects",
"blog",
"jobs",
"abstracts",
"nojekyll",
"cname",
"finish",
# "people",
# "projects",
# "blog",
#$ "jobs",
# "abstracts",
# "nojekyll",
# "cname",
# "finish",
]

def construct_global_ctx(self):
Expand All @@ -57,6 +57,16 @@ def construct_global_ctx(self):
all_docs_from_collection(rc.client, "institutions"), key=_id_key
)

def root_index(self):
"""Render root index"""
headerinfo = {"title": "BillingeLongGroup"}
self.render("bghtmltemplate.html", "bgindex.html", headerinfo=headerinfo)
# make_bibtex_file(list(all_docs_from_collection(self.rc.client,
# "citations")),
# pid='group',
# person_dir=self.bldir,
# )
'''
def finish(self):
"""Move files over to their destination and remove them from the
source"""
Expand Down Expand Up @@ -207,3 +217,4 @@ def cname(self):
os.path.join(self.bldir, "CNAME"), "w", encoding="utf-8"
) as f:
f.write(rc.cname)
'''
2 changes: 1 addition & 1 deletion regolith/templates/bghtmltemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- Navbar (sit on top) -->
<div class="w3-top">
<div class="w3-bar w3-white w3-wide w3-padding w3-card">
<a href="#home" class="w3-bar-item w3-button"><b>BG</b> BillingeGroup</a>
<a href="#home" class="w3-bar-item w3-button"><b>BG</b> {{ headerinfo.get("title") }}</a>
<!-- Float links to the right. Hide them on small screens -->
<div class="w3-right w3-hide-small">
<a href="#news" class="w3-bar-item w3-button">News</a>
Expand Down

0 comments on commit 2d64e75

Please # to comment.