Merge pull request 'talks_shortcode' (#1) from talks_shortcode into master

Reviewed-on: #1
This commit is contained in:
NapoleonDynamite 2024-02-08 20:19:22 +00:00
commit 928dbc5c79
2 changed files with 90 additions and 14 deletions

View file

@ -371,7 +371,32 @@
"url": "https://www.youtube.com/watch?v=r8mtXJh3hzM", "url": "https://www.youtube.com/watch?v=r8mtXJh3hzM",
"duration": "PT43M7S", "duration": "PT43M7S",
"description": "Microservices are just a bunch hip new framework plus some AngularJS frontend or React, right? So, if you want to make sure that you absolutely and definitely fail at your Microservice project, then watch this talk and learn how. Using real world experience from multiple green field and brown field projects, I can show you: - how to ignore the mandatory organizational impact - how to focus on the code only without any regard towards ops and testing - continuous deployment is for losers. Real projects use their meat cloud for delivery - jumping onto every new and untested framework is a must - EventSourcing and CQRS are both free lunches. So, you can add complexity without any real need - ...and more. If you mind my tips, then surely you will fail at Microservices and your boss will never again try to move away from your beloved vintage monolith.", "description": "Microservices are just a bunch hip new framework plus some AngularJS frontend or React, right? So, if you want to make sure that you absolutely and definitely fail at your Microservice project, then watch this talk and learn how. Using real world experience from multiple green field and brown field projects, I can show you: - how to ignore the mandatory organizational impact - how to focus on the code only without any regard towards ops and testing - continuous deployment is for losers. Real projects use their meat cloud for delivery - jumping onto every new and untested framework is a must - EventSourcing and CQRS are both free lunches. So, you can add complexity without any real need - ...and more. If you mind my tips, then surely you will fail at Microservices and your boss will never again try to move away from your beloved vintage monolith.",
"liked": true "liked": true,
"attended": false
},
{
"title": "From phone hardware to mobile Linux",
"speakers": ["Luca Weiss"],
"date": "2024-02-03T10:30:00",
"location": "Fosdem23",
"tags": ["linux", "mobile"],
"url": "https://ftp.belnet.be/mirror/FOSDEM/video/2024/h1309/fosdem-2024-2234-from-phone-hardware-to-mobile-linux.mp4",
"duration": "PT25M",
"description": "An exploration from the chips on the PCB to how Linux makes the phone work. We'll go into how the hardware and the Linux device tree files are connected, how the different chips communicate, etc. Things I wish I had learned years ago!",
"liked": true,
"attended": true
},
{
"title": "The state of OpenJDK",
"speakers": ["Dalibor Topic"],
"date": "2024-02-03T10:30:00",
"location": "Fosdem23",
"tags": ["java"],
"url": "https://mirror.as35701.net/video.fosdem.org/2024/ub5132/fosdem-2024-3254-the-state-of-openjdk.mp4",
"duration": "PT30M",
"description": "A review of the past four years in the life of the OpenJDK Community, and a look at whats ahead.",
"liked": true,
"attended": true
} }
] ]
} }

View file

@ -1,15 +1,66 @@
{{ $json := getJSON "data/talks.json" }} {{ $json := getJSON "data/talks.json" }}
<ul>
{{ range $json.talks }} <!-- Extract unique locations -->
<li> {{ $locations := slice }}
<h2>{{ .title }}</h2> {{ range $json.talks }}
<p><strong>Subtitle:</strong> {{ .subtitle }}</p> {{ $location := .location }}
<p><strong>Speakers:</strong> {{ range .speakers }}{{ . }}, {{ end }}</p> {{ if not (in $locations $location) }}
<p><strong>Location:</strong> {{ .location }}</p> {{ $locations = $locations | append $location }}
<p><strong>URL:</strong> <a href="{{ .url }}">{{ .url }}</a></p> {{ end }}
<p><strong>Liked:</strong> {{ .liked }}</p> {{ end }}
<p><strong>Attended:</strong> {{ .attended }}</p>
</li> <!-- Display location buttons -->
{{ end }} <div id="locationButtons">
</ul> {{ range $locations }}
<button class="locationButton" data-location="{{ . }}">{{ . }}</button>
{{ end }}
</div>
An exploration from the chips on the PCB to how Linux makes the phone work. We'll go into how the hardware and the Linux device tree files are connected, how the different chips communicate, etc. Things I wish I had learned years ago!
<!-- Display talks for each location -->
{{ range $locations }}
<div class="talksContainer" id="talks_{{ . }}" style="display: none;">
<h2>{{ . }}</h2>
<ul>
{{ $currentLocation := . }}
{{ range $json.talks }}
{{ if eq .location $currentLocation }}
<li>
<strong>Title:</strong> {{ .title }}<br>
{{ with .subtitle }}
{{ if ne . "" }}
<strong>Subtitle:</strong> {{ . }}<br>
{{ end }}
{{ end }}
{{ if isset . "speakers" }}
{{ $speakers := .speakers }}
{{ if ne (len $speakers) 0 }}
<strong>Speakers:</strong>
{{ range $index, $speaker := $speakers }}
{{ $speaker }}
{{ if ne $index (sub (len $speakers) 1) }}, {{ end }}
{{ end }}<br>
{{ end }}
{{ end }}
<strong>Date:</strong> {{ .date }}<br>
<strong>URL:</strong> <a href="{{ .url }}">{{ .url }}</a><br>
<strong>Description:</strong> {{ .description }}<br><br>
</li>
{{ end }}
{{ end }}
</ul>
</div>
{{ end }}
<script>
// Add click event listener to location buttons
var locationButtons = document.getElementsByClassName("locationButton");
for (var i = 0; i < locationButtons.length; i++) {
locationButtons[i].addEventListener('click', function() {
var location = this.dataset.location;
var talksContainer = document.getElementById("talks_" + location);
// Toggle visibility of talks container
talksContainer.style.display = talksContainer.style.display === "none" ? "block" : "none";
});
}
</script>