imfreedom/www.imfreedom.org

93569997a48e
Merged in qulogic/www.imfreedom.org (pull request #9)

Simplify meeting list generation
--- a/README.md Wed Jun 19 01:56:32 2019 -0400
+++ b/README.md Fri Jun 21 17:04:35 2019 +0000
@@ -1,2 +1,26 @@
# www.imfreedom.org
+## Adding meeting minutes
+
+Minutes should be stored in `hugo/content/minutes/<UTC date>.md`. You can use
+`hugo` to create it using a provided archetype:
+```
+$ hugo -s hugo new content/minutes/2019-06-18.md
+```
+which will fill out the following front matter:
+```
+---
+title: "Minutes for the <UTC date> Board Meeting"
+date: <UTC date>
+audio:
+ - "https://data.imfreedom.org/public/board-meetings/audio-<UTC date>.ogg"
+videos:
+ - "https://data.imfreedom.org/public/board-meetings/video-<UTC date>.mp4"
+---
+```
+You may specify multiple audio or video links (or none and leave out the key).
+
+To add a transcript, place the content in a corresponding file named
+`hugo/content/transcripts/<UTC date>.md`. It must match the filename of a
+minutes file. If you have no minutes, then still add the minutes file with
+`unlisted:true` in its front matter.
--- a/data/meetings.json Wed Jun 19 01:56:32 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-{
- "2019-06-11": {
- "audio": {
- "ogg": "https://data.imfreedom.org/public/board-meetings/audio-20190611.ogg"
- },
- "video": {
- "mpeg4": "https://data.imfreedom.org/public/board-meetings/video-20190611.mp4"
- }
- },
- "2018-05-03": {
- "audio": {
- "ogg": "https://data.imfreedom.org/public/board-meetings/audio-20180503.ogg"
- },
- "video": {
- "mpeg4": "https://data.imfreedom.org/public/board-meetings/video-20180503.mp4"
- }
- },
- "2017-09-07": {
- "note": "no transcript or recordings"
- },
- "2016-08-24": {
- "note": "no transcript or recordings"
- },
- "2016-06-07": {
- "note": "no transcript or recordings"
- },
- "2012-04-18": {
- "note": "no transcript or recordings"
- },
- "2011-04-14": {
- "note": "no transcript or recordings"
- },
- "2009-11-23": {
- "note": "no minutes or recordings"
- },
- "2013-04-15": {
- "audio": {
- "ogg": "https://data.imfreedom.org/public/board-meetings/audio-20130415.ogg"
- }
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hugo/archetypes/minutes.md Fri Jun 21 17:04:35 2019 +0000
@@ -0,0 +1,10 @@
+---
+title: "Minutes for the {{ .Name }} Board Meeting"
+date: {{ .Name }}
+audio:
+ - "https://data.imfreedom.org/public/board-meetings/audio-{{ replace .Name "-" "" }}.ogg"
+videos:
+ - "https://data.imfreedom.org/public/board-meetings/video-{{ replace .Name "-" "" }}.mp4"
+---
+
+IM Freedom Board Meeting {{ .Name }} 00:00 UTC
--- a/hugo/content/_index.md Wed Jun 19 01:56:32 2019 -0400
+++ b/hugo/content/_index.md Fri Jun 21 17:04:35 2019 +0000
@@ -28,8 +28,6 @@
member directly or through open discussion in
[discussion@conference.pidgin.im](xmpp:discussion@conference.pidgin.im?join).
-{{< meetings >}}
-
[1]:
https://apps.irs.gov/app/eos/displayAll.do?dispatchMethod=displayAllInfo&Id=3819004&ein=593837808
[2]: https://adium.im/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hugo/content/minutes/2009-11-23.md Fri Jun 21 17:04:35 2019 +0000
@@ -0,0 +1,8 @@
+---
+title: "Minutes for the 2009-11-23 Board Meeting"
+date: 2009-11-23
+unlisted: true
+---
+
+There are no minutes for the 2009-11-23 Board Meeting. Please review the
+[transcript]({{< ref "/transcripts/2009-11-23" >}}) instead.
--- a/hugo/content/minutes/2013-04-15.md Wed Jun 19 01:56:32 2019 -0400
+++ b/hugo/content/minutes/2013-04-15.md Fri Jun 21 17:04:35 2019 +0000
@@ -1,6 +1,8 @@
---
title: "Minutes for the 2013-04-15 Board Meeting"
date: 2013-04-15
+audio:
+ - "https://data.imfreedom.org/public/board-meetings/audio-20130415.ogg"
---
The 2013 Board Meeting was held at 22:30 UTC on 2013-04-15 via conference call using the service [Rondee](http://www.rondee.com/).
@@ -57,4 +59,4 @@
Ethan motioned to pre-approve the renewal fee with Delaware. This was 170.00 last year. This motion was passed unanimously.
-Meeting adjourned at 18:49.
\ No newline at end of file
+Meeting adjourned at 18:49.
--- a/hugo/content/minutes/2018-05-03.md Wed Jun 19 01:56:32 2019 -0400
+++ b/hugo/content/minutes/2018-05-03.md Fri Jun 21 17:04:35 2019 +0000
@@ -1,6 +1,10 @@
---
title: "Minutes for the 2018-05-03 Board Meeting"
date: 2018-05-03
+audio:
+ - "https://data.imfreedom.org/public/board-meetings/audio-20180503.ogg"
+videos:
+ - "https://data.imfreedom.org/public/board-meetings/video-20180503.mp4"
---
IM Freedom Board Meeting 2018-05-03 01:30 UTC using a Zoom.us. All times listed below in UTC.
--- a/hugo/content/minutes/2019-06-11.md Wed Jun 19 01:56:32 2019 -0400
+++ b/hugo/content/minutes/2019-06-11.md Fri Jun 21 17:04:35 2019 +0000
@@ -1,6 +1,10 @@
---
title: "Minutes for the 2019-06-11 Board Meeting"
date: 2019-06-11
+audio:
+ - "https://data.imfreedom.org/public/board-meetings/audio-20190611.ogg"
+videos:
+ - "https://data.imfreedom.org/public/board-meetings/video-20190611.mp4"
---
IM Freedom Board Meeting 2019-06-11 00:00 UTC using a Zoom.us. All times listed below in UTC.
--- a/hugo/data/meetings.json Wed Jun 19 01:56:32 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-[
- {
- "key": "2019-06-11",
- "audio": {
- "ogg": "https://data.imfreedom.org/public/board-meetings/audio-20190611.ogg"
- },
- "video": {
- "mpeg4": "https://data.imfreedom.org/public/board-meetings/video-20190611.mp4"
- },
- "minutes": true
- },
- {
- "key": "2018-05-03",
- "audio": {
- "ogg": "https://data.imfreedom.org/public/board-meetings/audio-20180503.ogg"
- },
- "video": {
- "mpeg4": "https://data.imfreedom.org/public/board-meetings/video-20180503.mp4"
- },
- "minutes": true
- },
- {
- "key": "2017-09-07",
- "note": "no transcript or recordings",
- "minutes": true
- },
- {
- "key": "2016-08-24",
- "note": "no transcript or recordings",
- "minutes": true
- },
- {
- "key": "2016-06-07",
- "note": "no transcript or recordings",
- "minutes": true
- },
- {
- "key": "2013-04-15",
- "audio": {
- "ogg": "https://data.imfreedom.org/public/board-meetings/audio-20130415.ogg"
- },
- "minutes": true
- },
- {
- "key": "2012-04-18",
- "note": "no transcript or recordings",
- "minutes": true
- },
- {
- "key": "2011-04-14",
- "note": "no transcript or recordings",
- "minutes": true
- },
- {
- "key": "2009-11-23",
- "note": "no minutes or recordings",
- "transcripts": true
- },
- {
- "key": "2008-05-20",
- "minutes": true,
- "transcripts": true
- },
- {
- "key": "2007-05-15",
- "minutes": true,
- "transcripts": true
- }
-]
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hugo/layouts/home.html Fri Jun 21 17:04:35 2019 +0000
@@ -0,0 +1,4 @@
+{{ define "main" }}
+{{ .Content }}
+{{ partial "minutes-list" (.GetPage "minutes") }}
+{{ end }}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hugo/layouts/partials/minutes-list.html Fri Jun 21 17:04:35 2019 +0000
@@ -0,0 +1,41 @@
+<table>
+ {{ range .Pages }}
+ {{ $transcript := .Site.GetPage (path.Join "transcripts" .File.BaseFileName) }}
+ <tr>
+ <td>{{ .Date.Format "2006-01-02" }}</td>
+ <td>
+ {{ if not (.Param "unlisted") }}
+ <a href="{{ .Permalink }}">minutes</a>
+ {{ else }}
+ no minutes available
+ {{ end }}
+ </td>
+ <td>
+ {{ with $transcript }}
+ <div>
+ <a href="{{ .Permalink }}">transcript</a>
+ </div>
+ {{ end }}
+ {{ range .Param "audio" }}
+ <div>
+ <a href="{{ . }}" target="_blank">
+ audio ({{ path.Ext . }})
+ <i class="fas fa-external-link-alt fa-sm"></i>
+ </a>
+ </div>
+ {{ end }}
+ {{ range .Param "videos" }}
+ <div>
+ <a href="{{ . }}" target="_blank">
+ video ({{ path.Ext . }})
+ <i class="fas fa-external-link-alt fa-sm"></i>
+ </a>
+ </div>
+ {{ end }}
+ {{ if and (not $transcript) (not (.Param "audio")) (not (.Param "videos")) }}
+ <div>no transcript or recordings</div>
+ {{ end }}
+ </td>
+ </tr>
+ {{ end }}
+</table>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hugo/layouts/section/minutes.html Fri Jun 21 17:04:35 2019 +0000
@@ -0,0 +1,5 @@
+{{ define "main" }}
+ {{ .Content }}
+
+ {{ partial "minutes-list.html" . }}
+{{ end }}
--- a/hugo/layouts/shortcodes/meetings.html Wed Jun 19 01:56:32 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<table>
- {{ range .Site.Data.meetings }}
- <tr>
- <td>{{ .key }}</td>
- <td>
- {{ if isset . "minutes" }}
- <a href="/minutes/{{ .key }}">minutes</a>
- {{ else }}
- &nbsp;
- {{ end }}
- </td>
- <td>
- {{ if isset . "transcripts" }}
- <div>
- <a href="/transcripts/{{ .key }}">transcript</a>
- </div>
- {{ end }}
- {{ if isset . "audio" }}
- <div>
- <a href="{{ .audio.ogg }}" target="_blank">
- audio (Ogg Vorbis)
- <i class="fas fa-external-link-alt fa-sm"></i>
- </a>
- </div>
- {{ end }}
- {{ if isset . "video" }}
- <div>
- <a href="{{ .video.mpeg4 }}" target="_blank">
- video (MPEG4)
- <i class="fas fa-external-link-alt fa-sm"></i>
- </a>
- </div>
- {{ end }}
- {{ if isset . "note" }}
- <div>
- {{ safeHTML .note }}
- </div>
- {{ end }}
- </td>
- </tr>
- {{ end }}
-</table>
--- a/tools/populate-meetings-data.js Wed Jun 19 01:56:32 2019 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/**
- * Creates meetings data for hugo to consume
- *
- * From:
- * * data/meetings.json
- * * hugo/content/mintues/*
- * * hugo/content/transcripts/*
- */
-
-const fs = require('fs')
-const path = require('path')
-
-const meetingsData = require('../data/meetings.json')
-const hugoDir = path.join(__dirname, '..', 'hugo')
-
-searchAndAddMeetingsPages('minutes')
-searchAndAddMeetingsPages('transcripts')
-
-/**
- * Looks for pages in hugo content and if it exist sets a flag that it exsists
- * @param {string} type
- */
-function searchAndAddMeetingsPages(type) {
- const dir = path.join(hugoDir, 'content', type)
-
- fs.readdirSync(dir).map(file => {
- const key = file.replace(/\.md$/, '')
-
- if (!meetingsData[key]) {
- meetingsData[key] = {}
- }
-
- meetingsData[key][type] = true
- })
-}
-
-// Create an ordered array for hugo to read
-const d = Object.entries(meetingsData)
- .sort(([a], [b]) => b.localeCompare(a))
- .map(([key, { ...v }]) => ({ key, ...v }))
-
-// Write data into hugo data dir
-const targetPath = path.join(hugoDir, 'data', 'meetings.json')
-fs.writeFileSync(targetPath, JSON.stringify(d, null, '\t'))
-
-console.log('done')