~technomancy/fennel-lang.org

62d6c8b80c6c35c0cbbf95e64391ab30311a089b — Phil Hagelberg 2 months ago 50eec9e
Set conf pages doctypes; put head in elements.fnl.
M conf/2018.fnl => conf/2018.fnl +1 -0
@@ 1,6 1,7 @@
(local {: html} (require :html))
(local {: style : foot} (require :conf.elements))

(print "<!DOCTYPE html>")
(print (html [:html {:lang "en"}
              [:head {} [:title {} "FennelConf 2018"]
               (table.unpack style)]

M conf/2019.fnl => conf/2019.fnl +6 -6
@@ 1,9 1,9 @@
(local {: html} (require :html))
(local {: foot : watch : style} (require :conf.elements))
(local {: foot : watch : head} (require :conf.elements))

(print "<!DOCTYPE html>")
(-> [:html {:lang "en"}
     [:head {} [:title {} "FennelConf 2019"]
      (table.unpack style)]
     (head 2019)
     [:body {}
      [:h1 {} "FennelConf 2019"]
      [:p {} [:b {} "Location:"]


@@ 28,16 28,16 @@
        [:a {:href "https://bakpakin.com/"} "Calvin Rose"]]
       [:li {} [:b {} "11:00"]
        [:i {} "Art is failure over time:"] "Justin Smith"
        (watch "/v/fennelconf-2019-smith.webm")]
        (watch 2 "/v/fennelconf-2019-smith.webm")]
       [:li {} [:b {} "12:00"] "Lunch"]
       [:li {} [:b {} "13:00"]
        [:i {} "Full Stack Fennel; or, Overengineering as an Art Form:"]
        [:a {:href "https://benaiah.me/about"} "Benaiah Mischenko"]
        (watch "/v/fennelconf-2019-mischenko.webm")]
        (watch 3 "/v/fennelconf-2019-mischenko.webm")]
       [:li {} [:b {} "14:00"]
        [:i {} "Interactive development in 80kb of RAM:"]
        [:a {:href "https://technomancy.us/colophon"} "Phil Hagelberg"]
        (watch "/v/fennelconf-2019-hagelberg.webm")]
        (watch 4 "/v/fennelconf-2019-hagelberg.webm")]
       [:li {} [:b {} "13:00"] "Hack afternoon!"]
       [:li {} [:b {} "18:00"] "End of conference"]]


M conf/2020.fnl => conf/2020.fnl +3 -3
@@ 1,10 1,10 @@
(local {: html} (require :html))
(local {: style : foot} (require :conf.elements))
(local {: head : foot} (require :conf.elements))
(local talks (require :conf.talks))

(print "<!DOCTYPE html>")
(-> [:html {:lang "en"}
     [:head {} [:title {} "FennelConf 2020"]
      (table.unpack style)]
     (head 2020)
     [:body {}
      [:h1 {} "FennelConf 2020"]
      [:p {} [:b {} "Location: online"]]

M conf/2021.fnl => conf/2021.fnl +3 -3
@@ 1,10 1,10 @@
(local {: html} (require :html))
(local {: style : foot} (require :conf.elements))
(local {: head : foot} (require :conf.elements))
(local talks (require :conf.talks))

(print "<!DOCTYPE html>")
(-> [:html {:lang "en"}
     [:head {} [:title {} "FennelConf 2021"]
      (table.unpack style)]
     (head 2021)
     [:body {}
      [:h1 {} "FennelConf 2021"]
      [:p {} [:b {} "Location:"] "online"]

M conf/2022.fnl => conf/2022.fnl +3 -3
@@ 1,10 1,10 @@
(local {: html} (require :html))
(local {: foot : style} (require :conf.elements))
(local {: head : foot} (require :conf.elements))
(local talks (require :conf.talks))

(print "<!DOCTYPE html>")
(-> [:html {:lang "en"}
     [:head {} [:title {} "FennelConf 2022"]
      (table.unpack style)]
     (head 2022)
     [:body {}
      [:h1 {} "FennelConf 2022"]
      [:p {} [:b {} "Location:"] "online"]

M conf/2023.fnl => conf/2023.fnl +3 -3
@@ 1,10 1,10 @@
(local {: html} (require :html))
(local {: style : foot} (require :conf.elements))
(local {: head : foot} (require :conf.elements))
(local talks (require :conf.talks))

(print "<!DOCTYPE html>")
(-> [:html {:lang "en"}
     [:head {} [:title {} "FennelConf 2023"]
      (table.unpack style)]
     (head 2023)
     [:body {}
      [:h1 {} "FennelConf 2023"]
      [:p {} [:b {} "Location:"] "online"]

M conf/elements.fnl => conf/elements.fnl +35 -34
@@ 1,36 1,37 @@
{:watch
 ;; TODO: add poster image
 ;; ffmpeg -i file -vf select='gte\(n\,360\)' -vframes 1 poster.png
 (fn [i src]
   (let [onclick (: "document.getElementById('v').setAttribute('src', '%s');"
                    :format src)]
     (values [:button {: onclick} "watch"]
             [:a {:href src :id (.. "video" i)}
              [:img {:src "/download.svg"
                     :class "download"
                     :alt "download"}]])))
(local style
       [[:link {:rel "stylesheet" :href "https://fennel-lang.org/fennel.css"}]
        [:link {:rel "stylesheet" :href "https://code.cdn.mozilla.net/fonts/fira.css"}]])

 :style
 [[:link {:rel "stylesheet" :href "https://fennel-lang.org/fennel.css"}]
 [:link {:rel "stylesheet" :href "https://code.cdn.mozilla.net/fonts/fira.css"}]]
{:watch
   ;; TODO: add poster image
   ;; ffmpeg -i file -vf select='gte\(n\,360\)' -vframes 1 poster.png
   (fn [i src]
     (values [:a {:href (.. "#video" i)} "⏵"]
             [:a {:href src :id (.. "video" i) :class "download"}
              [:img {:src "/download.svg" :alt "download"}]]))

 :foot
 [:div {}
  [:hr {}]
  [:h3 {} "See how much fun we had in: "
   [:a {:href "/2023"} "2023"]
   [:a {:href "/2022"} "2022"]
   [:a {:href "/2021"} "2021"]
   [:a {:href "/2020"} "2020"]
   [:a {:href "/2019"} "2019"]
   [:a {:href "/2018"} "2018"]
   [:a {:href "/all"} "all"]]
  [:hr {}]
  [:p {} "The "
   [:a {:href "https://fennel-lang.org/coc"} "code of conduct"]
   " for Fennel applies at FennelConf. "
   "All videos are released under the "
   [:a {:href "https://creativecommons.org/licenses/by-sa/4.0/"}
    "Creative Commons BY-SA 4.0 license"] "."]
  [:p {} [:a {:href "https://git.sr.ht/~technomancy/fennel-lang.org/tree/main/conf"}
          "source"]]]}
   :head (fn [year]
           [:head {} [:title {} (.. "FennelConf " year)]
            [:script {:src "/videos.js"}]
            (table.unpack style)])
   : style
   :foot
   [:div {}
    [:hr {}]
    [:h3 {} "See how much fun we had in: "
     [:a {:href "/2023"} "2023"]
     [:a {:href "/2022"} "2022"]
     [:a {:href "/2021"} "2021"]
     [:a {:href "/2020"} "2020"]
     [:a {:href "/2019"} "2019"]
     [:a {:href "/2018"} "2018"]
     [:a {:href "/all"} "all"]]
    [:hr {}]
    [:p {} "The "
     [:a {:href "https://fennel-lang.org/coc"} "code of conduct"]
     " for Fennel applies at FennelConf. "
     "All videos are released under the "
     [:a {:href "https://creativecommons.org/licenses/by-sa/4.0/"}
      "Creative Commons BY-SA 4.0 license"] "."]
    [:p {} [:a {:href "https://git.sr.ht/~technomancy/fennel-lang.org/tree/main/conf"}
            "source"]]]}

A conf/videos.js => conf/videos.js +16 -0
@@ 0,0 1,16 @@
function loadVideo() {
    var hash = new URL(document.URL).hash;
    if (!hash) return false;
    var videos = document.querySelectorAll("a[href$='webm']");

    for (var i=0; i<videos.length; i++) {
        var element = videos[i];
        if ("#"+element.id == hash) {
            document.getElementById("v").setAttribute('src', element);
            break;
        }
    }
}

document.addEventListener('DOMContentLoaded', loadVideo);
window.addEventListener('hashchange', loadVideo);

M fennel.css => fennel.css +1 -1
@@ 214,4 214,4 @@ h3 code { color: #007020; }
}

/* conf */
video { max-width: 100%; }
video { width: 100%; }