cd bootstrap4-minimal/
_config_dummy.yml
(API KEY MUST NOT BE CHECKED INTO GIT)jekyll serve --incremental
export LANG=en_US.UTF-8
and try again._site/
and serve the folder during runtime._data/
, _includes
, ...).bootstrap4-minimal/
Folders | Descriptions |
---|---|
_data/ | Storing static data in yaml files (can be accessed from pages). |
_includes/ | HTML templates for a part or a tool of a page. |
_layouts/ | HTML templates for a general page layout. |
_site/ | Folder used by Jekyll to serve the website. |
_plugins/ | Stores external plugin files / 3rd party libraries. |
Folders | Descriptions |
---|---|
about/ | Page templates for about/ route. |
data/ | Page templates for data/ route. |
publications/ | Page templates for publications/ route. |
education/ | Page templates for education/ route. |
research/ | Page templates for research/ route. |
Folders | Descriptions |
---|---|
assets/ | Storing all CSS, JavaScript, Image files that can be accessed publicly. |
includes/head.html
)includes/head.html
)Page-Specific CSS: include them in the page template's FrontMatter section.
page_css:
HTML
data/catalog/package/index.md
_includes/data/package.html
CSS File
assets/css/custom/data/package.scss
)
JavaScript
These files query Pasta XML data and pick them one by one into building the HTML package page. The Pasta XML data structure is difficult to predict (data may or may not exist, can be at different places, can exist as an object or list of objects...). To ensure we build an error free page, there are 2 phases involved to safely produce each tab:
All JavaScript files are inside assets/js/package/
folder, which includes:
All general helper functions live inside the main file. They are used everywhere in the main and tab files.
extractString(data, path, keys, delim='')
This function extracts string from the given data. It will safely traverse down the path starting from the root data. Then, it uses keys to extract each string. Finally, it joins and returns the strings with the delimiter.
extractStringObject(data, keys, delim='')
This function extracts string from the given data object. It uses keys to extract each string, and joins and returns the strings with the delimiter. Please use extractString() instead for most use cases.
extractList(data, path, keys, to_string)
This function extracts a list of objects from the given data. It will safely traverse down the path starting from the root data. Then, it uses keys to extract each item from the list and returns a new list.
loadXMLDoc(fileUrl, onReady, onError)
This function loads XML data from the given fileUrl, and calls onReady or onError functions when the process is finished.
camelToWords(text)
This function converts given camel string to actual words. Ex: "dogIsCute" -> "Dog Is Cute"
parseAddress(json)
This function parses mail address from the Pasta data, and returns an address-formatted string.
parseName(json, format)
This function parses names from the Pasta data, and returns a name string.
%F
= first name, %f
= first initial.%L
= last name, %l
= last initial.%M
= middle name, %m
= middle initial.activateLink(url, title)
This function turns given url and title to a HTML link tag.
makeTableRow(cells, classes)
This function takes a list of cells and row classes to form a HTML table row.
th
and td
cells. Ex: [ [ 'th', 'col-4', 'name' ], [ 'td', 'col-8', 'value' ] ]
updateView(title, body)
This function updates the title and body of the package page.
loadMathJax()
This function dynamically loads MathJax script onto the page's head tag.
removeLastDelim(str, delim, ending='')
This function removes the ending delimiter of a string, if it exists. It then appends the given string ending.