Creates URLs like /2012/12/15/merry-xmas for your blog posts.
Requires momentjs to be installed: npm install --save moment
Creates URLs like /2012/12/15/merry-xmas for your blog posts.
Requires momentjs to be installed: npm install --save moment
| # Define our Configuration | |
| docpadConfig = | |
| # Define our own Collections | |
| collections: | |
| # Posts | |
| # Anything outputted to the posts directory can be considered a post | |
| # Sort the posts by newest first | |
| # And set their layout to `post` automatically if it isn't already set |
Install Moment via npm install --save moment
Add it and a template helper to your docpad configuration file
Use the template helper in your app
Uses a docpad configuration file to specify template data that we can use in our document to generate absolute urls.
| # Define our Configuration | |
| docpadConfig = | |
| # Define our own Collections | |
| collections: | |
| # Posts | |
| # Anything outputted to the posts directory can be considered a post | |
| # Sort the posts by newest first | |
| # And set their layout to `post` automatically if it isn't already set |
Generates a sitemap.txt file your website. To use add the contents of the docpad.coffee file of this gist into your docpad configuration file.
Note: There is now the Sitemap Plugin which generates a proper sitemap.xml file for you automatically instead of the basic sitemap.txt file this gist creates.
| // Load the TCP Library | |
| net = require('net'); | |
| // Keep track of the chat clients | |
| var clients = []; | |
| // Start a TCP Server | |
| net.createServer(function (socket) { | |
| // Identify this client |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| ############################################# | |
| # Push de la rama actual | |
| git push origin $rama_actual | |
| ############################################# | |
| # Volver a un commit anterior, descartando los cambios | |
| git reset --HARD $SHA1 | |
| ############################################# | |
| # Ver y descargar Ramas remotas |