Skip to content

Commit

Permalink
Conference Summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperDramsch committed Feb 26, 2024
1 parent 8af4f24 commit 565bfae
Show file tree
Hide file tree
Showing 2 changed files with 330 additions and 33 deletions.
76 changes: 43 additions & 33 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,72 @@ title: Python Conference Deadlines # (Maintained by @jesperdramsch)
description: Countdowns to your favourite Python conferences with calls for participation and resources to submit awesome talks!
tagline: Countdowns to your favourite Python conferences

url: "https://pythondeadlin.es"
domain: "pythondeadlin.es"
url: 'https://pythondeadlin.es'
domain: 'pythondeadlin.es'

twitter_username: jesperdramsch
twitter_hashtag: python
github_username: jesperdramsch
github_repo: python-deadlines

markdown: kramdown
ga_id:
ga_id:
adsense_id: ca-pub-2158291969836277

include: ['_pages']

collections:
posts:
output: true
permalink: /resources/:title/index:output_ext
posts:
output: true
permalink: /resources/:title/index:output_ext

plugins:
- jekyll-sitemap
- jekyll-seo-tag
- jekyll-datapage-generator
- jekyll-maps
- jekyll-sitemap
- jekyll-seo-tag
- jekyll-datapage-generator
- jekyll-maps

author:
name: Jesper Dramsch
url: https://dramsch.net
twitter: jesperdramsch
name: Jesper Dramsch
url: https://dramsch.net
twitter: jesperdramsch

social:
name: Jesper Dramsch
links:
- https://twitter.com/JesperDramsch
- https://www.dramsch.net/linkedin
- https://www.dramsch.net/mastodon
- https://www.dramsch.net/github
name: Jesper Dramsch
links:
- https://twitter.com/JesperDramsch
- https://www.dramsch.net/linkedin
- https://www.dramsch.net/mastodon
- https://www.dramsch.net/github

twitter:
username: jesperdramsch
card: summary
username: jesperdramsch
card: summary

maps:
google:
api_key: AIzaSyCEJ_S3OFxqrOfgx5WdSEMl8hxzgTFEw20
google:
api_key: AIzaSyCEJ_S3OFxqrOfgx5WdSEMl8hxzgTFEw20

page_gen-dirs: true

page_gen:
- data: 'conferences'
template: 'conference'
dir: 'conference'
name_expr: record['title'].downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')+"-"+record['year'].to_s
title_expr: record['title']+" "+record['year'].to_s+" Conference Deadlines"
- data: 'archive'
template: 'conference'
dir: 'conference'
name_expr: record['title'].downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')+"-"+record['year'].to_s
title_expr: record['title']+" "+record['year'].to_s+" Conference Deadlines"
- data: 'conferences'
template: 'conference'
dir: 'conference'
name_expr: "#{record['title'].downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')}-#{record['year']}".gsub('--', '-')
title_expr: "#{record['title']} #{record['year']} Conference Deadlines"
- data: 'archive'
template: 'conference'
dir: 'conference'
name_expr: "#{record['title'].downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')}-#{record['year']}".gsub('--', '-')
title_expr: "#{record['title']} #{record['year']} Conference Deadlines"
- data: 'conferences'
template: 'summary'
dir: 'series'
name_expr: "#{record['title'].downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')}".gsub('--', '-')
title_expr: "#{record['title']} Conference Summary"
- data: 'archive'
template: 'summary'
dir: 'series'
name_expr: "#{record['title'].downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')}".gsub('--', '-')
title_expr: "#{record['title']} Conference Summary"
287 changes: 287 additions & 0 deletions _layouts/summary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
---
description: Summary of the conference and its instances throughout the years.
---

<html>

<head>
{% include head.html %}
{% if page.mastodon %}
<link rel="stylesheet" type="text/css" href="{{ "/static/css/mastodon.css" | prepend:site.baseurl }}">
<script>
document.addEventListener("DOMContentLoaded", function () {
fetch("{{page.mastodon}}.rss")
.then(function (response) {
return response.text();
})
.then(function (xmlText) {
var parser = new DOMParser();
var xml = parser.parseFromString(xmlText, "text/xml");
var items = xml.querySelectorAll("item");
var feedContainer = document.getElementById("mastodon-feed");
var postLimit = 2; // Number of posts to display

for (var i = 0; i < postLimit && i < items.length; i++) {
var item = items[i];
var post = item.querySelector("description").textContent;
var link = item.querySelector("link").textContent;
var pubDate = item.querySelector("pubDate").textContent;

var feedItem = document.createElement("div");
feedItem.setAttribute("class", "timeline-item")
feedItem.innerHTML = '<div class="timeline-content">' + post + '</div><a href="' + link + '">' + pubDate + ' by {{page.title}}</a>';
feedContainer.appendChild(feedItem);
}
})
.catch(function (error) {
console.log("Error fetching Mastodon RSS feed:", error);
});
});
</script>
{% elsif page.twitter %}
<style>
#twitter-widget {
width: 100%;
}

.twitter-timeline {
width: 100% !important;
}
</style>
{% endif %}
</head>

<body>
{% include header.html %}
<div class="container">
<div class="page-header" id="conf-title">
<div class="row">
<div class="col-sm-12">
<h1>
<span id="conf-title-href" href="/summary/{{page.title | slugify}}/">{{page.title}}</span>
<span id="twitter-box"><a href="https://twitter.com/share" class="twitter-share-button"
data-text="Conference instances for the #{{ page.title }} conference!" data-show-count="false"
style="font-size:13px;">Tweet</a>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</span>
</h1>
</div>
</div>
<div class="row">
<div class="col-sm-12" id="conf-subs">
<span id="conf-subs" title="Conference subjects">
{% assign subs = page.sub | split: "," %}
{% for sub in subs %}
<span class="{{sub}}-tag badge badge-light conf-sub conf-{{sub}}">
{% for tp in site.data.types %}
{% if sub == tp.sub %}
{{tp.name}}
{% endif %}
{% endfor %}
</span>
{% endfor %}
</span>
</div>
</div>
</div>
<div id="page-content">
<div class="col-12 col-md-6">
{% if page.mastodon %}
<!-- Mastodon timeline -->
<div class="meta">Mastodon Posts by {{page.title}}:</div>
<div id="mastodon-feed"></div>
<a href="{{ page.mastodon }}">See all Mastodon posts for {{ page.title }}</a>
{% elsif page.twitter %}
<!-- Twitter timeline -->
<div id="twitter-widget">
<a class="twitter-timeline" href="https://twitter.com/{{page.twitter}}" data-tweet-limit=2>Tweets by
{{page.twitter}}</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
{% endif %}
</div>
</div>
<div class="row">
{% google_map zoom="6" width="100%" title="{{page.title}}" %}
</div>
<div>
{% for conf in site.data.conferences + site.data.archive %}
{% if conf.title == page.title %}
{% assign subs = conf.sub | split: "," %}
<div id="{{conf.title | slugify}}-{{conf.year}}"
class="ConfItem {% for sub in subs %} {{sub | strip}}-conf {% endfor %}">
<div class="row conf-row">
<div class="col-6">
<span class="conf-title">
<a title="Deadline Details"
href="{{site.baseurl}}/conference/{{conf.title | slugify}}-{{conf.year}}/">{{conf.title}} {{conf.year}}</a>
</span>
<span class="conf-title-small">
<a title="Deadline Details"
href="{{site.baseurl}}/conference/{{conf.title | slugify}}-{{conf.year}}/">{{conf.title}} '{{conf.year |
slice: -2, 3}}</a>
</span>
<span class="conf-title-icon">
<a title="Conference Website" href="{{conf.link}}" target="_blank"><img src="/static/img/203-earth.svg"
class="badge-link" alt="Link to Conference Website" width="16" height="16" /></a>
&ZeroWidthSpace;
</span>
{% if conf.cfp_link %}
<span class="conf-title-icon">
<a title="Call for Participation for {{conf.title}}" href="{{conf.cfp_link}}" target="_blank"><img
src="/static/img/035-file-text.svg" class="badge-link"
alt="Link to Call for Participation for {{conf.title}}" width="16" height="16" /></a>
&ZeroWidthSpace;
</span>
{% endif %}
{% if conf.finaid %}
<span class="conf-title-icon">
<a title="Financial Aid from {{conf.title}}" href="{{conf.finaid}}" target="_blank"><img
src="/static/img/066-lifebuoy.svg" class="badge-link" alt="Link to Sponsorship page of {{conf.title}}"
width="16" height="16" /></a>
&ZeroWidthSpace;
</span>
{% endif %}
{% if conf.sponsor %}
<span class="conf-title-icon">
<a title="Sponsorship Opportunity for {{conf.title}}" href="{{conf.sponsor}}" target="_blank"><img
src="/static/img/060-coin-dollar.svg" class="badge-link" alt="Link to Sponsorship page of {{conf.title}}"
width="16" height="16" /></a>
&ZeroWidthSpace;
</span>
{% endif %}
{% if conf.mastodon %}
<span class="conf-title-icon">
<a title="Mastodon for {{conf.title}}" href="{{conf.mastodon}}" target="_blank"><img
src="/static/img/407-mastodon.svg" class="badge-link" alt="Link to Conference Mastodon" width="16"
height="16" /></a>
&ZeroWidthSpace;
</span>
{% elsif conf.twitter %}
<span class="conf-title-icon">
<a title="Twitter for {{conf.title}}" href="https://twitter.com/{{conf.twitter}}" target="_blank"><img
src="/static/img/407-twitter.svg" class="badge-link" alt="Link to Conference Twitter" width="16"
height="16" /></a>
&ZeroWidthSpace;
</span>
{% endif %}
</div>
<div class="col-6">
<span class="timer"></span>
<span class="timer-small"></span>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-6">
<div class="meta">
<span class="conf-date">{{conf.date}}.</span>
<span class="conf-place">
{% if conf.place == "Online" %}
<a href="#">{{conf.place}}</a>.
{% else %}
<a href="http://maps.google.com/?q={{conf.place}}">{{conf.place}}</a>.
{% endif %}
</span>
</div>
{% if conf.note %}
<div class="note">
<b>Note: </b>{{conf.note}}
</div>
{% endif %}

</div>
<div class="col-12 col-sm-6">
<div class="deadline">
<div>Deadline:
<span class="deadline-time"></span>
</div>
</div>

</div>
</div>
<div class="row">
<div class="col-6">
{% assign subs = conf.sub | split: "," %}
{% for sub in subs %}
<span title="Click to only show {{sub | strip}} conferences" data-sub="{{sub | strip}}"
class="badge badge-light conf-sub {{sub | strip}}-tag"></span>
{% endfor %}
</div>
<div class="col-6">
<div class="calendar"></div>
</div>
</div>
<hr>
</div>
{% endif %}
{% endfor %}
</div>
<footer>
{% include footer.html %}
</footer>
</div>
<script type="text/javascript" charset="utf-8">
$(function () {
// Timezone deadline shenanigans
var url = new URL(window.location);
var conf = url.searchParams.get('id');

var DateTime = luxon.DateTime;
var today = DateTime.now();

{% include load_data.js %}
{% include utils.js %}

$('.local-timezone').text(today.toFormat('z'));

// other
{% if page.cfp == "TBA" %}
$('#cfp-timer').html("TBA");
$('.deadline-time').html("TBA");
$('.deadline-local-time').html("TBA");
{% else %}

// Use specified timezone for deadlines if available else use AoE timezone
{% if page.timezone %}
var confDeadline = DateTime.fromSQL("{{page.cfp}}", { zone: "{{page.timezone}}" });
{% else %}
var confDeadline = DateTime.fromSQL("{{page.cfp}}", { zone: "UTC-12" });
{% endif %}

// check if timezone is valid otherwise replace by system timezone
if (confDeadline.invalid) {
var confDeadline = DateTime.fromSQL("{{page.cfp}}");
console.log("Invalid timezone. Using system timezone instead.");
}

// add calendar
var conferenceDeadlineCalendar = createCalendarFromObject({
id: '{{conf.title | slugify}}-{{conf.year}}',
title: '{{page.title}} {{page.year}} deadline',
date: confDeadline.toJSDate(),
duration: 60,
});
document.querySelector('#conference-deadline').appendChild(conferenceDeadlineCalendar);

// render countdown timer
$('#cfp-timer').countdown(confDeadline.toJSDate(), function (event) {
$(this).html(event.strftime('%D days %Hh %Mm %Ss'));
});

// render deadline conference time
{% if page.timezone %}
$('.deadline-time').html(confDeadline.setZone("{{page.timezone}}").toLocaleString(DateTime.DATETIME_HUGE_WITH_SECONDS));
{% else %}
$('.deadline-time').html(confDeadline.setZone("UTC-12").toLocaleString(DateTime.DATETIME_HUGE_WITH_SECONDS));
{% endif %}

// render deadline in local timezone
$('.deadline-local-time').html(confDeadline.setZone('system').toLocaleString(DateTime.DATETIME_HUGE_WITH_SECONDS));

{% endif %}

});
</script>
</body>

</html>

0 comments on commit 565bfae

Please sign in to comment.