{"id":16189409,"url":"https://github.com/caolan/blog","last_synced_at":"2025-07-13T12:06:33.493Z","repository":{"id":1372952,"uuid":"1324855","full_name":"caolan/blog","owner":"caolan","description":"CouchApp code used to run my blog","archived":false,"fork":false,"pushed_at":"2012-03-12T03:12:17.000Z","size":1073,"stargazers_count":15,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T15:07:18.534Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://caolanmcmahon.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caolan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-02-03T17:03:40.000Z","updated_at":"2019-08-13T14:41:20.000Z","dependencies_parsed_at":"2022-07-07T06:33:28.945Z","dependency_job_id":null,"html_url":"https://github.com/caolan/blog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caolan%2Fblog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caolan%2Fblog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caolan%2Fblog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caolan%2Fblog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caolan","download_url":"https://codeload.github.com/caolan/blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243965774,"owners_count":20375917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T07:35:21.096Z","updated_at":"2025-03-19T03:30:53.431Z","avatar_url":"https://github.com/caolan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My blog\n\nThis is the CouchApp running at [caolanmcmahon.com](http://caolanmcmahon.com),\nand was an early experiment in using [kanso](http://kansojs.org).\n\nFeel free to learn from or re-use the source code for your own blog, but\nplease don't reproduce the design (css) or the content without my permission.\n\n\n## Running the code\n\nFirst, install [kanso](http://kansojs.org):\n\n    git clone git://github.com/caolan/kanso.git\n    cd kanso\n    git submodule init\n    git submodule update\n    make \u0026\u0026 sudo make install\n\nTo deploy this code to a local CouchDB instance:\n\n    kanso push http://localhost:5984/blog\n\nIn production I use the minify and minify-attachments flags when pushing:\n\n    kanso push http://remote/blog --minify --minify-attachments\n\nThe data directory contains previous blog posts which were written using the\nold code (a static site generator using git). These can be added to the blog\ndatabase we just created using the pushdata command:\n\n    kanso pushdata http://localhost:5984/blog data\n\nFor help using kanso, just type:\n\n    kanso help\n\nIf you find any bugs please let me know!\n\n\n## Structure\n\n* __data__ - some old data I needed to migrate, _you can ignore this_\n* __deps__ - vendor files used by my code in the lib directory\n* __files__ - a dumping ground for my files on the web, _you can ignore this_\n* __lib__ - the main application code, see app.js for how it fits together\n* __static__ - static attachments: css, js, images etc\n* __templates__ - dust templates used by the app\n\n\n## Replication and private drafts\n\nI've added a filter function which allows me to replicate only published\ndocuments. Using this, I can have one public database which replicates with a\nprivate database. I can then author and view draft posts on the private\ndatabase and have them automatically made available on the public site when\npublished.\n\nTo set up continous replication with this filter, POST the following to\n/_replicate (replacing hostnames and database names as appropriate):\n\n    {\n        \"source\": \"http://hostname/blog_private\",\n        \"target\": \"http://hostname/blog_public\",\n        \"filter\": \"blog/published\",\n        \"continuous\": true\n    }\n\n\n## Deploying to older CouchDB instances (\u003c 1.1.x)\n\nI currently host this at couchone.com, and CouchDB 1.1 hasn't been released\nyet. On older versions of CouchDB kanso cannot detect the baseURL properly,\nwhich means if you wish to use rewrites you have to manually set the baseURL\nto an empty string when pushing the app:\n\n    kanso push http://username.couchone.com/blog --baseURL=\"\"\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaolan%2Fblog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaolan%2Fblog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaolan%2Fblog/lists"}