incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <...@jsonified.com>
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 (hknight555@gmail.com) wrote:
>  
> Here is an example of an entire website run entirely from attachments  
> of a single document:
>  
> https://samplecouchpoweredsite.couchappy.com/site/www/zootemplate/index.html  
>  
> It does not work so well when I add the attachments to unique documents:  
> https://samplecouchpoweredsite.couchappy.com/site2/zootemplate%2findex.html/zootemplate%2findex.html
 

Hi Hank,

What does “not work so well” mean?

> The site can be managed here:
> https://samplecouchpoweredsite.couchappy.com/_utils/  
>  
> 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:

https://samplecouchpoweredsite.couchappy.com/site2/zootemplate%2findex.html

{
_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:

	https://samplecouchpoweredsite.couchappy.com/site2/zootemplate%2findex.html/css/style.css

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:

template1
    _/style.css
    -/asset.js

template2
    _/style.css
    -/asset.js

mysite1
    _/index.html

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: http://www.iriscouch.com/
and the css etc are all just attachments. Magic.

Also, this old intro might be useful - http://www.slideshare.net/Couchbase/couchconfsfdesigningcouchbasedocuments
with IIRC code here https://github.com/bigbluehat/blueink

A+
Dave


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