Skip to content

Commit f6cc563

Browse files
Astraxx04bhavin192
authored andcommitted
schedule section
1 parent a7180c6 commit f6cc563

File tree

6 files changed

+600
-67
lines changed

6 files changed

+600
-67
lines changed

.eleventy.js

Lines changed: 129 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,134 @@
11
const htmlmin = require("html-minifier");
2-
const markdownIt = require('markdown-it');
2+
const markdownIt = require("markdown-it");
33
const pluginRss = require("@11ty/eleventy-plugin-rss");
44

5-
const isProd = process.env.ELEVENTY_ENV === 'prod'
6-
const outDir = 'public'
5+
const isProd = process.env.ELEVENTY_ENV === "prod";
6+
const outDir = "public";
77

88
module.exports = function (eleventyConfig) {
9-
// PLUGINS
10-
eleventyConfig.addPlugin(pluginRss);
11-
12-
// shortcode to render markdown from string => {{ STRING | markdown | safe }}
13-
eleventyConfig.addFilter('markdown', function(value) {
14-
let markdown = require('markdown-it')({
15-
html: true
16-
});
17-
return markdown.render(value);
18-
});
19-
20-
// rebuild on CSS changes
21-
eleventyConfig.addWatchTarget('./src/_includes/css/');
22-
23-
// Markdown
24-
eleventyConfig.setLibrary(
25-
'md',
26-
markdownIt({
27-
html: true,
28-
breaks: true,
29-
linkify: true,
30-
typographer: true
31-
})
32-
)
33-
34-
//create collections
35-
eleventyConfig.addCollection('sections', async (collection) => {
36-
return collection.getFilteredByGlob('./src/sections/*.md');
37-
});
38-
39-
// STATIC FILES
40-
eleventyConfig.addPassthroughCopy({ './src/static/': '/' });
41-
42-
// TRANSFORM -- Minify HTML Output
43-
eleventyConfig.addTransform("htmlmin", function(content, outputPath) {
44-
if( outputPath && outputPath.endsWith(".html") ) {
45-
let minified = htmlmin.minify(content, {
46-
useShortDoctype: true,
47-
removeComments: true,
48-
collapseWhitespace: true
49-
});
50-
return minified;
51-
}
52-
return content;
53-
});
54-
55-
return {
56-
pathPrefix: isProd ? "inpycon2025" : "",
57-
dir: {
58-
input: 'src',
59-
output: outDir,
60-
data: './_data',
61-
includes: './_includes',
62-
layouts: './_layouts'
63-
},
64-
templateFormats: [
65-
'md',
66-
'njk',
67-
'11ty.js'
68-
],
69-
htmlTemplateEngine: 'njk'
70-
};
71-
};
9+
// PLUGINS
10+
eleventyConfig.addPlugin(pluginRss);
11+
12+
// shortcode to render markdown from string => {{ STRING | markdown | safe }}
13+
eleventyConfig.addFilter("markdown", function (value) {
14+
let markdown = require("markdown-it")({
15+
html: true,
16+
});
17+
return markdown.render(value);
18+
});
19+
20+
eleventyConfig.addFilter("dateInfo", function (dateStr) {
21+
// Get day of month
22+
const dayOfMonth = parseInt(dateStr.split("-")[2]);
23+
24+
// Default result
25+
let result = {
26+
dayName: "NA",
27+
monthDay: "NA",
28+
label: "NA",
29+
};
30+
31+
// Mapping logic
32+
switch (dayOfMonth) {
33+
case 12:
34+
result = {
35+
dayName: "Friday",
36+
monthDay: "September 12th",
37+
label: "Workshop Day",
38+
};
39+
break;
40+
case 13:
41+
result = {
42+
dayName: "Saturday",
43+
monthDay: "September 13th",
44+
label: "Conference Day 1",
45+
};
46+
break;
47+
case 14:
48+
result = {
49+
dayName: "Sunday",
50+
monthDay: "September 14th",
51+
label: "Conference Day 2",
52+
};
53+
break;
54+
case 15:
55+
result = {
56+
dayName: "Monday",
57+
monthDay: "September 15th",
58+
label: "DevSprint",
59+
};
60+
break;
61+
}
62+
63+
return result;
64+
});
65+
66+
eleventyConfig.addFilter("getEndTime", function (startTime, duration) {
67+
const [sh, sm] = startTime.split(":").map(Number);
68+
const [dh, dm] = duration.split(":").map(Number);
69+
70+
// Total minutes
71+
let totalMinutes = sh * 60 + sm + dh * 60 + dm;
72+
73+
// Calculate end hour and minutes
74+
let endHour = Math.floor(totalMinutes / 60);
75+
let endMinute = totalMinutes % 60;
76+
77+
// Wrap around 24 hours (optional, if needed)
78+
if (endHour >= 24) endHour = endHour % 24;
79+
80+
// Pad with zero if needed
81+
const endHourStr = endHour.toString().padStart(2, "0");
82+
const endMinuteStr = endMinute.toString().padStart(2, "0");
83+
84+
return `${endHourStr}:${endMinuteStr}`;
85+
});
86+
87+
// rebuild on CSS changes
88+
eleventyConfig.addWatchTarget("./src/_includes/css/");
89+
90+
// Markdown
91+
eleventyConfig.setLibrary(
92+
"md",
93+
markdownIt({
94+
html: true,
95+
breaks: true,
96+
linkify: true,
97+
typographer: true,
98+
})
99+
);
100+
101+
//create collections
102+
eleventyConfig.addCollection("sections", async (collection) => {
103+
return collection.getFilteredByGlob("./src/sections/*.md");
104+
});
105+
106+
// STATIC FILES
107+
eleventyConfig.addPassthroughCopy({ "./src/static/": "/" });
108+
109+
// TRANSFORM -- Minify HTML Output
110+
eleventyConfig.addTransform("htmlmin", function (content, outputPath) {
111+
if (outputPath && outputPath.endsWith(".html")) {
112+
let minified = htmlmin.minify(content, {
113+
useShortDoctype: true,
114+
removeComments: true,
115+
collapseWhitespace: true,
116+
});
117+
return minified;
118+
}
119+
return content;
120+
});
121+
122+
return {
123+
pathPrefix: isProd ? "inpycon2025" : "",
124+
dir: {
125+
input: "src",
126+
output: outDir,
127+
data: "./_data",
128+
includes: "./_includes",
129+
layouts: "./_layouts",
130+
},
131+
templateFormats: ["md", "njk", "11ty.js"],
132+
htmlTemplateEngine: "njk",
133+
};
134+
};

src/_data/scheduleFixed.json

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
[
2+
{
3+
"index": 1,
4+
"title": "Sept. 12th",
5+
"day": "Friday",
6+
"description": "WORKSHOP DAY",
7+
"type": "workshop",
8+
"schedule": []
9+
},
10+
{
11+
"index": 2,
12+
"title": "Sept. 13th",
13+
"day": "Saturday",
14+
"description": "CONFERENCE DAY 1",
15+
"type": "conference",
16+
"schedule": [
17+
{
18+
"start_time": "07:30",
19+
"end_time": "08:45",
20+
"title": "Registrations / Breakfast",
21+
"color": "#CD89FF"
22+
},
23+
{
24+
"start_time": "09:00",
25+
"end_time": "09:15",
26+
"title": "Opening Address",
27+
"color": "#1FFFB4"
28+
},
29+
{
30+
"start_time": "09:20",
31+
"end_time": "10:00",
32+
"title": "Keynote 1",
33+
"color": "#E745A0"
34+
},
35+
{
36+
"start_time": "12:40",
37+
"end_time": "14:00",
38+
"title": "Lunch",
39+
"color": "#CD89FF"
40+
},
41+
{
42+
"start_time": "14:00",
43+
"end_time": "14:40",
44+
"title": "Lightning Talks",
45+
"color": "#1FFFB4"
46+
},
47+
{
48+
"start_time": "16:00",
49+
"end_time": "16:20",
50+
"title": "Poster Presentations / High Tea",
51+
"color": "#CD89FF"
52+
},
53+
{
54+
"start_time": "17:00",
55+
"end_time": "17:40",
56+
"title": "Keynote 2",
57+
"color": "#E745A0"
58+
},
59+
{
60+
"start_time": "17:45",
61+
"end_time": "18:00",
62+
"title": "Closing Address",
63+
"color": "#1FFFB4"
64+
}
65+
]
66+
},
67+
{
68+
"index": 3,
69+
"title": "Sept. 14th",
70+
"day": "Sunday",
71+
"description": "CONFERENCE DAY 2",
72+
"type": "conference",
73+
"schedule": [
74+
{
75+
"start_time": "07:30",
76+
"end_time": "08:45",
77+
"title": "Registrations / Breakfast",
78+
"color": "#CD89FF"
79+
},
80+
{
81+
"start_time": "09:00",
82+
"end_time": "09:15",
83+
"title": "Opening Address",
84+
"color": "#1FFFB4"
85+
},
86+
{
87+
"start_time": "09:20",
88+
"end_time": "10:00",
89+
"title": "Keynote 3",
90+
"color": "#E745A0"
91+
},
92+
{
93+
"start_time": "12:40",
94+
"end_time": "14:00",
95+
"title": "Lunch",
96+
"color": "#CD89FF"
97+
},
98+
{
99+
"start_time": "14:00",
100+
"end_time": "14:40",
101+
"title": "Lightning Talks",
102+
"color": "#1FFFB4"
103+
},
104+
{
105+
"start_time": "16:00",
106+
"end_time": "16:20",
107+
"title": "Poster Presentations / High Tea",
108+
"color": "#CD89FF"
109+
},
110+
{
111+
"start_time": "17:00",
112+
"end_time": "17:40",
113+
"title": "Keynote 4",
114+
"color": "#E745A0"
115+
},
116+
{
117+
"start_time": "17:45",
118+
"end_time": "18:00",
119+
"title": "Closing Address",
120+
"color": "#1FFFB4"
121+
}
122+
]
123+
},
124+
{
125+
"index": 4,
126+
"title": "Sept. 15th",
127+
"day": "Monday",
128+
"description": "DevSprint",
129+
"type": "devsprint",
130+
"schedule": []
131+
}
132+
]

src/_includes/navbar.njk

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
{"name": "Scholarships", "link": "attend/scholarships"}
1717
]
1818
},
19+
{
20+
"name": "Schedule",
21+
"link": "program/schedule",
22+
"hasSubmenu": false,
23+
"isExternal": false
24+
},
1925
{
2026
"name": "CFP",
2127
"hasSubmenu": true,
@@ -31,7 +37,8 @@
3137
"name": "Program",
3238
"hasSubmenu": true,
3339
"submenu": [
34-
{"name": "Lightning Talks", "link": "program/lightning-talks"}
40+
{"name": "Schedule", "link": "program/schedule"},
41+
{"name": "Lightning Talks", "link": "program/lightning-talks"}
3542
]
3643
},
3744
{

0 commit comments

Comments
 (0)