-
Notifications
You must be signed in to change notification settings - Fork 19
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
Schedule Section #129
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.