From 494791852f1ea4ec10e7c0bad8ce26ce03e87a87 Mon Sep 17 00:00:00 2001 From: Reily Siegel Date: Sat, 31 Jul 2021 11:52:49 -0400 Subject: [PATCH] Remove Newsletter --- .github/workflows/build.yaml | 2 -- README.org | 39 ----------------------- deps.edn | 4 +-- src/axpdsp_site/build/newsletter.clj | 24 --------------- src/axpdsp_site/core.cljs | 2 -- src/axpdsp_site/hero.cljs | 4 --- src/axpdsp_site/newsletter.cljs | 46 ---------------------------- 7 files changed, 1 insertion(+), 120 deletions(-) delete mode 100644 src/axpdsp_site/build/newsletter.clj delete mode 100644 src/axpdsp_site/newsletter.cljs diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5578d37..1543ecf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,8 +13,6 @@ jobs: - uses: DeLaGuardo/setup-clojure@2.0 with: tools-deps: '1.10.1.469' - - name: Build Newsletter - run: clojure -A:build-newsletter - name: npm install uses: bahmutov/npm-install@v1 with: diff --git a/README.org b/README.org index 2a90a81..cedbe20 100644 --- a/README.org +++ b/README.org @@ -1,40 +1 @@ * Contributing -** Writing a Newsletter Entry -Newsletters can be written by the Newsletter Editor, Committee Chairs, or by the -Webmaster. The process submitting a newsletter entry has been as simple as -possible to accommodate the wide array of people with varying technical knowledge -who may have an interest in publishing an entry. As such, we assume that the -person making a contribution to the newsletter will be using the graphical -interface provided by GitHub to make their change. - -First, click [[https://github.com/AXPDSP/axpdsp-site/new/master/newsletter][here]] to create a new file in the newsletter directory. An editor -should appear, prompting you for a file name. Enter ~DATE.md~, where ~DATE~ is -the current date in ~yyyy-mm-dd~ format. Once a name for the file has been -assigned, you can begin writing your article in the editor. Newsletter entries -are written in [[https://www.markdownguide.org/basic-syntax/][markdown format]]. GitHub has built-in support for rendering -markdown, so you can check to see what the compiled result will look like in the -~Preview~ panel. In GitHub's preview, the metadata will show as a table at the -top of the article. This table will /not/ be displayed on the website. - -Here is an example of a newsletter entry: -#+begin_src markdown ---- -title: The New AXPDSP Website is Complete -author: Reily Siegel -position: Newsletter Editor -date: 2023-06-01 ---- - -Our Website has been completed! - -## A Subsection -We are now inside a subsection. -#+end_src - -Notice that the example has a section at the top surrounded by three dashes. -This section is metadata that allows the newsletter builder to properly -integrate the entry into the website. The date *MUST* be in ~yyyy-mm-dd~ format. -For example, the date June 4, 2020 would be written as 2020-06-04. - -Once you are finished, click the green ~Propose new file~ button. This will -create a request to add the entry to the website, and notify the Webmaster. diff --git a/deps.edn b/deps.edn index 64b70db..b76dd78 100644 --- a/deps.edn +++ b/deps.edn @@ -6,7 +6,5 @@ arttuka/reagent-material-ui {:mvn/version "4.11.0-3"} reilysiegel/clojure-sheets {:git/url "https://github.com/ReilySiegel/clojure-sheets" - :sha "acf141588304382f218046f15506c38e41152a3e"}}} - :build-newsletter - {:main-opts ["-m" "axpdsp-site.build.newsletter"]}} + :sha "acf141588304382f218046f15506c38e41152a3e"}}}} :paths ["src" "resources"]} diff --git a/src/axpdsp_site/build/newsletter.clj b/src/axpdsp_site/build/newsletter.clj deleted file mode 100644 index 882cd8d..0000000 --- a/src/axpdsp_site/build/newsletter.clj +++ /dev/null @@ -1,24 +0,0 @@ -(ns axpdsp-site.build.newsletter - (:require [clojure.java.io :as io] - [markdown.core :as md])) - - -(defn directory? [^java.io.File f] - (.isDirectory f)) - -(defn files [d] - (remove directory? (file-seq (io/file d)))) - -(defn parse-markdown [^java.io.File f] - (let [{:keys [html metadata]} (md/md-to-html-string-with-meta (slurp f))] - (into {:html html} metadata))) - -(defn -main [& _] - (println "Building newsletter...") - (spit (io/file "resources/newsletter.edn") - (->> (files "newsletter") - (map parse-markdown) - (sort-by (juxt :important :date) (comp - compare)) - vec - prn-str)) - (println "Newsletter built.")) diff --git a/src/axpdsp_site/core.cljs b/src/axpdsp_site/core.cljs index 0560503..a9a8f74 100644 --- a/src/axpdsp_site/core.cljs +++ b/src/axpdsp_site/core.cljs @@ -4,7 +4,6 @@ [axpdsp-site.hero :as hero] [axpdsp-site.brotherhood :as brotherhood] [axpdsp-site.footer :as footer] - [axpdsp-site.newsletter :as newsletter] [axpdsp-site.officers :as officers] [axpdsp-site.philanthropy :as philanthropy] [axpdsp-site.recruitment :as recruitment] @@ -16,7 +15,6 @@ [brotherhood/ui] [recruitment/ui] #_[house/ui] - [newsletter/ui] [philanthropy/ui] [officers/ui] [footer/ui]]) diff --git a/src/axpdsp_site/hero.cljs b/src/axpdsp_site/hero.cljs index f47d198..9e4af38 100644 --- a/src/axpdsp_site/hero.cljs +++ b/src/axpdsp_site/hero.cljs @@ -21,10 +21,6 @@ :smooth true :class "button is-link is-inverted is-outlined anchor-link"} "Recruitment"] - [:> Link {:to "newsletter" - :smooth true - :class "button is-link is-inverted is-outlined anchor-link"} - "Newsletter"] [:> Link {:to "philanthropy" :smooth true :class "button is-link is-inverted is-outlined anchor-link"} diff --git a/src/axpdsp_site/newsletter.cljs b/src/axpdsp_site/newsletter.cljs deleted file mode 100644 index f559eb0..0000000 --- a/src/axpdsp_site/newsletter.cljs +++ /dev/null @@ -1,46 +0,0 @@ -(ns axpdsp-site.newsletter - (:require [reagent.core :as r] - [cljs.reader :as reader] - [shadow.resource :as resource])) - -(def newsletter (reader/read-string (resource/inline "newsletter.edn"))) - - -(defn ui [] - (let [entry-index (r/atom nil)] - (fn [] - [:section.section.is-small.has-background-light {:id "newsletter"} - [:div.container - [:div.content - [:h1 "Newsletter - Fresh off the Press"]] - [:div.columns - (for [[{:keys [title author position date]} - idx] (map vector (take 4 newsletter) (range))] - [:div.column.is-3 - {:key idx} - [:div.card - {:style {:height "100%" - :display :flex - :flex-direction :column}} - [:div.card-content - {:style {:height "100%"}} - [:div.media-content - [:p.title title] - [:p.subtitle (.format (js/Intl.DateTimeFormat. - "en-US" - #js {:day "numeric" - :month "long" - :year "numeric"}) - date)] - [:p.subtitle (apply str author - (when position - [" - " position]))]]] - [:div.card-footer - [:a.card-footer-item - {:style {:margin-top :auto} - :onClick #(reset! entry-index idx)} - "View"]]]])] - (when @entry-index - [:div.content.is-medium - {:dangerouslySetInnerHTML - {:__html (:html (nth newsletter @entry-index))}}])]])))