{"action":"created","comment":{"url":"https://api.github.com/repos/hashobject/perun/pulls/comments/32799511","id":32799511,"diff_hunk":"@@ -74,18 +73,43 @@\n       (u/info \"Remove draft files. Remaining %s files\\n\" (count updated-files))\n       fs-with-meta)))\n \n-(defn- create-filepath [file]\n-  (assoc file :filepath (str  \"/\" (:filename file) \"/index.html\")))\n+(defn ^:private default-slug-fn [filename]\n+  (->> (string/split filename #\"[-\\.]\")\n+       (drop 3)\n+       drop-last\n+       (string/join \"-\")\n+       string/lower-case))\n+\n+(deftask slug\n+  \"Adds :slug key to files metadata. Slug is derived from filename.\"\n+  [s slug-fn SLUGFN code \"Function to build slug from filename\"]\n+  (boot/with-pre-wrap fileset\n+    (let [slug-fn       (or slug-fn default-slug-fn)\n+          files         (:metadata (meta fileset))\n+          updated-files (into {}","path":"src/io/perun.clj","position":72,"original_position":72,"commit_id":"27547a6ed7ae446d029a00be49543bad768d1203","original_commit_id":"27547a6ed7ae446d029a00be49543bad768d1203","user":{"login":"podviaznikov","id":429706,"avatar_url":"https://avatars.githubusercontent.com/u/429706?v=3","gravatar_id":"","url":"https://api.github.com/users/podviaznikov","html_url":"https://github.com/podviaznikov","followers_url":"https://api.github.com/users/podviaznikov/followers","following_url":"https://api.github.com/users/podviaznikov/following{/other_user}","gists_url":"https://api.github.com/users/podviaznikov/gists{/gist_id}","starred_url":"https://api.github.com/users/podviaznikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/podviaznikov/subscriptions","organizations_url":"https://api.github.com/users/podviaznikov/orgs","repos_url":"https://api.github.com/users/podviaznikov/repos","events_url":"https://api.github.com/users/podviaznikov/events{/privacy}","received_events_url":"https://api.github.com/users/podviaznikov/received_events","type":"User","site_admin":false},"body":"You can use `https://github.com/hashobject/perun/blob/master/src/io/perun/core.clj#L36` function here. Will be a little bit shorter","created_at":"2015-06-19T03:38:50Z","updated_at":"2015-06-19T03:38:50Z","html_url":"https://github.com/hashobject/perun/pull/21#discussion_r32799511","pull_request_url":"https://api.github.com/repos/hashobject/perun/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/hashobject/perun/pulls/comments/32799511"},"html":{"href":"https://github.com/hashobject/perun/pull/21#discussion_r32799511"},"pull_request":{"href":"https://api.github.com/repos/hashobject/perun/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/hashobject/perun/pulls/21","id":38058099,"html_url":"https://github.com/hashobject/perun/pull/21","diff_url":"https://github.com/hashobject/perun/pull/21.diff","patch_url":"https://github.com/hashobject/perun/pull/21.patch","issue_url":"https://api.github.com/repos/hashobject/perun/issues/21","number":21,"state":"open","locked":false,"title":"Customizable permalinks","user":{"login":"martinklepsch","id":97496,"avatar_url":"https://avatars.githubusercontent.com/u/97496?v=3","gravatar_id":"","url":"https://api.github.com/users/martinklepsch","html_url":"https://github.com/martinklepsch","followers_url":"https://api.github.com/users/martinklepsch/followers","following_url":"https://api.github.com/users/martinklepsch/following{/other_user}","gists_url":"https://api.github.com/users/martinklepsch/gists{/gist_id}","starred_url":"https://api.github.com/users/martinklepsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinklepsch/subscriptions","organizations_url":"https://api.github.com/users/martinklepsch/orgs","repos_url":"https://api.github.com/users/martinklepsch/repos","events_url":"https://api.github.com/users/martinklepsch/events{/privacy}","received_events_url":"https://api.github.com/users/martinklepsch/received_events","type":"User","site_admin":false},"body":"Permalinks should be easily customizable. The idea here is that the `permalink` task gets a function that determines the permalink based on the metadata of a file. We could create a slug based on the title of a file but that is complex and actually we already have a perfect slug at hand: the filename itself.\r\n\r\nIn most cases though the filename contains dates and other unwanted things. Thats where the `slug` task comes in: it adds a `:slug` key to the metadata based on the result of a `slug-fn` on the filename. `slug-fn` can be overwritten via task options of course.\r\n\r\nLet me know what you think","created_at":"2015-06-18T22:03:10Z","updated_at":"2015-06-19T03:38:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8b91152c309647befb945836ee249e4fe1f0afe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hashobject/perun/pulls/21/commits","review_comments_url":"https://api.github.com/repos/hashobject/perun/pulls/21/comments","review_comment_url":"https://api.github.com/repos/hashobject/perun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashobject/perun/issues/21/comments","statuses_url":"https://api.github.com/repos/hashobject/perun/statuses/27547a6ed7ae446d029a00be49543bad768d1203","head":{"label":"martinklepsch:refactor-permalinks","ref":"refactor-permalinks","sha":"27547a6ed7ae446d029a00be49543bad768d1203","user":{"login":"martinklepsch","id":97496,"avatar_url":"https://avatars.githubusercontent.com/u/97496?v=3","gravatar_id":"","url":"https://api.github.com/users/martinklepsch","html_url":"https://github.com/martinklepsch","followers_url":"https://api.github.com/users/martinklepsch/followers","following_url":"https://api.github.com/users/martinklepsch/following{/other_user}","gists_url":"https://api.github.com/users/martinklepsch/gists{/gist_id}","starred_url":"https://api.github.com/users/martinklepsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinklepsch/subscriptions","organizations_url":"https://api.github.com/users/martinklepsch/orgs","repos_url":"https://api.github.com/users/martinklepsch/repos","events_url":"https://api.github.com/users/martinklepsch/events{/privacy}","received_events_url":"https://api.github.com/users/martinklepsch/received_events","type":"User","site_admin":false},"repo":{"id":37426947,"name":"perun","full_name":"martinklepsch/perun","owner":{"login":"martinklepsch","id":97496,"avatar_url":"https://avatars.githubusercontent.com/u/97496?v=3","gravatar_id":"","url":"https://api.github.com/users/martinklepsch","html_url":"https://github.com/martinklepsch","followers_url":"https://api.github.com/users/martinklepsch/followers","following_url":"https://api.github.com/users/martinklepsch/following{/other_user}","gists_url":"https://api.github.com/users/martinklepsch/gists{/gist_id}","starred_url":"https://api.github.com/users/martinklepsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinklepsch/subscriptions","organizations_url":"https://api.github.com/users/martinklepsch/orgs","repos_url":"https://api.github.com/users/martinklepsch/repos","events_url":"https://api.github.com/users/martinklepsch/events{/privacy}","received_events_url":"https://api.github.com/users/martinklepsch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martinklepsch/perun","description":"Static site generation build with Clojure and Boot","fork":true,"url":"https://api.github.com/repos/martinklepsch/perun","forks_url":"https://api.github.com/repos/martinklepsch/perun/forks","keys_url":"https://api.github.com/repos/martinklepsch/perun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martinklepsch/perun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martinklepsch/perun/teams","hooks_url":"https://api.github.com/repos/martinklepsch/perun/hooks","issue_events_url":"https://api.github.com/repos/martinklepsch/perun/issues/events{/number}","events_url":"https://api.github.com/repos/martinklepsch/perun/events","assignees_url":"https://api.github.com/repos/martinklepsch/perun/assignees{/user}","branches_url":"https://api.github.com/repos/martinklepsch/perun/branches{/branch}","tags_url":"https://api.github.com/repos/martinklepsch/perun/tags","blobs_url":"https://api.github.com/repos/martinklepsch/perun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martinklepsch/perun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martinklepsch/perun/git/refs{/sha}","trees_url":"https://api.github.com/repos/martinklepsch/perun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martinklepsch/perun/statuses/{sha}","languages_url":"https://api.github.com/repos/martinklepsch/perun/languages","stargazers_url":"https://api.github.com/repos/martinklepsch/perun/stargazers","contributors_url":"https://api.github.com/repos/martinklepsch/perun/contributors","subscribers_url":"https://api.github.com/repos/martinklepsch/perun/subscribers","subscription_url":"https://api.github.com/repos/martinklepsch/perun/subscription","commits_url":"https://api.github.com/repos/martinklepsch/perun/commits{/sha}","git_commits_url":"https://api.github.com/repos/martinklepsch/perun/git/commits{/sha}","comments_url":"https://api.github.com/repos/martinklepsch/perun/comments{/number}","issue_comment_url":"https://api.github.com/repos/martinklepsch/perun/issues/comments{/number}","contents_url":"https://api.github.com/repos/martinklepsch/perun/contents/{+path}","compare_url":"https://api.github.com/repos/martinklepsch/perun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martinklepsch/perun/merges","archive_url":"https://api.github.com/repos/martinklepsch/perun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martinklepsch/perun/downloads","issues_url":"https://api.github.com/repos/martinklepsch/perun/issues{/number}","pulls_url":"https://api.github.com/repos/martinklepsch/perun/pulls{/number}","milestones_url":"https://api.github.com/repos/martinklepsch/perun/milestones{/number}","notifications_url":"https://api.github.com/repos/martinklepsch/perun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martinklepsch/perun/labels{/name}","releases_url":"https://api.github.com/repos/martinklepsch/perun/releases{/id}","created_at":"2015-06-14T19:44:34Z","updated_at":"2015-06-14T19:44:35Z","pushed_at":"2015-06-18T22:26:31Z","git_url":"git://github.com/martinklepsch/perun.git","ssh_url":"git@github.com:martinklepsch/perun.git","clone_url":"https://github.com/martinklepsch/perun.git","svn_url":"https://github.com/martinklepsch/perun","homepage":"","size":210,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hashobject:master","ref":"master","sha":"bb3a2677f6f87793cd5e60653838f7831c082fc7","user":{"login":"hashobject","id":4522707,"avatar_url":"https://avatars.githubusercontent.com/u/4522707?v=3","gravatar_id":"","url":"https://api.github.com/users/hashobject","html_url":"https://github.com/hashobject","followers_url":"https://api.github.com/users/hashobject/followers","following_url":"https://api.github.com/users/hashobject/following{/other_user}","gists_url":"https://api.github.com/users/hashobject/gists{/gist_id}","starred_url":"https://api.github.com/users/hashobject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashobject/subscriptions","organizations_url":"https://api.github.com/users/hashobject/orgs","repos_url":"https://api.github.com/users/hashobject/repos","events_url":"https://api.github.com/users/hashobject/events{/privacy}","received_events_url":"https://api.github.com/users/hashobject/received_events","type":"Organization","site_admin":false},"repo":{"id":36089677,"name":"perun","full_name":"hashobject/perun","owner":{"login":"hashobject","id":4522707,"avatar_url":"https://avatars.githubusercontent.com/u/4522707?v=3","gravatar_id":"","url":"https://api.github.com/users/hashobject","html_url":"https://github.com/hashobject","followers_url":"https://api.github.com/users/hashobject/followers","following_url":"https://api.github.com/users/hashobject/following{/other_user}","gists_url":"https://api.github.com/users/hashobject/gists{/gist_id}","starred_url":"https://api.github.com/users/hashobject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashobject/subscriptions","organizations_url":"https://api.github.com/users/hashobject/orgs","repos_url":"https://api.github.com/users/hashobject/repos","events_url":"https://api.github.com/users/hashobject/events{/privacy}","received_events_url":"https://api.github.com/users/hashobject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashobject/perun","description":"Static site generation build with Clojure and Boot","fork":false,"url":"https://api.github.com/repos/hashobject/perun","forks_url":"https://api.github.com/repos/hashobject/perun/forks","keys_url":"https://api.github.com/repos/hashobject/perun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashobject/perun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashobject/perun/teams","hooks_url":"https://api.github.com/repos/hashobject/perun/hooks","issue_events_url":"https://api.github.com/repos/hashobject/perun/issues/events{/number}","events_url":"https://api.github.com/repos/hashobject/perun/events","assignees_url":"https://api.github.com/repos/hashobject/perun/assignees{/user}","branches_url":"https://api.github.com/repos/hashobject/perun/branches{/branch}","tags_url":"https://api.github.com/repos/hashobject/perun/tags","blobs_url":"https://api.github.com/repos/hashobject/perun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashobject/perun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashobject/perun/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashobject/perun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashobject/perun/statuses/{sha}","languages_url":"https://api.github.com/repos/hashobject/perun/languages","stargazers_url":"https://api.github.com/repos/hashobject/perun/stargazers","contributors_url":"https://api.github.com/repos/hashobject/perun/contributors","subscribers_url":"https://api.github.com/repos/hashobject/perun/subscribers","subscription_url":"https://api.github.com/repos/hashobject/perun/subscription","commits_url":"https://api.github.com/repos/hashobject/perun/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashobject/perun/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashobject/perun/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashobject/perun/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashobject/perun/contents/{+path}","compare_url":"https://api.github.com/repos/hashobject/perun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashobject/perun/merges","archive_url":"https://api.github.com/repos/hashobject/perun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashobject/perun/downloads","issues_url":"https://api.github.com/repos/hashobject/perun/issues{/number}","pulls_url":"https://api.github.com/repos/hashobject/perun/pulls{/number}","milestones_url":"https://api.github.com/repos/hashobject/perun/milestones{/number}","notifications_url":"https://api.github.com/repos/hashobject/perun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashobject/perun/labels{/name}","releases_url":"https://api.github.com/repos/hashobject/perun/releases{/id}","created_at":"2015-05-22T18:51:09Z","updated_at":"2015-06-16T18:44:22Z","pushed_at":"2015-06-18T22:26:31Z","git_url":"git://github.com/hashobject/perun.git","ssh_url":"git@github.com:hashobject/perun.git","clone_url":"https://github.com/hashobject/perun.git","svn_url":"https://github.com/hashobject/perun","homepage":"","size":437,"stargazers_count":22,"watchers_count":22,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashobject/perun/pulls/21"},"html":{"href":"https://github.com/hashobject/perun/pull/21"},"issue":{"href":"https://api.github.com/repos/hashobject/perun/issues/21"},"comments":{"href":"https://api.github.com/repos/hashobject/perun/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/hashobject/perun/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/hashobject/perun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashobject/perun/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/hashobject/perun/statuses/27547a6ed7ae446d029a00be49543bad768d1203"}}}}