docpad

Static vs. dynamic content in docpad system - how to create dynamic content?

╄→гoц情女王★ 提交于 2019-12-04 12:18:37
问题 DocPad is described as being comparable to other static site generators, but it is also described as being "not limited to static site generation". I've been browsing the DocPad website and other documentation and haven't yet been able to find anything that seems to explain how to incorporate dynamic content, and what types of limitations may be involved? As a relative beginner, I am wondering if anyone can help me better understand the methodology whereby dynamic content would be

Need explanation for Docpad persistence

倖福魔咒の 提交于 2019-12-04 10:09:55
I am pretty confused with the architecture behind how data is persisted in Docpad. From blogs and forums, I got to know in-memory (and/or out directory) is used for generated contents. But one of the selling points of Docpad is "completely file based". From the sound of it, hosting it on Heroku or any ephemeral file system doesn't seem logical. Can anyone give some explanation/clarification? DocPad is pitched as a next generation web architecture. This mindmap showcases why we call it that perfectly: DocPad Architecture Vision http://d.pr/i/jmmZ+ The workflow being like so: Importers bring

How can I minify HTML, CSS and JavaScript files in DocPad?

。_饼干妹妹 提交于 2019-12-03 10:48:06
问题 I would like to minify HTML, CSS and JavaScript files when I hit docpad generate , how can I do that? 回答1: There are a few ways you can go about this. The most prominent and most immediate way is to modify your docpad configuration file to trigger an external tool like grunt to minify your assets via the grunt minify task. Here is a gist that showcases this. Alternatively, there is also Cloudflare which is an amazing website DNS server that also acts as a CDN for your website's content, and

Static vs. dynamic content in docpad system - how to create dynamic content?

ε祈祈猫儿з 提交于 2019-12-03 07:32:26
DocPad is described as being comparable to other static site generators, but it is also described as being "not limited to static site generation". I've been browsing the DocPad website and other documentation and haven't yet been able to find anything that seems to explain how to incorporate dynamic content, and what types of limitations may be involved? As a relative beginner, I am wondering if anyone can help me better understand the methodology whereby dynamic content would be incorporated into DocPad...? e.g. AJAX, and dynamic server-side scripts for doing things like dynamically loading

How can I minify HTML, CSS and JavaScript files in DocPad?

谁说我不能喝 提交于 2019-12-03 00:21:12
I would like to minify HTML, CSS and JavaScript files when I hit docpad generate , how can I do that? There are a few ways you can go about this. The most prominent and most immediate way is to modify your docpad configuration file to trigger an external tool like grunt to minify your assets via the grunt minify task . Here is a gist that showcases this. Alternatively, there is also Cloudflare which is an amazing website DNS server that also acts as a CDN for your website's content, and minifies your assets automatically post-deployment. Read more here. Also, while it isn't minify related, you

how to handle routes in Docpad

岁酱吖の 提交于 2019-12-02 17:54:46
问题 This should be really obvious but I just cant get my head around it How do I add extra routes in Docpad?? Im looking for the Docpad equivalent to express.js's app.post("*", function(res,req,next){ //Do stuff } As far as I can understand I need to create a plugin module for this? How do I tell Docpad to use my routes? Im guessing it has something to do with the extend-server event, do I put that as parameter in docpad.coffee? How do I pass the req object to my route handler? can I force docpad

Bootstrap drop-down menus and tabbable tabs on Docpad

℡╲_俬逩灬. 提交于 2019-12-02 11:52:30
I've created a Docpad site using the Twitter Bootstrap skeleton. I cannot get either Bootstrap's tabbable tabs or drop-down menus to work. They render, but do not function. From research on Stackoverflow it appears that additional jquery needs to be included for these Bootstrap functions. I've tried to add it in to Docpad but have been unsuccessful. Has anyone gotten these Bootstrap functions to work in Docpad? for Boostrap, to run drop-down menu i know its need this code in a page to work: $('.dropdown-toggle').dropdown(); this call a bootstrap plugin. the sequence call for js files is:

how to handle routes in Docpad

会有一股神秘感。 提交于 2019-12-02 09:30:25
This should be really obvious but I just cant get my head around it How do I add extra routes in Docpad?? Im looking for the Docpad equivalent to express.js's app.post("*", function(res,req,next){ //Do stuff } As far as I can understand I need to create a plugin module for this? How do I tell Docpad to use my routes? Im guessing it has something to do with the extend-server event, do I put that as parameter in docpad.coffee? How do I pass the req object to my route handler? can I force docpad to always consider my routing first? kinda like middleware? can I pass a (processed) url back to

Show only partial blog post in Docpad, with “Read More” link

一曲冷凌霜 提交于 2019-11-30 23:49:28
I need show only partial blog post... with a "Read more" link to full blog post. HOME: List last 5 partial/intro posts with Read More. This is possible in Docpad? Thanks.. May by getCuttedContent: (content) -> i = content.search('<!-- Read more -->') if i >= 0 content[0..i-1] else content hasReadMore: (content) -> content.search('<!-- Read more -->') >= 0 more and <% posts = @getCollection('posts') %> <% for i in [@document.page.startIdx...@document.page.endIdx]: %> <% document = posts.at(i).toJSON() %> <article class="post"> <h3><span class="posts_date"><%= @formatDate(document.date) %></span