Skip to content

Commit cbed715

Browse files
committed
Deploy preview for PR 57 🛫
1 parent ddbc940 commit cbed715

217 files changed

Lines changed: 44978 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎preview/pr-57/2019/01/07/example-post-1.html‎

Lines changed: 714 additions & 0 deletions
Large diffs are not rendered by default.

‎preview/pr-57/2021/09/30/example-post-2.html‎

Lines changed: 699 additions & 0 deletions
Large diffs are not rendered by default.

‎preview/pr-57/2023/02/23/example-post-3.html‎

Lines changed: 710 additions & 0 deletions
Large diffs are not rendered by default.

‎preview/pr-57/404.html‎

Lines changed: 627 additions & 0 deletions
Large diffs are not rendered by default.

‎preview/pr-57/CHANGELOG.md‎

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Changelog
2+
3+
Reference: common-changelog.org
4+
5+
## 1.1.5 - 2023-05-19
6+
7+
### Changes
8+
9+
- Fix ORCID plugin bug and other cite process tweaks.
10+
11+
## 1.1.4 - 2023-04-28
12+
13+
### Changed
14+
15+
- Fix ORCID plugin and other cite process bugs.
16+
17+
## 1.1.3 - 2023-04-20
18+
19+
### Changed
20+
21+
- Fix first-time-setup mv bug.
22+
- Fix citation, float, and portrait component CSS.
23+
- Filter and trim citation info fields.
24+
25+
## 1.1.2 - 2023-04-11
26+
27+
### Changed
28+
29+
- Fix first-time-setup rm bug.
30+
31+
## 1.1.1 - 2023-04-06
32+
33+
### Changed
34+
35+
- Change member profile page from col layout to float.
36+
- Fix first time setup. Preserve config formatting and comments.
37+
- Improve Docker cite process behavior.
38+
- Fix post excerpt component start/end markers and special search attr chars.
39+
- Fix misc CSS.
40+
41+
### Added
42+
43+
- Add show-title and show-subtitle site config options.
44+
- Include site subtitle in description meta tag.
45+
- Add user pull request template.
46+
- Add title and link fallbacks to citation component.
47+
48+
## 1.1.0 - 2023-03-17
49+
50+
Add alert component, Docker support, accessibility fixes.
51+
52+
### Changed
53+
54+
- Fix Lighthouse accessibility issues.
55+
- De-href components when link isn't provided (no hand cursor icon on hover or nav on click).
56+
- In search script, limit highlights by total count instead of char length.
57+
- Grid and link style tweaks.
58+
- Take ORCID icon from Font Awesome.
59+
- Misc bug fixes in tags script, float component.
60+
61+
### Added
62+
63+
- Add Docker configuration and scripts for local previewing.
64+
- Add alert component and types.
65+
- Role icon in portrait component hoisted to top left.
66+
67+
## 1.0.0 - 2023-02-28
68+
69+
First official release.
70+
71+
High-level comparison with pre-releases:
72+
73+
- Simpler configuration.
74+
- More automation, less setup.
75+
- More customization and flexibility.
76+
- Redesigned components.
77+
- New docs.
78+
- Complete rewrite.
79+
- Culmination of years of feedback.
80+
81+
### Changed
82+
83+
- Template is no longer limited to GitHub Pages white-listed Jekyll plugins. Any plugins possible.
84+
- Pull request previews happen right within GitHub instead of needing Netlify.
85+
- Better versioning. `CITATION.cff` file now source of truth for version, and tags/releases enforced.
86+
- Citation-related files in `/_data` must now be named prefixed with the cite plugin they are to be run with, e.g. `sources-2020.yaml` or `orcid-students.yaml`.
87+
- Folder renames for clarity and for better separation of template and user content: `/auto-cite` → `/_cite`, `/css` → `/_styles`, `/js` → `/_scripts`.
88+
- Rename "Tools" page to "Projects" to be more clear and general purpose.
89+
- Rename `extra-links` to `buttons` in `sources.yaml` files.
90+
- Rename `theme.scss` to `-theme.scss`.
91+
- Rename/repurpose components: link → button, two-col → cols, gallery → grid.
92+
- Combine "link" and "role" data lists into single `types.yaml` map.
93+
- Redesign components, change parameters and behavior.
94+
- Update Font Awesome icon names from v5 to v6.
95+
- Change placeholder text, images, and other images.
96+
- Use CSS variables instead of Sass variables.
97+
- Simplify caching method in cite process.
98+
- Simplify Liquid code by including custom Ruby plugins.
99+
- Simplify styles and scripts.
100+
101+
### Added
102+
103+
- New docs at greene-lab.gitbook.io/lab-website-template-docs.
104+
- Add automations for first time setup and URL change.
105+
- Write PubMed and Google Scholar automatic citation plugins.
106+
- Automatic citations through GitHub Actions should now work from (most) forks.
107+
- Add optional description and type params for citations.
108+
- Add periodic cite process run that opens a pull request.
109+
- List component filters can now accept arbitrary regex.
110+
- Add light/dark mode toggle.
111+
- Pre-install selection of useful Jekyll plugins, namely Jekyll Spaceship.
112+
- Add author portrait and updated date for blog posts.
113+
- Add richer metadata for SEO.
114+
- Google Fonts link determined automatically from theme file.
115+
116+
### Removed
117+
118+
- Remove options from `_config.yaml` to simplify configuration: `baseurl`, `auto-cite`, `logo`.
119+
- Remove `/favicons` folder, hardcode files for logo, icon, and share in `/images`.
120+
- Remove `palettes.scss` and `mixins.scss`.
121+
- Remove banner component (same thing can be achieved with full width section and figure components).
122+
- Remove role component. Combine with portrait component.

‎preview/pr-57/CNAME‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
www.ncilab.ca
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
creates link next to each heading that links to that section.
3+
*/
4+
5+
{
6+
const onLoad = () => {
7+
// for each heading
8+
const headings = document.querySelectorAll(
9+
"h1[id], h2[id], h3[id], h4[id]"
10+
);
11+
for (const heading of headings) {
12+
// create anchor link
13+
const link = document.createElement("a");
14+
link.classList.add("icon", "fa-solid", "fa-link", "anchor");
15+
link.href = "#" + heading.id;
16+
link.setAttribute("aria-label", "link to this section");
17+
heading.append(link);
18+
19+
// if first heading in the section, move id to parent section
20+
if (heading.matches("section > :first-child")) {
21+
heading.parentElement.id = heading.id;
22+
heading.removeAttribute("id");
23+
}
24+
}
25+
};
26+
27+
// scroll to target of url hash
28+
const scrollToTarget = () => {
29+
const id = window.location.hash.replace("#", "");
30+
const target = document.getElementById(id);
31+
32+
if (!target) return;
33+
const offset = document.querySelector("header").clientHeight || 0;
34+
window.scrollTo({
35+
top: target.getBoundingClientRect().top + window.scrollY - offset,
36+
behavior: "smooth",
37+
});
38+
};
39+
40+
// after page loads
41+
window.addEventListener("load", onLoad);
42+
window.addEventListener("load", scrollToTarget);
43+
window.addEventListener("tagsfetched", scrollToTarget);
44+
45+
// when hash nav happens
46+
window.addEventListener("hashchange", scrollToTarget);
47+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
manages light/dark mode.
3+
*/
4+
5+
{
6+
// save/load user's dark mode preference from local storage
7+
const loadDark = () => window.localStorage.getItem("dark-mode") === "true";
8+
const saveDark = (value) => window.localStorage.setItem("dark-mode", value);
9+
10+
// immediately load saved mode before page renders
11+
document.documentElement.dataset.dark = loadDark();
12+
13+
const onLoad = () => {
14+
// update toggle button to match loaded mode
15+
document.querySelector(".dark-toggle").checked =
16+
document.documentElement.dataset.dark === "true";
17+
};
18+
19+
// after page loads
20+
window.addEventListener("load", onLoad);
21+
22+
// when user toggles mode button
23+
window.onDarkToggleChange = (event) => {
24+
const value = event.target.checked;
25+
document.documentElement.dataset.dark = value;
26+
saveDark(value);
27+
};
28+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
fetches tags (aka "topics") from a given GitHub repo and adds them to row of
3+
tag buttons. specify repo in data-repo attribute on row.
4+
*/
5+
6+
{
7+
const onLoad = async () => {
8+
// get tag rows with specified repos
9+
const rows = document.querySelectorAll("[data-repo]");
10+
11+
// for each repo
12+
for (const row of rows) {
13+
// get props from tag row
14+
const repo = row.dataset.repo.trim();
15+
const link = row.dataset.link.trim();
16+
17+
// get tags from github
18+
if (!repo) continue;
19+
let tags = await fetchTags(repo);
20+
21+
// filter out tags already present in row
22+
let existing = [...row.querySelectorAll(".tag")].map((tag) =>
23+
window.normalizeTag(tag.innerText)
24+
);
25+
tags = tags.filter((tag) => !existing.includes(normalizeTag(tag)));
26+
27+
// add tags to row
28+
for (const tag of tags) {
29+
const a = document.createElement("a");
30+
a.classList.add("tag");
31+
a.innerHTML = tag;
32+
a.href = `${link}?search="tag: ${tag}"`;
33+
a.dataset.tooltip = `Show items with the tag "${tag}"`;
34+
row.append(a);
35+
}
36+
37+
// delete tags container if empty
38+
if (!row.innerText.trim()) row.remove();
39+
}
40+
41+
// emit "tags done" event for other scripts to listen for
42+
window.dispatchEvent(new Event("tagsfetched"));
43+
};
44+
45+
// after page loads
46+
window.addEventListener("load", onLoad);
47+
48+
// GitHub topics endpoint
49+
const api = "https://api.github.com/repos/REPO/topics";
50+
const headers = new Headers();
51+
headers.set("Accept", "application/vnd.github+json");
52+
53+
// get tags from GitHub based on repo name
54+
const fetchTags = async (repo) => {
55+
const url = api.replace("REPO", repo);
56+
try {
57+
const response = await (await fetch(url)).json();
58+
if (response.names) return response.names;
59+
else throw new Error(JSON.stringify(response));
60+
} catch (error) {
61+
console.groupCollapsed("GitHub fetch tags error");
62+
console.log(error);
63+
console.groupEnd();
64+
return [];
65+
}
66+
};
67+
}

0 commit comments

Comments
 (0)