Add description.json following the ahmia proposal

http://msydqstlz2kzerdg.onion/documentation/descriptionProposal/
This commit is contained in:
Las Zenow 2014-09-14 00:54:52 -05:00
parent deece4f5d0
commit fe74245dad
3 changed files with 18 additions and 7 deletions

View file

@ -33,6 +33,7 @@ const (
JS_PATH = "js/" JS_PATH = "js/"
IMG_PATH = "img/" IMG_PATH = "img/"
ROBOTS_PATH = "robots.txt" ROBOTS_PATH = "robots.txt"
DESCRIPTION_PATH = "description.json"
LOGGER_CONFIG = "logger.xml" LOGGER_CONFIG = "logger.xml"
IMG_WIDTH_BIG = 300 IMG_WIDTH_BIG = 300

9
description.json Normal file
View file

@ -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"
}

View file

@ -186,6 +186,7 @@ func initRouter(db *database.DB, sg *StatsGatherer) {
r.HandleFunc("/", sg.Gather(indexHandler)) r.HandleFunc("/", sg.Gather(indexHandler))
r.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, ROBOTS_PATH) }) 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("/book/{id:"+id_pattern+"}", sg.Gather(bookHandler))
r.HandleFunc("/search/", sg.Gather(searchHandler)) r.HandleFunc("/search/", sg.Gather(searchHandler))