devopsdays / devopsdays-web

This is the website for devopsdays

Home Page:https://www.devopsdays.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor data/events directory

mattstratton opened this issue · comments

This was part of the redesign but i think we need it now.

Currently structure is a flat directory with a single yaml for every event.

New would be like this:

data/events/2024-chicago/main.yml

Which allows us to break up the yaml files like...
data/events/2024-chicago/program.yml etc

First step is to figure out how big of a change the path changes will be.

Assuming that is no big deal, then refactor the program page to use the program.yml if it exists, and fall back to the main if not.

This is needed for #13658

There's one block that loads the data file which is used everywhere; in theory this could be fixed and then search/replace all templates:


{{- $e := (index $.Site.Data.events (index (split (.Permalink | relURL) "/") 2)) -}}

So maybe like this (given index function is variadic—it accepts a variable number of arguments):


(index .Site.Data.events $EVENT "main")

{{- 
$e := 
(index $.Site.Data.events (index (split (.Permalink | relURL) "/") 2) "main") 
-}}

Need a simple script (one time) to make the directory changes


#!/bin/bash
FILES=/data/events/*

for f in $FILES
do
if [[ "$f" == *\.yml ]]
then
  fbname=$(basename f$ .yml)
  mkdir $fbname
  mv $f $fbname/main.yml
fi
done

Okay so this was way easier than I thought; I am pretty close to a PR.