Skip to content

Commit

Permalink
fix cfp extension and remove twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperDramsch committed Oct 13, 2024
1 parent 7536013 commit 625d08c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 17 deletions.
4 changes: 1 addition & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ url: 'https://pythondeadlin.es'
domain: 'pythondeadlin.es'
baseurl: ''

twitter_username: jesperdramsch
twitter_hashtag: python
github_username: jesperdramsch
github_repo: python-deadlines
Expand Down Expand Up @@ -49,7 +48,6 @@ plugins:
author:
name: Jesper Dramsch
url: https://dramsch.net
twitter: jesperdramsch


social:
Expand All @@ -59,6 +57,7 @@ social:
- https://www.dramsch.net/mastodon
- https://www.dramsch.net/threads
- https://www.dramsch.net/github
- https://www.dramsch.net/youtube

languages:
- en
Expand All @@ -69,7 +68,6 @@ exclude_from_localizations:
- 'static'

twitter:
username: jesperdramsch
card: summary

maps:
Expand Down
1 change: 1 addition & 0 deletions _i18n/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ global:
es: 'Espanol'
de: 'Deutsch'
cfp: 'Aufruf zur Teilnahme'
cfp_ext: 'CfP verlängert von'
titles:
default: 'Deadlines für Python-Konferenzen'
archive: 'Archiv für Python-Konferenzen'
Expand Down
1 change: 1 addition & 0 deletions _i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ global:
es: 'Espanol'
de: 'Deutsch'
cfp: 'Call for Participation'
cfp_ext: 'CfP extended from'
titles:
default: 'Python Conference Deadlines'
archive: 'Past Python Conferences'
Expand Down
1 change: 1 addition & 0 deletions _i18n/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ global:
es: 'Espanol'
de: 'Deutsch'
cfp: 'Llamada por participación'
cfp_ext: 'CfP extendido de'
titles:
default: 'Fechas Limites de Conferencias de Python '
archive: 'Conferencias anteriores de Python'
Expand Down
41 changes: 27 additions & 14 deletions _layouts/conference.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
description: Countdown for the Call for Participation of this conference including conference dates and details.
---

{% if page.cfp_ext %}
{% assign cfp = page.cfp_ext %}
{% else %}
{% assign cfp = page.cfp %}
{% endif %}

<html>
<head>
{% include head.html %}
Expand Down Expand Up @@ -84,7 +90,7 @@ <h3 id="conf-subtitle">a.k.a. {{page.alt_name}} {{page.year}}</h3>
</div>
<div id="page-content">
<div id="conf-deadline-timer" class="row">
<div id="cfp-timer" class="col-12 conf-timer">{% if page.cfp == "TBA" or page.cfp == "Cancelled" or page.cfp == "None" %}{{page.cfp}}{%endif%}
<div id="cfp-timer" class="col-12 conf-timer">{% if cfp == "TBA" or cfp == "Cancelled" or cfp == "None" %}{{cfp}}{%endif%}
</div>
</div>
<div id="conf-key-facts" class="row">
Expand All @@ -102,6 +108,13 @@ <h3 id="conf-subtitle">a.k.a. {{page.alt_name}} {{page.year}}</h3>
<img src="/static/img/203-earth.svg" class="badge-link" alt="Earth Icon" width="16" height="16" />
<a id="conf-website" target="_blank" href="{{page.link}}">{{page.link}}</a>
</div>
{% if page.cfp_ext %}
<div>
<img src="/static/img/035-file-text.svg" class="badge-link" alt="Document Icon for original CfP" width="16"
height="16" />
<span id="conf-cfp_ext">{% t global.cfp_ext %} {{page.cfp}}</span>
</div>
{% endif %}
{% if page.cfp_link %}
<div>
<img src="/static/img/035-file-text.svg" class="badge-link" alt="Document Icon for CfP link" width="16"
Expand Down Expand Up @@ -210,14 +223,14 @@ <h3 id="conf-subtitle">a.k.a. {{page.alt_name}} {{page.year}}</h3>
{% endif %}
</div>
<footer>
</footer>
</div>
{% include_cached footer.html %}
{% include_cached footer.html %}

{% assign title_length = page.title | size | minus: 26 %}
{% assign sliced_title = page.title | slice: 0, title_length %}
{% assign title_length = page.title | size | minus: 26 %}
{% assign sliced_title = page.title | slice: 0, title_length %}

{% include_cached trademarks.html title=sliced_title %}
{% include_cached trademarks.html title=sliced_title %}
</footer>
</div>
<script type="text/javascript" charset="utf-8">
$(function () {
// Timezone deadline shenanigans
Expand All @@ -234,22 +247,22 @@ <h3 id="conf-subtitle">a.k.a. {{page.alt_name}} {{page.year}}</h3>
$('.local-timezone').text(today.toFormat('z'));

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

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

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

Expand Down

0 comments on commit 625d08c

Please sign in to comment.