Skip to content

Commit

Permalink
Added featured image selection to students.yaml
Browse files Browse the repository at this point in the history
- The students.yaml file now allows for arbitrary data fields.
- One field is the “featured:” key which enables specifying a specific image for the work/index page.
- Removed Elif Koc.
  • Loading branch information
awmartin committed Aug 16, 2024
1 parent 251af68 commit 36ef8ce
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 225 deletions.
14 changes: 7 additions & 7 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("work/**/*.woff");
eleventyConfig.addPassthroughCopy("work/**/*.woff2");

// Open the work/students.yaml file and create a collection from it for
// Eleventy to render.
const yamlData = yaml.load(fs.readFileSync(path.join(__dirname, 'work/students.yaml'), 'utf8'));

const studentsYamlPath = path.join(__dirname, 'work/students.yaml');
eleventyConfig.addWatchTarget(studentsYamlPath);
eleventyConfig.addCollection('students', function(collection) {
return Object.entries(yamlData).map(([folder, name]) => ({
folder,
name
// Open the work/students.yaml file and create a collection from it for Eleventy to render.
const yamlData = yaml.load(fs.readFileSync(studentsYamlPath, 'utf8'));
return Object.entries(yamlData).map(([key, data]) => ({
...data,
folder: key,
}));
});

Expand Down
Binary file removed work/elif-koc/featured.jpg
Binary file not shown.
188 changes: 0 additions & 188 deletions work/elif-koc/index.html

This file was deleted.

5 changes: 0 additions & 5 deletions work/elif-koc/style.css

This file was deleted.

2 changes: 1 addition & 1 deletion work/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: All Student Work
{% for student in collections.students %}
<section>
<a href="/work/{{ student.folder }}/">
<img src="/work/{{ student.folder }}/featured.jpg">
<img src="/work/{{ student.folder }}/{{ student.featured }}">
</a>
<h2>{{ student.name }}</h2>
</section>
Expand Down
93 changes: 69 additions & 24 deletions work/students.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,69 @@
hao-lee: Hao Lee
kitae-kim: Kitae Kim
manas-bhatia: Manas Bhatia
pear-jansomwong: Pear Jansomwong
fern-itthisang: Fern Itthisang
john-masataka-jiang: John Masataka Xianfeng Jiang
judd-smith: Judd Smith
yilin-zheng: Yilin Zheng
badriyah-alsalem: Badriyah Alsalem
xiaoya-wang: Xiaoya Wang
yuxi-dai: Yuxi Dai
julia-kwon: Julia Kwon
sebastian-schloesser: Sebastian Schloesser
siqi-zhang: Siqi Zhang
chengxiu-yin: Chengxiu Yin
zihe-wang: Zihe Wang
yuchao-ma: Yuchao Ma
catherine-ye: Catherine Ye
genda-lin: Genda Lin
vaibhav-jain: Vaibhav Jain
chen-feng: Chen Feng
christina-huang: Christina Huang
elif-koc: Elif Koc
suji-lee: Suji Lee
hao-lee:
name: Hao Lee
featured: featured.jpg
kitae-kim:
name: Kitae Kim
featured: featured.jpg
manas-bhatia:
name: Manas Bhatia
featured: featured.jpg
pear-jansomwong:
name: Pear Jansomwong
featured: featured.jpg
fern-itthisang:
name: Fern Itthisang
featured: featured.jpg
john-masataka-jiang:
name: John Masataka Xianfeng Jiang
featured: featured.jpg
judd-smith:
name: Judd Smith
featured: featured.jpg
yilin-zheng:
name: Yilin Zheng
featured: featured.jpg
badriyah-alsalem:
name: Badriyah Alsalem
featured: featured.jpg
xiaoya-wang:
name: Xiaoya Wang
featured: featured.jpg
yuxi-dai:
name: Yuxi Dai
featured: featured.jpg
julia-kwon:
name: Julia Kwon
featured: featured.jpg
sebastian-schloesser:
name: Sebastian Schloesser
featured: featured.jpg
siqi-zhang:
name: Siqi Zhang
featured: featured.jpg
chengxiu-yin:
name: Chengxiu Yin
featured: featured.jpg
zihe-wang:
name: Zihe Wang
featured: featured.jpg
yuchao-ma:
name: Yuchao Ma
featured: featured.jpg
catherine-ye:
name: Catherine Ye
featured: featured.jpg
genda-lin:
name: Genda Lin
featured: featured.jpg
vaibhav-jain:
name: Vaibhav Jain
featured: featured.jpg
chen-feng:
name: Chen Feng
featured: featured.jpg
christina-huang:
name: Christina Huang
featured: featured.jpg
suji-lee:
name: Suji Lee
featured: featured.jpg

0 comments on commit 36ef8ce

Please sign in to comment.