couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <>
Subject Re: CouchDB: Can a hierarchical URL structure be accomplished with unique documents?
Date Tue, 12 Nov 2013 21:19:20 GMT
On 12. November 2013 at 21:46:08, Hank Knight ( wrote:
> Here is an example of an entire website run entirely from attachments  
> of a single document:
> It does not work so well when I add the attachments to unique documents:  

Hi Hank,

What does “not work so well” mean?

> The site can be managed here:
> I would like for this to work like the first link but with each
> attachment associated with a unique document.
> Is this even possible? If so, how?

I’m assuming you noticed that the relative paths aren’t correct, but I don’t see anything
to suggest you have fixed it:

_id: "zootemplate/index.html",
_rev: "2-fbd9de49558247a3115ba061daf8774f",
_attachments: {
zootemplate/index.html: {
content_type: "text/html",
revpos: 2,
digest: "md5-IBLi/kLPPv0dDYOhPMjlSQ==",
length: 6598,
stub: true

should have things like the style sheet included:

should appear in the attachment list as:

_attachments: {
zootemplate/index.html/css/style.css: {
content_type: “text/css",

or the links made relative to another doc etc.

I’m not clear what you are asking for, but I’d have a set of documents, say 1 per each
standard template or layout, and another with the customer-specific content:




and index.html could contain relative links ../../template1/style.css etc.

Hopefully that example makes sense for your use case.

For example, the whole iriscouch site is delivered out of a single couchdb document:
and the css etc are all just attachments. Magic.

Also, this old intro might be useful -
with IIRC code here


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message