Creates URLs like /2012/12/15/merry-xmas for your blog posts.
Requires momentjs to be installed: npm install --save moment
| https://gist.github.com/balupton/4752443 |
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.
| | steamname: FizzVR | |
| | steamID32: STEAM_0:1:50351163 | |
| | steamID64: http://steamcommunity.com/profiles/76561198060968055 | |
| | customURL: http://steamcommunity.com/id/fizzvr | |
| | steamrep: http://steamrep.com/profiles/76561198060968055 |
| <script> | |
| (function(f,i,z,v,r,e,c){f['GoogleAnalyticsObject']=r;f[r]=f[r]||function(){ | |
| (f[r].q=f[r].q||[]).push(arguments)},f[r].l=1*new Date();e=i.createElement(z), | |
| c=i.getElementsByTagName(z)[0];e.async=1;e.src=v;c.parentNode.insertBefore(e,c) | |
| })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
| ga('create', 'UA-<%- @site.anal %>', 'fizzvr.github.io'); | |
| ga('send', 'pageview'); | |
| </script> |
| <a href="mailto:fizzvr@gmail.com">fizzvr@gmail.com</a> |