From fe74245dad8f4d4456e7a3a61c77ffebb59ea7b0 Mon Sep 17 00:00:00 2001 From: Las Zenow Date: Sun, 14 Sep 2014 00:54:52 -0500 Subject: [PATCH] Add description.json following the ahmia proposal http://msydqstlz2kzerdg.onion/documentation/descriptionProposal/ --- config.go | 15 ++++++++------- description.json | 9 +++++++++ trantor.go | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 description.json diff --git a/config.go b/config.go index 96ad221..14be217 100644 --- a/config.go +++ b/config.go @@ -27,13 +27,14 @@ const ( NUM_NEWS = 10 DAYS_NEWS_INDEXPAGE = 15 - STORE_PATH = "store/" - TEMPLATE_PATH = "templates/" - CSS_PATH = "css/" - JS_PATH = "js/" - IMG_PATH = "img/" - ROBOTS_PATH = "robots.txt" - LOGGER_CONFIG = "logger.xml" + STORE_PATH = "store/" + TEMPLATE_PATH = "templates/" + CSS_PATH = "css/" + JS_PATH = "js/" + IMG_PATH = "img/" + ROBOTS_PATH = "robots.txt" + DESCRIPTION_PATH = "description.json" + LOGGER_CONFIG = "logger.xml" IMG_WIDTH_BIG = 300 IMG_WIDTH_SMALL = 60 diff --git a/description.json b/description.json new file mode 100644 index 0000000..a7ffeb7 --- /dev/null +++ b/description.json @@ -0,0 +1,9 @@ +{ + "title": "Imperial Library of Trantor", + "description": "The Imperial Library of Trantor (also known as Galactic Library) is a repository of DRM-free ebooks on ePub format. A community base library with thousands of books on multiple languages (english, german, spamish, french, ...) and different topics like novels, essays, computing, ...", + "relation": "http://xfmro77i3lixucja.onion/", + "keywords": "epub, ebook, book, download, novel, essay, computing, trantor, library, imperial library, drm-free, ereader, kindle", + "type": "ebook library", + "language": "en,de,fr,es,it,gr,zh", + "contactInformation": "zenow@riseup.net" +} diff --git a/trantor.go b/trantor.go index 0898eb6..ed16ab7 100644 --- a/trantor.go +++ b/trantor.go @@ -186,6 +186,7 @@ func initRouter(db *database.DB, sg *StatsGatherer) { r.HandleFunc("/", sg.Gather(indexHandler)) r.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, ROBOTS_PATH) }) + r.HandleFunc("/description.json", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, DESCRIPTION_PATH) }) r.HandleFunc("/book/{id:"+id_pattern+"}", sg.Gather(bookHandler)) r.HandleFunc("/search/", sg.Gather(searchHandler))