Consolidate templates by using a slot in a base template

This commit is contained in:
Mikko Ahlroth 2023-03-19 15:18:17 +02:00
parent 886bee453e
commit 25652a7f7d
13 changed files with 514 additions and 498 deletions

View file

@ -1,118 +1,115 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Event 21&period;9&period;2017
TRElixir
</title>
<meta name="description" content="TRElixir is a developer meetup in Tampere focusing on the BEAM ecosystem.">
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="TRElixir RSS feed">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/pure-min.css" integrity="sha384-UQiGfs9ICog+LwheBSRCt1o5cbyKIHbwjWscjemyBMT9YCUMZffs6UqUTd0hObXD" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/grids-responsive-min.css">
<link rel="stylesheet" href="marketing.css">
</head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Event 21&period;9&period;2017
TRElixir
</title>
<meta name="description" content="TRElixir is a developer meetup in Tampere focusing on the BEAM ecosystem.">
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="TRElixir RSS feed">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/pure-min.css" integrity="sha384-UQiGfs9ICog+LwheBSRCt1o5cbyKIHbwjWscjemyBMT9YCUMZffs6UqUTd0hObXD" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/grids-responsive-min.css">
<link rel="stylesheet" href="marketing.css">
</head>
<body>
<header class="header">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<a class="pure-menu-heading" href="/">⬅ TRElixir</a>
<a class="pure-menu-heading" href="/">⬅ TRElixir</a>
</div>
</header>
</div>
</header>
<section class="splash-container event-splash">
</section>
<section class="splash-container event-splash">
</section>
<main class="content-wrapper event-content">
<section id="event" class="content contentpadding">
<h2 class="content-head is-center">Event 21&period;9&period;2017</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<p>
<h2 class="content-head is-center">Event 21&period;9&period;2017</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<p>
The first TRElixir event was on the 21<sup>st</sup> of September at <a href="https://www.google.fi/maps/place/Vincit/@61.4481532,23.8608591,17z/data=!3m1!4b1!4m5!3m4!1s0x468edfb7a8f2c79f:0x71c0801aebd30465!8m2!3d61.4481532!4d23.8630531">Vincit premises in Hervanta, Tampere</a>.
</p>
<p>
The event is graciously hosted by <a href="https&colon;&sol;&sol;vincit&period;com&sol;">Vincit</a>.
<p>
The event is graciously hosted by <a href="https&colon;&sol;&sol;vincit&period;com&sol;">Vincit</a>.
</p>
</div>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<a href="" class="pure-button pure-button-disabled">Signup is closed</a>
</div>
</div>
</section>
<section id="event" class="content contentpadding">
<h2 class="content-head is-center">Talks</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="talk-title">Why Elixir matters</h3>
<img src="mikkonaama2&period;webp" alt="Mikko Ahlroth" title="Mikko Ahlroth" class="speaker-image pure-img" />
<p class="speaker-name">
Mikko Ahlroth, Vincit Oyj
</p>
<p class="speaker-description">
Mikko works primarily as a full stack developer at <a href="https://vincit.com/en">Vincit</a>, but on his free time has dabbled with Elixir since 2013. He has published <a href="https://hex.pm/users/nicd">some packages</a> on hex.pm and runs <a href="https://codestats.net/">Code::Stats</a> on Phoenix.
</p>
</div>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<a href="" class="pure-button pure-button-disabled">Signup is closed</a>
</div>
</div>
</section>
<section id="event" class="content contentpadding">
<h2 class="content-head is-center">Talks</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="talk-title">Why Elixir matters</h3>
<img src="mikkonaama2&period;webp" alt="Mikko Ahlroth" title="Mikko Ahlroth" class="speaker-image pure-img" />
<p class="speaker-name">
Mikko Ahlroth, Vincit Oyj
</p>
<p class="speaker-description">
Mikko works primarily as a full stack developer at <a href="https://vincit.com/en">Vincit</a>, but on his free time has dabbled with Elixir since 2013. He has published <a href="https://hex.pm/users/nicd">some packages</a> on hex.pm and runs <a href="https://codestats.net/">Code::Stats</a> on Phoenix.
</p>
</div>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="talk-title">GenServer &amp; Agent</h3>
</div>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="talk-title">GenServer &amp; Agent</h3>
<img src="jannenaama&period;jpg" alt="Janne Tenhovirta" title="Janne Tenhovirta" class="speaker-image pure-img" />
<p class="speaker-name">
Janne Tenhovirta, Cybersoft
</p>
<p class="speaker-description">
Janne mainly gets his hands dirty in .NET backend development at his job with <a href="http://headpower.fi">Cybersoft, a subsidiary of Headpower</a>. He feels they get dirtier when fiddling with the frontend. He first learned of Elixir's existence in 2015 and started to fool around with it in 2016.
</p>
</div>
</div>
</section>
<img src="jannenaama&period;jpg" alt="Janne Tenhovirta" title="Janne Tenhovirta" class="speaker-image pure-img" />
<p class="speaker-name">
Janne Tenhovirta, Cybersoft
</p>
<p class="speaker-description">
Janne mainly gets his hands dirty in .NET backend development at his job with <a href="http://headpower.fi">Cybersoft, a subsidiary of Headpower</a>. He feels they get dirtier when fiddling with the frontend. He first learned of Elixir's existence in 2015 and started to fool around with it in 2016.
</p>
</div>
</div>
</section>
<footer class="footer l-box is-center">
Tampere background © Tampereen kaupunki, licensed under CC-BY-NC.
</footer>
Tampere background © Tampereen kaupunki, licensed under CC-BY-NC.
</footer>
</main>
</body>
</html>

View file

@ -1,44 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Event 16&period;3&period;2023
TRElixir
</title>
<meta name="description" content="TRElixir is a developer meetup in Tampere focusing on the BEAM ecosystem.">
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="TRElixir RSS feed">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/pure-min.css" integrity="sha384-UQiGfs9ICog+LwheBSRCt1o5cbyKIHbwjWscjemyBMT9YCUMZffs6UqUTd0hObXD" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/grids-responsive-min.css">
<link rel="stylesheet" href="marketing.css">
</head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Event 16&period;3&period;2023
TRElixir
</title>
<meta name="description" content="TRElixir is a developer meetup in Tampere focusing on the BEAM ecosystem.">
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="TRElixir RSS feed">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/pure-min.css" integrity="sha384-UQiGfs9ICog+LwheBSRCt1o5cbyKIHbwjWscjemyBMT9YCUMZffs6UqUTd0hObXD" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/grids-responsive-min.css">
<link rel="stylesheet" href="marketing.css">
</head>
<body>
<header class="header">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<a class="pure-menu-heading" href="/">⬅ TRElixir</a>
<a class="pure-menu-heading" href="/">⬅ TRElixir</a>
</div>
</header>
</div>
</header>
<section class="splash-container event-splash">
</section>
<section class="splash-container event-splash">
</section>
<main class="content-wrapper event-content">
<section id="event" class="content contentpadding">
<h2 class="content-head is-center">Event 16&period;3&period;2023</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<p>
<h2 class="content-head is-center">Event 16&period;3&period;2023</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<p>
The next TRElixir event is on the 16<sup>th</sup> of March at the <a href="https://asiointi.maanmittauslaitos.fi/karttapaikka/?lang=fi&share=customMarker&n=6822019.623407671&e=328371.01345323544&title=Vincit%20City%20Centre&desc=&zoom=10&layers=W3siaWQiOjIsIm9wYWNpdHkiOjEwMH1d-z" target="_blank">Vincit city centre office</a>, <a href="https://technopolisglobal.com/office-spaces/tampere/yliopistonrinne/directions/" target="_blank">Technopolis Yliopistonrinne</a>, Kalevantie 2, Tampere. The evening will start at 18.00. Free attendance. Between and after the talks there will be time to hang around and get to know other devs.
</p>
@ -51,89 +48,89 @@
</p>
<p>
The event is graciously hosted by <a href="https&colon;&sol;&sol;vincit&period;com&sol;">Vincit</a>.
</p>
</div>
<p>
The event is graciously hosted by <a href="https&colon;&sol;&sol;vincit&period;com&sol;">Vincit</a>.
</p>
</div>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<p>No signup is necessary for this event. You just show up!</p>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<p>No signup is necessary for this event. You just show up!</p>
<p>The Vincit office is on the south end of the building, just walk to the end of the main corridor and take the elevator up.</p>
</div>
</div>
</section>
</div>
</div>
</section>
<section id="event" class="content contentpadding">
<h2 class="content-head is-center">Talks</h2>
<section id="event" class="content contentpadding">
<h2 class="content-head is-center">Talks</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="talk-title">Gleam &ndash; Type Safe BEAM</h3>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="talk-title">Gleam &ndash; Type Safe BEAM</h3>
<img src="mikkonaama2&period;webp" alt="Mikko Ahlroth" title="Mikko Ahlroth" class="speaker-image pure-img" />
<p class="speaker-name">
Mikko Ahlroth, Vincit Oyj
</p>
<p class="speaker-description">
Mikko works primarily as a full stack developer at <a href="https://vincit.com/en">Vincit</a>, but on his free time has dabbled with Elixir since 2013. He has published <a href="https://hex.pm/users/nicd">some packages</a> on hex.pm and runs <a href="https://codestats.net/">Code::Stats</a> on Phoenix.
</p>
<h4>Slides & materials</h4>
<ul>
<li><a href="https&colon;&sol;&sol;docs&period;google&period;com&sol;presentation&sol;d&sol;1Jz&lowbar;eQFemw&fjlig;V&lowbar;0KqG8YXQ9GJQ7rdTAYOStvbN6sUySA&sol;edit&quest;usp&equals;sharing" target="_blank">Presentation</a></li>
</ul>
</div>
<img src="mikkonaama2&period;webp" alt="Mikko Ahlroth" title="Mikko Ahlroth" class="speaker-image pure-img" />
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="talk-title">Forget config&period;exs</h3>
<p class="speaker-name">
Mikko Ahlroth, Vincit Oyj
</p>
<p class="speaker-name">
Mikko Ahlroth
</p>
<h4>Slides & materials</h4>
<ul>
<li><a href="https&colon;&sol;&sol;docs&period;google&period;com&sol;presentation&sol;d&sol;1KUB3qXolxa&lowbar;RRXy84NftzpvVuR46f4S4eLqe4ROc5mQ&sol;edit&quest;usp&equals;sharing" target="_blank">Presentation</a></li>
<li><a href="https&colon;&sol;&sol;blog&period;nytsoi&period;net&sol;2021&sol;04&sol;17&sol;elixir-simple-configuration" target="_blank">Blog post about configuration</a></li>
</ul>
</div>
</div>
</section>
<p class="speaker-description">
Mikko works primarily as a full stack developer at <a href="https://vincit.com/en">Vincit</a>, but on his free time has dabbled with Elixir since 2013. He has published <a href="https://hex.pm/users/nicd">some packages</a> on hex.pm and runs <a href="https://codestats.net/">Code::Stats</a> on Phoenix.
</p>
<h4>Slides & materials</h4>
<ul>
<li><a href="https&colon;&sol;&sol;docs&period;google&period;com&sol;presentation&sol;d&sol;1Jz&lowbar;eQFemw&fjlig;V&lowbar;0KqG8YXQ9GJQ7rdTAYOStvbN6sUySA&sol;edit&quest;usp&equals;sharing" target="_blank">Presentation</a></li>
</ul>
</div>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="talk-title">Forget config&period;exs</h3>
<p class="speaker-name">
Mikko Ahlroth
</p>
<h4>Slides & materials</h4>
<ul>
<li><a href="https&colon;&sol;&sol;docs&period;google&period;com&sol;presentation&sol;d&sol;1KUB3qXolxa&lowbar;RRXy84NftzpvVuR46f4S4eLqe4ROc5mQ&sol;edit&quest;usp&equals;sharing" target="_blank">Presentation</a></li>
<li><a href="https&colon;&sol;&sol;blog&period;nytsoi&period;net&sol;2021&sol;04&sol;17&sol;elixir-simple-configuration" target="_blank">Blog post about configuration</a></li>
</ul>
</div>
</div>
</section>
<footer class="footer l-box is-center">
Tampere background © Tampereen kaupunki, licensed under CC-BY-NC.
</footer>
Tampere background © Tampereen kaupunki, licensed under CC-BY-NC.
</footer>
</main>
</body>
</html>

View file

@ -1,58 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
TRElixir
</title>
<meta name="description" content="TRElixir is a developer meetup in Tampere focusing on the BEAM ecosystem.">
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="TRElixir RSS feed">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/pure-min.css" integrity="sha384-UQiGfs9ICog+LwheBSRCt1o5cbyKIHbwjWscjemyBMT9YCUMZffs6UqUTd0hObXD" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/grids-responsive-min.css">
<link rel="stylesheet" href="marketing.css">
</head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
TRElixir
</title>
<meta name="description" content="TRElixir is a developer meetup in Tampere focusing on the BEAM ecosystem.">
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="TRElixir RSS feed">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/pure-min.css" integrity="sha384-UQiGfs9ICog+LwheBSRCt1o5cbyKIHbwjWscjemyBMT9YCUMZffs6UqUTd0hObXD" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/grids-responsive-min.css">
<link rel="stylesheet" href="marketing.css">
</head>
<body>
<header class="header">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<a class="pure-menu-heading" href="#top">TRElixir</a>
<a class="pure-menu-heading" href="#top">TRElixir</a>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a class="pure-menu-link" href="#event">Events</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#contact">Contact</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#sponsors">Sponsored by</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#top">Top</a></li>
</ul>
</div>
</header>
<section class="splash-container ">
<header class="splash">
<h1 class="splash-head">TRElixir</h1>
<p class="splash-subhead">
Tampere 💜 BEAM!
</p>
<p class="splash-subhead">
TRElixir is a developer meetup focusing on the <abbr title="Elixir, Erlang, Gleam, etc.">BEAM</abbr> ecosystem.
</p>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a class="pure-menu-link" href="#event">Events</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#contact">Contact</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#sponsors">Sponsored by</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#top">Top</a></li>
</ul>
</div>
</header>
</section>
<section class="splash-container ">
<header class="splash">
<h1 class="splash-head">TRElixir</h1>
<p class="splash-subhead">
Tampere 💜 BEAM!
</p>
<p class="splash-subhead">
TRElixir is a developer meetup focusing on the <abbr title="Elixir, Erlang, Gleam, etc.">BEAM</abbr> ecosystem.
</p>
</header>
</section>
<main class="content-wrapper">
<main class="content-wrapper ">
<section id="event" class="ribbon l-box-lrg contentpadding">
<h2 class="content-head content-head-ribbon is-center">Upcoming event</h2>
<h3 class="content-subhead">Thursday&comma; 16&period;3&period;2023&comma; 18&period;00</h3>
<h2 class="content-head content-head-ribbon is-center">Upcoming event</h2>
<h3 class="content-subhead">Thursday&comma; 16&period;3&period;2023&comma; 18&period;00</h3>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
@ -91,9 +88,9 @@
</div>
<h2 class="content-head content-head-ribbon is-center">Past events</h2>
<h3 class="content-subhead">21&period;9&period;2017</h3>
<h2 class="content-head content-head-ribbon is-center">Past events</h2>
<h3 class="content-subhead">21&period;9&period;2017</h3>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
@ -131,49 +128,49 @@
</div>
</div>
</section>
</section>
<section id="contact" class="content contentpadding">
<h2 class="content-head is-center">Contact</h2>
<section id="contact" class="content contentpadding">
<h2 class="content-head is-center">Contact</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead">RSS</h3>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead">RSS</h3>
<p>
Follow our <a rel="alternate" type="application/rss+xml" href="feed.xml">RSS feed</a> for the latest updates. We will post any upcoming meetups in the RSS feed.
</p>
</div>
<p>
Follow our <a rel="alternate" type="application/rss+xml" href="feed.xml">RSS feed</a> for the latest updates. We will post any upcoming meetups in the RSS feed.
</p>
</div>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead">IM</h3>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead">IM</h3>
<p>
Currently the most relevant discussion can be found on the <a href="https://koodiklinikka.fi">Koodiklinikka.fi Slack server</a>, on the channel <kbd>#elixir</kbd>.
</p>
<p>
Currently the most relevant discussion can be found on the <a href="https://koodiklinikka.fi">Koodiklinikka.fi Slack server</a>, on the channel <kbd>#elixir</kbd>.
</p>
<p>
You can also shoot Mikko Ahlroth a message <a href="https://fosstodon.org/@nicd">on Fosstodon</a>, on IRC (Nicd @ Libera.chat), or <a href="mailto:trelixir@nytsoi.net">by email</a>.
</p>
</div>
</div>
</section>
<p>
You can also shoot Mikko Ahlroth a message <a href="https://fosstodon.org/@nicd">on Fosstodon</a>, on IRC (Nicd @ Libera.chat), or <a href="mailto:trelixir@nytsoi.net">by email</a>.
</p>
</div>
</div>
</section>
<section id="sponsors" class="ribbon l-box-lrg contentpadding">
<h2 class="content-head content-head-ribbon is-center">Sponsored by</h2>
<section id="sponsors" class="ribbon l-box-lrg contentpadding">
<h2 class="content-head content-head-ribbon is-center">Sponsored by</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 sponsorlogos">
<a href="https://vincit.com/" target="_blank"><img class="pure-img" src="vincitlogo.jpg" alt="Vincit" title="Vincit"></a>
</div>
</div>
</section>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 sponsorlogos">
<a href="https://vincit.com/" target="_blank"><img class="pure-img" src="vincitlogo.jpg" alt="Vincit" title="Vincit"></a>
</div>
</div>
</section>
<footer class="footer l-box is-center">
Tampere background © Tampereen kaupunki, licensed under CC-BY-NC.
</footer>
Tampere background © Tampereen kaupunki, licensed under CC-BY-NC.
</footer>
</main>
</body>
</html>

View file

@ -4,7 +4,6 @@ import gleam/erlang/file
import gleam/list
import trelixir/tpls
import trelixir/index
import trelixir/events/types as event_types
import trelixir/events/utils as event_utils
import trelixir/feed/feed
import trelixir/events/event_2023_03_16
@ -13,9 +12,7 @@ import trelixir/events/event_2017_09_21
pub fn main() {
let assert Ok(templates) = tpls.load_templates()
let assert Ok(index_tpl) = map.get(templates, index.tpl)
let assert Ok(index_content) = index.render(index_tpl, templates)
let assert Ok(index_content) = index.render(templates)
let assert Ok(_) = write_rendered("index.html", index_content)
let assert Ok(feed_tpl) = map.get(templates, feed.tpl)
@ -32,8 +29,7 @@ pub fn main() {
events,
fn(event) {
let #(file_name, data) = event
let assert Ok(tpl) = map.get(templates, event_types.tpl)
let assert Ok(event_content) = event_utils.render(tpl, templates, data)
let assert Ok(event_content) = event_utils.render(templates, data)
write_rendered(file_name <> ".html", event_content)
},
)

View file

@ -1 +1,3 @@
pub const url = "https://trelixir.fi"
pub const base_tpl = "base.html.glemp"

View file

@ -4,41 +4,56 @@ import gleam/set
import gleam/string_builder
import glemplate/assigns
import glemplate/html
import glemplate/ast
import glemplate/renderer
import trelixir/tpls
import trelixir/events/types
import trelixir/config
pub fn render(
template: ast.Template,
template_cache: renderer.TemplateCache,
data: types.Event,
) {
html.render(template, event_to_assigns(data), template_cache)
pub fn render(template_cache: renderer.TemplateCache, event: types.Event) {
let assert Ok(tpl_data) = map.get(template_cache, config.base_tpl)
html.render(tpl_data, base_assigns(template_cache, event), template_cache)
}
fn render_content(template_cache: renderer.TemplateCache, event: types.Event) {
let assert Ok(tpl_data) = map.get(template_cache, types.tpl)
html.render(tpl_data, event_to_assigns(event), template_cache)
}
pub fn event_url(event_file: String) {
config.url <> "/" <> event_file <> ".html"
}
fn common_assigns(event: types.Event) {
assigns.new()
|> assigns.add_bool("is_index", False)
|> assigns.add_string("title", event.title)
}
fn base_assigns(template_cache: renderer.TemplateCache, event: types.Event) {
common_assigns(event)
|> assigns.add_lazy(
"content",
fn() {
let assert Ok(content) = render_content(template_cache, event)
assigns.String(string_builder.to_string(content))
},
)
}
pub fn event_to_assigns(event: types.Event) -> assigns.Assigns {
assigns.from_list([
#("title", assigns.String(event.title)),
#("description", assigns.String(event.description)),
#("host_name", assigns.String(event.host_name)),
#("host_url", assigns.String(event.host_url)),
#("signup_info", assigns.String(event.signup_info)),
#("talks", talks_to_assigns(event.talks)),
#("is_index", assigns.Bool(False)),
])
common_assigns(event)
|> assigns.add_string("description", event.description)
|> assigns.add_string("host_name", event.host_name)
|> assigns.add_string("host_url", event.host_url)
|> assigns.add_string("signup_info", event.signup_info)
|> assigns.add_list("talks", talks_to_assigns(event.talks))
}
type TalkAcc {
TalkAcc(talks: List(assigns.AssignData), speakers: set.Set(types.Speaker))
}
pub fn talks_to_assigns(talks: List(types.Talk)) -> assigns.AssignData {
pub fn talks_to_assigns(talks: List(types.Talk)) -> List(assigns.AssignData) {
let talk_acc =
list.fold(
talks,
@ -69,7 +84,7 @@ pub fn talks_to_assigns(talks: List(types.Talk)) -> assigns.AssignData {
},
)
assigns.List(list.reverse(talk_acc.talks))
list.reverse(talk_acc.talks)
}
pub fn speaker_to_assigns(

View file

@ -1,58 +1,86 @@
import gleam/map
import gleam/string_builder
import glemplate/assigns
import glemplate/renderer
import glemplate/html
import glemplate/ast
import trelixir/events/utils
import trelixir/events/event_2023_03_16
import trelixir/events/event_2017_09_21
import trelixir/config
pub const tpl = "index.html.glemp"
const tpl = "index.html.glemp"
pub fn assigns() {
assigns.from_list([
#("is_index", assigns.Bool(True)),
#(
"upcoming_event",
pub fn render(template_cache: renderer.TemplateCache) {
let assert Ok(tpl_data) = map.get(template_cache, config.base_tpl)
html.render(tpl_data, base_assigns(template_cache), template_cache)
}
fn render_content(template_cache: renderer.TemplateCache) {
let assert Ok(tpl_data) = map.get(template_cache, tpl)
html.render(tpl_data, assigns(), template_cache)
}
fn common_assigns() {
assigns.new()
|> assigns.add_bool("is_index", True)
}
fn base_assigns(template_cache: renderer.TemplateCache) {
common_assigns()
|> assigns.add_lazy(
"content",
fn() {
let assert Ok(content) = render_content(template_cache)
assigns.String(string_builder.to_string(content))
},
)
}
fn assigns() {
common_assigns()
|> assigns.add_bool("is_index", True)
|> assigns.add_map(
"upcoming_event",
map.from_list([
#("title", assigns.String("Thursday, 16.3.2023, 18.00")),
#("file", assigns.String(event_2023_03_16.file)),
#(
"description",
assigns.String(
"
<p>
TRElixir will be next held on the 16<sup>th</sup> of March, 2023, at Vincit office in central Tampere, starting at 18.00 o'clock.
</p>
",
),
),
#(
"talks",
assigns.List(utils.talks_to_assigns(event_2023_03_16.data().talks)),
),
]),
)
|> assigns.add_list(
"past_events",
[
assigns.Map(map.from_list([
#("title", assigns.String("Thursday, 16.3.2023, 18.00")),
#("file", assigns.String(event_2023_03_16.file)),
#("title", assigns.String("21.9.2017")),
#("file", assigns.String("event-2017-09-21")),
#(
"description",
assigns.String(
"
<p>
TRElixir will be next held on the 16<sup>th</sup> of March, 2023, at Vincit office in central Tampere, starting at 18.00 o'clock.
The first TRElixir event was on the 21<sup>st</sup> of September at Vincit premises in Hervanta, Tampere.
</p>
",
),
),
#("talks", utils.talks_to_assigns(event_2023_03_16.data().talks)),
#(
"talks",
assigns.List(utils.talks_to_assigns(event_2017_09_21.data().talks)),
),
])),
),
#(
"past_events",
assigns.List([
assigns.Map(map.from_list([
#("title", assigns.String("21.9.2017")),
#("file", assigns.String("event-2017-09-21")),
#(
"description",
assigns.String(
"
<p>
The first TRElixir event was on the 21<sup>st</sup> of September at Vincit premises in Hervanta, Tampere.
</p>
",
),
),
#("talks", utils.talks_to_assigns(event_2017_09_21.data().talks)),
])),
]),
),
])
}
pub fn render(template: ast.Template, template_cache: renderer.TemplateCache) {
html.render(template, assigns(), template_cache)
],
)
}

59
tpl/base.html.glemp Normal file
View file

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
<% if is_index %><% else %><%= title %> <% end %>
TRElixir
</title>
<meta name="description" content="TRElixir is a developer meetup in Tampere focusing on the BEAM ecosystem.">
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="TRElixir RSS feed">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/pure-min.css" integrity="sha384-UQiGfs9ICog+LwheBSRCt1o5cbyKIHbwjWscjemyBMT9YCUMZffs6UqUTd0hObXD" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/grids-responsive-min.css">
<link rel="stylesheet" href="marketing.css">
</head>
<body>
<header class="header">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<% if is_index %>
<a class="pure-menu-heading" href="#top">TRElixir</a>
<% else %>
<a class="pure-menu-heading" href="/">⬅ TRElixir</a>
<% end %>
<% if is_index %>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a class="pure-menu-link" href="#event">Events</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#contact">Contact</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#sponsors">Sponsored by</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#top">Top</a></li>
</ul>
<% end %>
</div>
</header>
<section class="splash-container <% if is_index %><% else %>event-splash<% end %>">
<% if is_index %>
<header class="splash">
<h1 class="splash-head">TRElixir</h1>
<p class="splash-subhead">
Tampere 💜 BEAM!
</p>
<p class="splash-subhead">
TRElixir is a developer meetup focusing on the <abbr title="Elixir, Erlang, Gleam, etc.">BEAM</abbr> ecosystem.
</p>
</header>
<% end %>
</section>
<main class="content-wrapper <% if is_index %><% else %>event-content<% end %>">
<%= raw content %>
<footer class="footer l-box is-center">
Tampere background © Tampereen kaupunki, licensed under CC-BY-NC.
</footer>
</main>
</body>
</html>

View file

@ -1,32 +0,0 @@
<header class="header">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<% if is_index %>
<a class="pure-menu-heading" href="#top">TRElixir</a>
<% else %>
<a class="pure-menu-heading" href="/">⬅ TRElixir</a>
<% end %>
<% if is_index %>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a class="pure-menu-link" href="#event">Events</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#contact">Contact</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#sponsors">Sponsored by</a></li>
<li class="pure-menu-item"><a class="pure-menu-link" href="#top">Top</a></li>
</ul>
<% end %>
</div>
</header>
<section class="splash-container <% if is_index %><% else %>event-splash<% end %>">
<% if is_index %>
<header class="splash">
<h1 class="splash-head">TRElixir</h1>
<p class="splash-subhead">
Tampere 💜 BEAM!
</p>
<p class="splash-subhead">
TRElixir is a developer meetup focusing on the <abbr title="Elixir, Erlang, Gleam, etc.">BEAM</abbr> ecosystem.
</p>
</header>
<% end %>
</section>

View file

@ -1,3 +0,0 @@
<footer class="footer l-box is-center">
Tampere background © Tampereen kaupunki, licensed under CC-BY-NC.
</footer>

View file

@ -1,14 +0,0 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
<% if is_index %><% else %><%= title %> <% end %>
TRElixir
</title>
<meta name="description" content="TRElixir is a developer meetup in Tampere focusing on the BEAM ecosystem.">
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="TRElixir RSS feed">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/pure-min.css" integrity="sha384-UQiGfs9ICog+LwheBSRCt1o5cbyKIHbwjWscjemyBMT9YCUMZffs6UqUTd0hObXD" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.2/build/grids-responsive-min.css">
<link rel="stylesheet" href="marketing.css">
</head>

View file

@ -1,58 +1,45 @@
<!DOCTYPE html>
<html>
<% render head.html.glemp is_index: is_index %>
<section id="event" class="ribbon l-box-lrg contentpadding">
<h2 class="content-head content-head-ribbon is-center">Upcoming event</h2>
<% render index_event.html.glemp event: upcoming_event %>
<body>
<% render body_top.html.glemp is_index: is_index %>
<h2 class="content-head content-head-ribbon is-center">Past events</h2>
<% for event in past_events %>
<% render index_event.html.glemp event: event %>
<% end %>
</section>
<main class="content-wrapper">
<section id="event" class="ribbon l-box-lrg contentpadding">
<h2 class="content-head content-head-ribbon is-center">Upcoming event</h2>
<% render index_event.html.glemp event: upcoming_event %>
<section id="contact" class="content contentpadding">
<h2 class="content-head is-center">Contact</h2>
<h2 class="content-head content-head-ribbon is-center">Past events</h2>
<% for event in past_events %>
<% render index_event.html.glemp event: event %>
<% end %>
</section>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead">RSS</h3>
<section id="contact" class="content contentpadding">
<h2 class="content-head is-center">Contact</h2>
<p>
Follow our <a rel="alternate" type="application/rss+xml" href="feed.xml">RSS feed</a> for the latest updates. We will post any upcoming meetups in the RSS feed.
</p>
</div>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead">RSS</h3>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead">IM</h3>
<p>
Follow our <a rel="alternate" type="application/rss+xml" href="feed.xml">RSS feed</a> for the latest updates. We will post any upcoming meetups in the RSS feed.
</p>
</div>
<p>
Currently the most relevant discussion can be found on the <a href="https://koodiklinikka.fi">Koodiklinikka.fi Slack server</a>, on the channel <kbd>#elixir</kbd>.
</p>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<h3 class="content-subhead">IM</h3>
<p>
You can also shoot Mikko Ahlroth a message <a href="https://fosstodon.org/@nicd">on Fosstodon</a>, on IRC (Nicd @ Libera.chat), or <a href="mailto:trelixir@nytsoi.net">by email</a>.
</p>
</div>
</div>
</section>
<p>
Currently the most relevant discussion can be found on the <a href="https://koodiklinikka.fi">Koodiklinikka.fi Slack server</a>, on the channel <kbd>#elixir</kbd>.
</p>
<section id="sponsors" class="ribbon l-box-lrg contentpadding">
<h2 class="content-head content-head-ribbon is-center">Sponsored by</h2>
<p>
You can also shoot Mikko Ahlroth a message <a href="https://fosstodon.org/@nicd">on Fosstodon</a>, on IRC (Nicd @ Libera.chat), or <a href="mailto:trelixir@nytsoi.net">by email</a>.
</p>
</div>
</div>
</section>
<section id="sponsors" class="ribbon l-box-lrg contentpadding">
<h2 class="content-head content-head-ribbon is-center">Sponsored by</h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 sponsorlogos">
<a href="https://vincit.com/" target="_blank"><img class="pure-img" src="vincitlogo.jpg" alt="Vincit" title="Vincit"></a>
</div>
</div>
</section>
<% render foot.html.glemp %>
</main>
</body>
</html>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 sponsorlogos">
<a href="https://vincit.com/" target="_blank"><img class="pure-img" src="vincitlogo.jpg" alt="Vincit" title="Vincit"></a>
</div>
</div>
</section>

View file

@ -1,70 +1,57 @@
<!DOCTYPE html>
<html>
<% render head.html.glemp is_index: is_index, title: title %>
<section id="event" class="content contentpadding">
<h2 class="content-head is-center"><%= title %></h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<%= raw description %>
<body>
<% render body_top.html.glemp is_index: is_index %>
<p>
The event is graciously hosted by <a href="<%= host_url %>"><%= host_name %></a>.
</p>
</div>
<main class="content-wrapper event-content">
<section id="event" class="content contentpadding">
<h2 class="content-head is-center"><%= title %></h2>
<div class="pure-g">
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<%= raw description %>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<%= raw signup_info %>
</div>
</div>
</section>
<p>
The event is graciously hosted by <a href="<%= host_url %>"><%= host_name %></a>.
</p>
</div>
<section id="event" class="content contentpadding">
<h2 class="content-head is-center">Talks</h2>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<%= raw signup_info %>
</div>
</div>
</section>
<div class="pure-g">
<% for talk in talks %>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<% if talk.is_placeholder %>
<h3 class="talk-title">More talks TBA</h3>
<% else %>
<h3 class="talk-title"><%= talk.title %></h3>
<section id="event" class="content contentpadding">
<h2 class="content-head is-center">Talks</h2>
<div class="pure-g">
<% for talk in talks %>
<div class="l-box-lrg pure-u-1 pure-u-md-1-2">
<% if talk.is_placeholder %>
<h3 class="talk-title">More talks TBA</h3>
<% else %>
<h3 class="talk-title"><%= talk.title %></h3>
<% if talk.speaker.is_detailed %>
<img src="<%= talk.speaker.img %>" alt="<%= talk.speaker.name %>" title="<%= talk.speaker.name %>" class="speaker-image pure-img" />
<% end %>
<p class="speaker-name">
<%= talk.speaker.name %><% if talk.speaker.is_detailed %><% if talk.speaker.company %>, <%= talk.speaker.company %><% end %><% end %>
</p>
<% if talk.speaker.is_detailed %>
<p class="speaker-description">
<%= raw talk.speaker.description %>
</p>
<% end %>
<% if talk.slides %>
<h4>Slides & materials</h4>
<ul>
<% for slide in talk.slides %>
<li><a href="<%= slide.link %>" target="_blank"><%= slide.title %></a></li>
<% end %>
</ul>
<% end %>
<% end %>
</div>
<% if talk.speaker.is_detailed %>
<img src="<%= talk.speaker.img %>" alt="<%= talk.speaker.name %>" title="<%= talk.speaker.name %>" class="speaker-image pure-img" />
<% end %>
</div>
</section>
<% render foot.html.glemp %>
</main>
</body>
</html>
<p class="speaker-name">
<%= talk.speaker.name %><% if talk.speaker.is_detailed %><% if talk.speaker.company %>, <%= talk.speaker.company %><% end %><% end %>
</p>
<% if talk.speaker.is_detailed %>
<p class="speaker-description">
<%= raw talk.speaker.description %>
</p>
<% end %>
<% if talk.slides %>
<h4>Slides & materials</h4>
<ul>
<% for slide in talk.slides %>
<li><a href="<%= slide.link %>" target="_blank"><%= slide.title %></a></li>
<% end %>
</ul>
<% end %>
<% end %>
</div>
<% end %>
</div>
</section>