diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..33ceb8f --- /dev/null +++ b/Makefile @@ -0,0 +1 @@ +Makefile \ No newline at end of file diff --git a/README.md b/README.md index 6346b25..243b4e7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # whiterabbit -![gitgalaxy](https://img.shields.io/badge/website-gitgalaxy.com-blue.svg) ![shield](https://img.shields.io/badge/live-podcast.gitgalaxy.com-green.svg) ![follow](https://img.shields.io/twitter/follow/gitgalaxy.svg?style=social&label=Follow) +[![gitgalaxy](https://img.shields.io/badge/website-gitgalaxy.com-blue.svg)](https://gitgalaxy.com) [![shield](https://img.shields.io/badge/live-podcast.gitgalaxy.com-green.svg)](https://podcast.gitgalaxy.com) [![follow](https://img.shields.io/twitter/follow/gitgalaxy.svg?style=social&label=Follow)](https://twitter.com/gitgalaxy) podcast rss generator and cms in golang diff --git a/admin.go b/src/admin.go similarity index 73% rename from admin.go rename to src/admin.go index ef5bd51..0477085 100644 --- a/admin.go +++ b/src/admin.go @@ -1,3 +1,9 @@ +/* admin.go + * + * Here is where all the neccesary functions for managing episodes + * live, e.g adding removing etc. +*/ + package main import ( @@ -7,6 +13,7 @@ import ( "io/ioutil" "io" "os" + "log" ) func CreateEpisode(w http.ResponseWriter, r *http.Request) { @@ -42,4 +49,15 @@ func CreateEpisode(w http.ResponseWriter, r *http.Request) { defer f.Close() io.Copy(f, file) } +} + +func RemoveEpisode(episode string) { + // Episode should be the full MP3 filename + // Remove MP3 first + os.Remove(episode) + sn,err := strings.Replace(episode, ".mp3", "_SHOWNOTES.md", 2) + if err != nil { + log.Fatal(err) + } + os.Remove(sn) } \ No newline at end of file diff --git a/assets/admin.html b/src/assets/admin.html similarity index 100% rename from assets/admin.html rename to src/assets/admin.html diff --git a/assets/index.html b/src/assets/index.html similarity index 100% rename from assets/index.html rename to src/assets/index.html diff --git a/assets/static/styles.css b/src/assets/static/styles.css similarity index 100% rename from assets/static/styles.css rename to src/assets/static/styles.css diff --git a/config.json b/src/config.json similarity index 100% rename from config.json rename to src/config.json diff --git a/generate_rss.go b/src/generate_rss.go similarity index 100% rename from generate_rss.go rename to src/generate_rss.go diff --git a/webserver.go b/src/webserver.go similarity index 100% rename from webserver.go rename to src/webserver.go