Skip to content

Schedule Section #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 129 additions & 66 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,71 +1,134 @@
const htmlmin = require("html-minifier");
const markdownIt = require('markdown-it');
const markdownIt = require("markdown-it");
const pluginRss = require("@11ty/eleventy-plugin-rss");

const isProd = process.env.ELEVENTY_ENV === 'prod'
const outDir = 'public'
const isProd = process.env.ELEVENTY_ENV === "prod";
const outDir = "public";

module.exports = function (eleventyConfig) {
// PLUGINS
eleventyConfig.addPlugin(pluginRss);

// shortcode to render markdown from string => {{ STRING | markdown | safe }}
eleventyConfig.addFilter('markdown', function(value) {
let markdown = require('markdown-it')({
html: true
});
return markdown.render(value);
});

// rebuild on CSS changes
eleventyConfig.addWatchTarget('./src/_includes/css/');

// Markdown
eleventyConfig.setLibrary(
'md',
markdownIt({
html: true,
breaks: true,
linkify: true,
typographer: true
})
)

//create collections
eleventyConfig.addCollection('sections', async (collection) => {
return collection.getFilteredByGlob('./src/sections/*.md');
});

// STATIC FILES
eleventyConfig.addPassthroughCopy({ './src/static/': '/' });

// TRANSFORM -- Minify HTML Output
eleventyConfig.addTransform("htmlmin", function(content, outputPath) {
if( outputPath && outputPath.endsWith(".html") ) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
});
return minified;
}
return content;
});

return {
pathPrefix: isProd ? "inpycon2025" : "",
dir: {
input: 'src',
output: outDir,
data: './_data',
includes: './_includes',
layouts: './_layouts'
},
templateFormats: [
'md',
'njk',
'11ty.js'
],
htmlTemplateEngine: 'njk'
};
};
// PLUGINS
eleventyConfig.addPlugin(pluginRss);

// shortcode to render markdown from string => {{ STRING | markdown | safe }}
eleventyConfig.addFilter("markdown", function (value) {
let markdown = require("markdown-it")({
html: true,
});
return markdown.render(value);
});

eleventyConfig.addFilter("dateInfo", function (dateStr) {
// Get day of month
const dayOfMonth = parseInt(dateStr.split("-")[2]);

// Default result
let result = {
dayName: "NA",
monthDay: "NA",
label: "NA",
};

// Mapping logic
switch (dayOfMonth) {
case 12:
result = {
dayName: "Friday",
monthDay: "September 12th",
label: "Workshop Day",
};
break;
case 13:
result = {
dayName: "Saturday",
monthDay: "September 13th",
label: "Conference Day 1",
};
break;
case 14:
result = {
dayName: "Sunday",
monthDay: "September 14th",
label: "Conference Day 2",
};
break;
case 15:
result = {
dayName: "Monday",
monthDay: "September 15th",
label: "DevSprint",
};
break;
}

return result;
});

eleventyConfig.addFilter("getEndTime", function (startTime, duration) {
const [sh, sm] = startTime.split(":").map(Number);
const [dh, dm] = duration.split(":").map(Number);

// Total minutes
let totalMinutes = sh * 60 + sm + dh * 60 + dm;

// Calculate end hour and minutes
let endHour = Math.floor(totalMinutes / 60);
let endMinute = totalMinutes % 60;

// Wrap around 24 hours (optional, if needed)
if (endHour >= 24) endHour = endHour % 24;

// Pad with zero if needed
const endHourStr = endHour.toString().padStart(2, "0");
const endMinuteStr = endMinute.toString().padStart(2, "0");

return `${endHourStr}:${endMinuteStr}`;
});

// rebuild on CSS changes
eleventyConfig.addWatchTarget("./src/_includes/css/");

// Markdown
eleventyConfig.setLibrary(
"md",
markdownIt({
html: true,
breaks: true,
linkify: true,
typographer: true,
})
);

//create collections
eleventyConfig.addCollection("sections", async (collection) => {
return collection.getFilteredByGlob("./src/sections/*.md");
});

// STATIC FILES
eleventyConfig.addPassthroughCopy({ "./src/static/": "/" });

// TRANSFORM -- Minify HTML Output
eleventyConfig.addTransform("htmlmin", function (content, outputPath) {
if (outputPath && outputPath.endsWith(".html")) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true,
});
return minified;
}
return content;
});

return {
pathPrefix: isProd ? "inpycon2025" : "",
dir: {
input: "src",
output: outDir,
data: "./_data",
includes: "./_includes",
layouts: "./_layouts",
},
templateFormats: ["md", "njk", "11ty.js"],
htmlTemplateEngine: "njk",
};
};
132 changes: 132 additions & 0 deletions src/_data/scheduleFixed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
[
{
"index": 1,
"title": "Sept. 12th",
"day": "Friday",
"description": "WORKSHOP DAY",
"type": "workshop",
"schedule": []
},
{
"index": 2,
"title": "Sept. 13th",
"day": "Saturday",
"description": "CONFERENCE DAY 1",
"type": "conference",
"schedule": [
{
"start_time": "07:30",
"end_time": "08:45",
"title": "Registrations / Breakfast",
"color": "#CD89FF"
},
{
"start_time": "09:00",
"end_time": "09:15",
"title": "Opening Address",
"color": "#1FFFB4"
},
{
"start_time": "09:20",
"end_time": "10:00",
"title": "Keynote 1",
"color": "#E745A0"
},
{
"start_time": "12:40",
"end_time": "14:00",
"title": "Lunch",
"color": "#CD89FF"
},
{
"start_time": "14:00",
"end_time": "14:40",
"title": "Lightning Talks",
"color": "#1FFFB4"
},
{
"start_time": "16:00",
"end_time": "16:20",
"title": "Poster Presentations / High Tea",
"color": "#CD89FF"
},
{
"start_time": "17:00",
"end_time": "17:40",
"title": "Keynote 2",
"color": "#E745A0"
},
{
"start_time": "17:45",
"end_time": "18:00",
"title": "Closing Address",
"color": "#1FFFB4"
}
]
},
{
"index": 3,
"title": "Sept. 14th",
"day": "Sunday",
"description": "CONFERENCE DAY 2",
"type": "conference",
"schedule": [
{
"start_time": "07:30",
"end_time": "08:45",
"title": "Registrations / Breakfast",
"color": "#CD89FF"
},
{
"start_time": "09:00",
"end_time": "09:15",
"title": "Opening Address",
"color": "#1FFFB4"
},
{
"start_time": "09:20",
"end_time": "10:00",
"title": "Keynote 3",
"color": "#E745A0"
},
{
"start_time": "12:40",
"end_time": "14:00",
"title": "Lunch",
"color": "#CD89FF"
},
{
"start_time": "14:00",
"end_time": "14:40",
"title": "Lightning Talks",
"color": "#1FFFB4"
},
{
"start_time": "16:00",
"end_time": "16:20",
"title": "Poster Presentations / High Tea",
"color": "#CD89FF"
},
{
"start_time": "17:00",
"end_time": "17:40",
"title": "Keynote 4",
"color": "#E745A0"
},
{
"start_time": "17:45",
"end_time": "18:00",
"title": "Closing Address",
"color": "#1FFFB4"
}
]
},
{
"index": 4,
"title": "Sept. 15th",
"day": "Monday",
"description": "DevSprint",
"type": "devsprint",
"schedule": []
}
]
9 changes: 8 additions & 1 deletion src/_includes/navbar.njk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
{"name": "FAQ's", "link": "about/faqs"}
]
},
{
"name": "Schedule",
"link": "program/schedule",
"hasSubmenu": false,
"isExternal": false
},
{
"name": "CFP",
"hasSubmenu": true,
Expand All @@ -30,7 +36,8 @@
"name": "Program",
"hasSubmenu": true,
"submenu": [
{"name": "Lightning Talks", "link": "program/lightning-talks"}
{"name": "Schedule", "link": "program/schedule"},
{"name": "Lightning Talks", "link": "program/lightning-talks"}
]
},
{
Expand Down
Loading