Hi,
I have always used Handlebars serverside to do SEO-friendly pages
- a list that merges data and templates
- the doc type or other field decides what template to work
- used nested templates (sub teemplates for "modules" in the page" to assemble 
pages on the fly
- SEO agency of my clients get alle the snake oil inserted that they have sold 
as ways to improve page rank

the trick
- all templates in a templates folder (branch) of the design document
- refer to templates dynamically in the list of the design document as.. 

                this.templates[doc.layout]

your entire template library is in memory after design document is loaded if I 
understand this correctly

johs

 

> On 19. nov. 2015, at 02.52, Giovanni Lenzi <g.le...@smileupps.com> wrote:
> 
> Hi Robin and Nick,
> You definitely CAN output full html, non js, SEO optimized web pages. We
> use that for our store index and apps pages (on
> https://www.smileupps.com/store).
> 
> We needed to:
> 1. create html templates of your pages with a templating library(we used
> handlebars.js),
> 2. precompile these templates before 'couchapp push' as server side
> javascript file in ddoc, such as lib/templates.js
> 3. create a view with name(path) of your page as key, emitting documents
> containing information of a same page under the same key. These elements
> may be html for header, links for navigation bar, markdown or raw html for
> your page content, a list of apps, or anything else
> 4. create a list which uses:
> - getrow() to fetch above elements in memory,
> - var tpls=require(lib/templates),
> - obtain html by merging templates and documents:
> htmlforheader=tpls.header(headerdocument),
> htmlfornavbar=tpls.navbar(linksdocuments)
> - return/output html from the list function
> 
> Probably the most difficult part is to precompile correctly those
> templates, in a way you can use them server side withouth issues. We used a
> node.js handlebar precompiler automatically run before 'couchapp push', but
> I think it should be possible to use  ermouth's ddoc.me to obtain the same
> result much more easily. Maybe he can speak for us..
> 
> Hope this helps,
> --Giovanni
> Il giorno 19/nov/2015 00:13, "Robin Millette" <ro...@millette.info> ha
> scritto:
> 
>> Hi,
>> 
>> First time writing to this list, or any couchdb list for that matter.
>> Hope to see a brillant couchapp (the concept) revival in 2016!
>> 
>> On Wed, Nov 18, 2015 at 5:53 PM, Nick <oinksoc...@letterboxes.org> wrote:
>> 
>>> Thanks - which indeed implies I am right and there is no solution that
>> works
>>> without JS on the client...
>> 
>> I also prefer to send complete html responses, for SEO and general
>> crawling benefits.
>> One strategy I used was to craft views to output different kinds of
>> rows. For instance, you've got you main content row, and you can also
>> have "block" rows, to pepper your html page with.
>> The list fonction can then handle those different row types and
>> generate proper html.
>> 
>> 
>> --
>> Robin
>> 

Reply via email to