How to connect an Open Library template to a page

Since Open Library is a wiki, you can create a new page in almost any namespace you want (assuming you are an admin). We created by going to that URL and clicking “Create it”.

So how can we get /libraries to use the /libraries/index.html template?

Anand helped by adding some python code in openlibrary/plugins/openlibrary/

class libraries(
    def GET(self):
        return render_template("libraries/index")

If the path of the page isn’t at the top level of the namespace, you can specify a path:

class locations(
    path = "/libraries/locations.txt"

    def GET(self):
        libraries = inlibrary.get_libraries()
        return render_template("libraries/locations")