{"action":"created","comment":{"url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/comments/217525567","pull_request_review_id":155261691,"id":217525567,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzUyNTU2Nw==","diff_hunk":"@@ -0,0 +1,64 @@\n+# frozen_string_literal: true\n+\n+#  (c) Aaron Gustafson\n+#  https://github.com/aarongustafson/jekyll-webmention_io\n+#  Licence : MIT\n+#\n+\n+module Jekyll\n+  module WebmentionIO\n+    class JSHandler\n+      attr_reader :destination, :resource_url\n+\n+      DEFAULTS = {\n+        \"destination\" => \"js\",\n+        \"source\"      => true,\n+        \"deploy\"      => true,\n+        \"uglify\"      => true,\n+      }.freeze\n+\n+      def initialize(site)\n+        js_config = site.config.dig(\"webmentions\", \"js\")\n+\n+        @disabled = js_config == false\n+\n+        js_config = {} unless js_config.is_a?(Hash)\n+        js_config = DEFAULTS.merge(js_config)\n+\n+        @deploy, @uglify, @source, @destination = js_config.values_at(\"deploy\", \"uglify\", \"source\", \"destination\")\n+        @resource_url = File.join(\n+          \"\", site.config[\"baseurl\"], @destination, \"JekyllWebmentionIO.js\"\n+        )\n+      end\n+\n+      def disabled?\n+        @disabled == true\n+      end\n+\n+      def deploy?\n+        @deploy != false\n+      end\n+\n+      def uglify?\n+        @uglify != false\n+      end\n+\n+      def source?\n+        @source != false\n+      end\n+\n+      def render\n+        if disabled?\n+          Jekyll::WebmentionIO.log \"info\",\n+            \"JavaScript output is disabled, so the {% webmentions_js %} tag is being skipped\"\n+          return \"\"\n+        end\n+\n+        js_file = deploy? ? \"<script src=\\\"#{resource_url}\\\" async></script>\" : \"\"","path":"lib/jekyll/webmention_io/js_handler.rb","position":57,"original_position":57,"commit_id":"f406010b047c16856c82039277041d80cfe198e7","original_commit_id":"f406010b047c16856c82039277041d80cfe198e7","user":{"login":"aarongustafson","id":75736,"node_id":"MDQ6VXNlcjc1NzM2","avatar_url":"https://avatars3.githubusercontent.com/u/75736?v=4","gravatar_id":"","url":"https://api.github.com/users/aarongustafson","html_url":"https://github.com/aarongustafson","followers_url":"https://api.github.com/users/aarongustafson/followers","following_url":"https://api.github.com/users/aarongustafson/following{/other_user}","gists_url":"https://api.github.com/users/aarongustafson/gists{/gist_id}","starred_url":"https://api.github.com/users/aarongustafson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aarongustafson/subscriptions","organizations_url":"https://api.github.com/users/aarongustafson/orgs","repos_url":"https://api.github.com/users/aarongustafson/repos","events_url":"https://api.github.com/users/aarongustafson/events{/privacy}","received_events_url":"https://api.github.com/users/aarongustafson/received_events","type":"User","site_admin":false},"body":"Should that be `{@resource_url}`?","created_at":"2018-09-13T20:36:34Z","updated_at":"2018-09-13T20:36:34Z","html_url":"https://github.com/aarongustafson/jekyll-webmention_io/pull/100#discussion_r217525567","pull_request_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/100","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/comments/217525567"},"html":{"href":"https://github.com/aarongustafson/jekyll-webmention_io/pull/100#discussion_r217525567"},"pull_request":{"href":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/100"}}},"pull_request":{"url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/100","id":215249322,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MjQ5MzIy","html_url":"https://github.com/aarongustafson/jekyll-webmention_io/pull/100","diff_url":"https://github.com/aarongustafson/jekyll-webmention_io/pull/100.diff","patch_url":"https://github.com/aarongustafson/jekyll-webmention_io/pull/100.patch","issue_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/issues/100","number":100,"state":"open","locked":false,"title":"Render WebmentionJSTag with a dedicated class","user":{"login":"ashmaroli","id":12479464,"node_id":"MDQ6VXNlcjEyNDc5NDY0","avatar_url":"https://avatars0.githubusercontent.com/u/12479464?v=4","gravatar_id":"","url":"https://api.github.com/users/ashmaroli","html_url":"https://github.com/ashmaroli","followers_url":"https://api.github.com/users/ashmaroli/followers","following_url":"https://api.github.com/users/ashmaroli/following{/other_user}","gists_url":"https://api.github.com/users/ashmaroli/gists{/gist_id}","starred_url":"https://api.github.com/users/ashmaroli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashmaroli/subscriptions","organizations_url":"https://api.github.com/users/ashmaroli/orgs","repos_url":"https://api.github.com/users/ashmaroli/repos","events_url":"https://api.github.com/users/ashmaroli/events{/privacy}","received_events_url":"https://api.github.com/users/ashmaroli/received_events","type":"User","site_admin":false},"body":"Resolves #99 \r\n\r\nThe rendered output of `WebmentionJSTag` is the same irrespective of given `context`. So the content can be rendered once, cached elsewhere and then retrieved from the cache for each call to the tag's `:render` method.\r\n\r\n(This PR also involves a micro-optimization by caching array of supported_templates in the main module itself, to avoid unnecessary allocations)","created_at":"2018-09-13T11:24:25Z","updated_at":"2018-09-13T20:36:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e7312d7a68ad89c2234f1083b83cede6af49a6a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/100/commits","review_comments_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/100/comments","review_comment_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/issues/100/comments","statuses_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/statuses/f406010b047c16856c82039277041d80cfe198e7","head":{"label":"ashmaroli:js-tag-renderer","ref":"js-tag-renderer","sha":"f406010b047c16856c82039277041d80cfe198e7","user":{"login":"ashmaroli","id":12479464,"node_id":"MDQ6VXNlcjEyNDc5NDY0","avatar_url":"https://avatars0.githubusercontent.com/u/12479464?v=4","gravatar_id":"","url":"https://api.github.com/users/ashmaroli","html_url":"https://github.com/ashmaroli","followers_url":"https://api.github.com/users/ashmaroli/followers","following_url":"https://api.github.com/users/ashmaroli/following{/other_user}","gists_url":"https://api.github.com/users/ashmaroli/gists{/gist_id}","starred_url":"https://api.github.com/users/ashmaroli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashmaroli/subscriptions","organizations_url":"https://api.github.com/users/ashmaroli/orgs","repos_url":"https://api.github.com/users/ashmaroli/repos","events_url":"https://api.github.com/users/ashmaroli/events{/privacy}","received_events_url":"https://api.github.com/users/ashmaroli/received_events","type":"User","site_admin":false},"repo":{"id":147091861,"node_id":"MDEwOlJlcG9zaXRvcnkxNDcwOTE4NjE=","name":"jekyll-webmention_io","full_name":"ashmaroli/jekyll-webmention_io","owner":{"login":"ashmaroli","id":12479464,"node_id":"MDQ6VXNlcjEyNDc5NDY0","avatar_url":"https://avatars0.githubusercontent.com/u/12479464?v=4","gravatar_id":"","url":"https://api.github.com/users/ashmaroli","html_url":"https://github.com/ashmaroli","followers_url":"https://api.github.com/users/ashmaroli/followers","following_url":"https://api.github.com/users/ashmaroli/following{/other_user}","gists_url":"https://api.github.com/users/ashmaroli/gists{/gist_id}","starred_url":"https://api.github.com/users/ashmaroli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashmaroli/subscriptions","organizations_url":"https://api.github.com/users/ashmaroli/orgs","repos_url":"https://api.github.com/users/ashmaroli/repos","events_url":"https://api.github.com/users/ashmaroli/events{/privacy}","received_events_url":"https://api.github.com/users/ashmaroli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ashmaroli/jekyll-webmention_io","description":"A Jekyll Plugin for rendering Webmentions via Webmention.io","fork":true,"url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io","forks_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/forks","keys_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/teams","hooks_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/hooks","issue_events_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/issues/events{/number}","events_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/events","assignees_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/assignees{/user}","branches_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/branches{/branch}","tags_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/tags","blobs_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/git/refs{/sha}","trees_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/statuses/{sha}","languages_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/languages","stargazers_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/stargazers","contributors_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/contributors","subscribers_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/subscribers","subscription_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/subscription","commits_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/commits{/sha}","git_commits_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/git/commits{/sha}","comments_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/comments{/number}","issue_comment_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/issues/comments{/number}","contents_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/contents/{+path}","compare_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/merges","archive_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/downloads","issues_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/issues{/number}","pulls_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/pulls{/number}","milestones_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/milestones{/number}","notifications_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/labels{/name}","releases_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/releases{/id}","deployments_url":"https://api.github.com/repos/ashmaroli/jekyll-webmention_io/deployments","created_at":"2018-09-02T14:21:24Z","updated_at":"2018-09-02T14:21:26Z","pushed_at":"2018-09-13T19:40:25Z","git_url":"git://github.com/ashmaroli/jekyll-webmention_io.git","ssh_url":"git@github.com:ashmaroli/jekyll-webmention_io.git","clone_url":"https://github.com/ashmaroli/jekyll-webmention_io.git","svn_url":"https://github.com/ashmaroli/jekyll-webmention_io","homepage":null,"size":295,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aarongustafson:master","ref":"master","sha":"9afc79495bc1d8b7f688ab33fd22c50df79d0fda","user":{"login":"aarongustafson","id":75736,"node_id":"MDQ6VXNlcjc1NzM2","avatar_url":"https://avatars3.githubusercontent.com/u/75736?v=4","gravatar_id":"","url":"https://api.github.com/users/aarongustafson","html_url":"https://github.com/aarongustafson","followers_url":"https://api.github.com/users/aarongustafson/followers","following_url":"https://api.github.com/users/aarongustafson/following{/other_user}","gists_url":"https://api.github.com/users/aarongustafson/gists{/gist_id}","starred_url":"https://api.github.com/users/aarongustafson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aarongustafson/subscriptions","organizations_url":"https://api.github.com/users/aarongustafson/orgs","repos_url":"https://api.github.com/users/aarongustafson/repos","events_url":"https://api.github.com/users/aarongustafson/events{/privacy}","received_events_url":"https://api.github.com/users/aarongustafson/received_events","type":"User","site_admin":false},"repo":{"id":26774428,"node_id":"MDEwOlJlcG9zaXRvcnkyNjc3NDQyOA==","name":"jekyll-webmention_io","full_name":"aarongustafson/jekyll-webmention_io","owner":{"login":"aarongustafson","id":75736,"node_id":"MDQ6VXNlcjc1NzM2","avatar_url":"https://avatars3.githubusercontent.com/u/75736?v=4","gravatar_id":"","url":"https://api.github.com/users/aarongustafson","html_url":"https://github.com/aarongustafson","followers_url":"https://api.github.com/users/aarongustafson/followers","following_url":"https://api.github.com/users/aarongustafson/following{/other_user}","gists_url":"https://api.github.com/users/aarongustafson/gists{/gist_id}","starred_url":"https://api.github.com/users/aarongustafson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aarongustafson/subscriptions","organizations_url":"https://api.github.com/users/aarongustafson/orgs","repos_url":"https://api.github.com/users/aarongustafson/repos","events_url":"https://api.github.com/users/aarongustafson/events{/privacy}","received_events_url":"https://api.github.com/users/aarongustafson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aarongustafson/jekyll-webmention_io","description":"A Jekyll Plugin for rendering Webmentions via Webmention.io","fork":false,"url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io","forks_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/forks","keys_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/teams","hooks_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/hooks","issue_events_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/issues/events{/number}","events_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/events","assignees_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/assignees{/user}","branches_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/branches{/branch}","tags_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/tags","blobs_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/git/refs{/sha}","trees_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/statuses/{sha}","languages_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/languages","stargazers_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/stargazers","contributors_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/contributors","subscribers_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/subscribers","subscription_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/subscription","commits_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/commits{/sha}","git_commits_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/git/commits{/sha}","comments_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/comments{/number}","issue_comment_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/issues/comments{/number}","contents_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/contents/{+path}","compare_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/merges","archive_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/downloads","issues_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/issues{/number}","pulls_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls{/number}","milestones_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/milestones{/number}","notifications_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/labels{/name}","releases_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/releases{/id}","deployments_url":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/deployments","created_at":"2014-11-17T19:56:36Z","updated_at":"2018-09-12T23:41:21Z","pushed_at":"2018-09-13T19:40:26Z","git_url":"git://github.com/aarongustafson/jekyll-webmention_io.git","ssh_url":"git@github.com:aarongustafson/jekyll-webmention_io.git","clone_url":"https://github.com/aarongustafson/jekyll-webmention_io.git","svn_url":"https://github.com/aarongustafson/jekyll-webmention_io","homepage":"https://aarongustafson.github.io/jekyll-webmention_io/","size":318,"stargazers_count":92,"watchers_count":92,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":11,"open_issues":8,"watchers":92,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/100"},"html":{"href":"https://github.com/aarongustafson/jekyll-webmention_io/pull/100"},"issue":{"href":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/issues/100"},"comments":{"href":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/issues/100/comments"},"review_comments":{"href":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/100/comments"},"review_comment":{"href":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/pulls/100/commits"},"statuses":{"href":"https://api.github.com/repos/aarongustafson/jekyll-webmention_io/statuses/f406010b047c16856c82039277041d80cfe198e7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aarongustafson"}}