{"action":"closed","number":1048,"pull_request":{"url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/pulls/1048","id":44260760,"html_url":"https://github.com/bitcoin-dot-org/bitcoin.org/pull/1048","diff_url":"https://github.com/bitcoin-dot-org/bitcoin.org/pull/1048.diff","patch_url":"https://github.com/bitcoin-dot-org/bitcoin.org/pull/1048.patch","issue_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/issues/1048","number":1048,"state":"closed","locked":false,"title":"Conditionally build some pages differently based on environmental variables","user":{"login":"harding","id":61096,"avatar_url":"https://avatars.githubusercontent.com/u/61096?v=3","gravatar_id":"","url":"https://api.github.com/users/harding","html_url":"https://github.com/harding","followers_url":"https://api.github.com/users/harding/followers","following_url":"https://api.github.com/users/harding/following{/other_user}","gists_url":"https://api.github.com/users/harding/gists{/gist_id}","starred_url":"https://api.github.com/users/harding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harding/subscriptions","organizations_url":"https://api.github.com/users/harding/orgs","repos_url":"https://api.github.com/users/harding/repos","events_url":"https://api.github.com/users/harding/events{/privacy}","received_events_url":"https://api.github.com/users/harding/received_events","type":"User","site_admin":false},"body":"This PR has three commits:\r\n\r\n1. A new plugin which makes environmental variables (env vars) starting with `BITCOINORG_` available as template variables.\r\n\r\n2. A conditional to the robots.txt file that prevents the site from being indexed if an env var is set to \"preview\".  This is useful for @saivann and myself who host previews of the site but don't want them to appear in search engine results.  Documentation for this is also added to README.md\r\n\r\n3. A conditional on two of the content pages that changes how they will appear on cloned versions of the site (of which there are now several besides bitcoin.com).  Specifically:\r\n\r\n    - The Bitcoin Core download page on cloned sites redirects to the language equivalent page on Bitcoin.org\r\n    - The About Us page has all information replaced by a single sentence: \"This site includes content originally published on Bitcoin.org, but it is not affiliated with Bitcoin.org.\"\r\n\r\n    It is not the goal to prevent people from cloning the site but, rather, to ensure that cloned sites have accurate information about Bitcoin Core and that the contributors to Bitcoin.org don't get blamed for clone site problems.\r\n\r\n### Previews\r\n\r\nThe above commits mean the site can be compiled in three different states, so a separate preview is provided for each:\r\n\r\n- **No variables set:** this is what I expect clone sites to do.  Preview of the [About Us page](http://dg0.dtrt.org/en/about-us) and the [Download page](http://dg0.dtrt.org/en/download) (should automatically redirect to Bitcoin.org).  The [robots.txt](http://dg0.dtrt.org/robots.txt) and other site pages are unaffected.\r\n\r\n- **BITCOINORG_BUILD_TYPE=preview** this is what I expect to use myself for preview builds in the future.  The [robots.txt](http://dg1.dtrt.org/robots.txt) denies all indexing but the [About Us](http://dg1.dtrt.org/en/about-us) and [Download](http://dg1.dtrt.org/en/download) pages are unaffected, as is the rest of the site.\r\n\r\n- **BITCOINORG_BUILD_TYPE=deployment** this is what the build script will be running from now on ([as will Travis](https://travis-ci.org/harding/bitcoin.org/builds/78823051#L82)).  Except for inconsequential additional empty lines, all content is identical to the merge base, including the [robots.txt](http://dg2.dtrt.org/robots.txt), [About Us page](http://dg2.dtrt.org/en/about-us), and [Download page](http://dg2.dtrt.org/en/download)\r\n\r\n---\r\n\r\nI will update both the build server build script and the translation preview server build script at merge time.","created_at":"2015-09-04T20:57:35Z","updated_at":"2015-09-09T12:08:03Z","closed_at":"2015-09-09T12:08:03Z","merged_at":"2015-09-09T12:08:03Z","merge_commit_sha":"fd496b7976180e68409867d4ac30d77794091862","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/pulls/1048/commits","review_comments_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/pulls/1048/comments","review_comment_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/issues/1048/comments","statuses_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/statuses/7a82c6d0004f63856790483e8322570db370f3fb","head":{"label":"harding:env.rb","ref":"env.rb","sha":"7a82c6d0004f63856790483e8322570db370f3fb","user":{"login":"harding","id":61096,"avatar_url":"https://avatars.githubusercontent.com/u/61096?v=3","gravatar_id":"","url":"https://api.github.com/users/harding","html_url":"https://github.com/harding","followers_url":"https://api.github.com/users/harding/followers","following_url":"https://api.github.com/users/harding/following{/other_user}","gists_url":"https://api.github.com/users/harding/gists{/gist_id}","starred_url":"https://api.github.com/users/harding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harding/subscriptions","organizations_url":"https://api.github.com/users/harding/orgs","repos_url":"https://api.github.com/users/harding/repos","events_url":"https://api.github.com/users/harding/events{/privacy}","received_events_url":"https://api.github.com/users/harding/received_events","type":"User","site_admin":false},"repo":{"id":19798699,"name":"bitcoin.org","full_name":"harding/bitcoin.org","owner":{"login":"harding","id":61096,"avatar_url":"https://avatars.githubusercontent.com/u/61096?v=3","gravatar_id":"","url":"https://api.github.com/users/harding","html_url":"https://github.com/harding","followers_url":"https://api.github.com/users/harding/followers","following_url":"https://api.github.com/users/harding/following{/other_user}","gists_url":"https://api.github.com/users/harding/gists{/gist_id}","starred_url":"https://api.github.com/users/harding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harding/subscriptions","organizations_url":"https://api.github.com/users/harding/orgs","repos_url":"https://api.github.com/users/harding/repos","events_url":"https://api.github.com/users/harding/events{/privacy}","received_events_url":"https://api.github.com/users/harding/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/harding/bitcoin.org","description":"Bitcoin.org website","fork":true,"url":"https://api.github.com/repos/harding/bitcoin.org","forks_url":"https://api.github.com/repos/harding/bitcoin.org/forks","keys_url":"https://api.github.com/repos/harding/bitcoin.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harding/bitcoin.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harding/bitcoin.org/teams","hooks_url":"https://api.github.com/repos/harding/bitcoin.org/hooks","issue_events_url":"https://api.github.com/repos/harding/bitcoin.org/issues/events{/number}","events_url":"https://api.github.com/repos/harding/bitcoin.org/events","assignees_url":"https://api.github.com/repos/harding/bitcoin.org/assignees{/user}","branches_url":"https://api.github.com/repos/harding/bitcoin.org/branches{/branch}","tags_url":"https://api.github.com/repos/harding/bitcoin.org/tags","blobs_url":"https://api.github.com/repos/harding/bitcoin.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harding/bitcoin.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harding/bitcoin.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/harding/bitcoin.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harding/bitcoin.org/statuses/{sha}","languages_url":"https://api.github.com/repos/harding/bitcoin.org/languages","stargazers_url":"https://api.github.com/repos/harding/bitcoin.org/stargazers","contributors_url":"https://api.github.com/repos/harding/bitcoin.org/contributors","subscribers_url":"https://api.github.com/repos/harding/bitcoin.org/subscribers","subscription_url":"https://api.github.com/repos/harding/bitcoin.org/subscription","commits_url":"https://api.github.com/repos/harding/bitcoin.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/harding/bitcoin.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/harding/bitcoin.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/harding/bitcoin.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/harding/bitcoin.org/contents/{+path}","compare_url":"https://api.github.com/repos/harding/bitcoin.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harding/bitcoin.org/merges","archive_url":"https://api.github.com/repos/harding/bitcoin.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harding/bitcoin.org/downloads","issues_url":"https://api.github.com/repos/harding/bitcoin.org/issues{/number}","pulls_url":"https://api.github.com/repos/harding/bitcoin.org/pulls{/number}","milestones_url":"https://api.github.com/repos/harding/bitcoin.org/milestones{/number}","notifications_url":"https://api.github.com/repos/harding/bitcoin.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harding/bitcoin.org/labels{/name}","releases_url":"https://api.github.com/repos/harding/bitcoin.org/releases{/id}","created_at":"2014-05-14T22:43:19Z","updated_at":"2015-08-28T18:05:20Z","pushed_at":"2015-09-09T11:58:42Z","git_url":"git://github.com/harding/bitcoin.org.git","ssh_url":"git@github.com:harding/bitcoin.org.git","clone_url":"https://github.com/harding/bitcoin.org.git","svn_url":"https://github.com/harding/bitcoin.org","homepage":"http://www.bitcoin.org/","size":27618,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"bitcoin-dot-org:master","ref":"master","sha":"90dc6a02b647a101e756f9981869b5db91900bc0","user":{"login":"bitcoin-dot-org","id":12837353,"avatar_url":"https://avatars.githubusercontent.com/u/12837353?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin-dot-org","html_url":"https://github.com/bitcoin-dot-org","followers_url":"https://api.github.com/users/bitcoin-dot-org/followers","following_url":"https://api.github.com/users/bitcoin-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin-dot-org/subscriptions","organizations_url":"https://api.github.com/users/bitcoin-dot-org/orgs","repos_url":"https://api.github.com/users/bitcoin-dot-org/repos","events_url":"https://api.github.com/users/bitcoin-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":2304420,"name":"bitcoin.org","full_name":"bitcoin-dot-org/bitcoin.org","owner":{"login":"bitcoin-dot-org","id":12837353,"avatar_url":"https://avatars.githubusercontent.com/u/12837353?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin-dot-org","html_url":"https://github.com/bitcoin-dot-org","followers_url":"https://api.github.com/users/bitcoin-dot-org/followers","following_url":"https://api.github.com/users/bitcoin-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin-dot-org/subscriptions","organizations_url":"https://api.github.com/users/bitcoin-dot-org/orgs","repos_url":"https://api.github.com/users/bitcoin-dot-org/repos","events_url":"https://api.github.com/users/bitcoin-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin-dot-org/bitcoin.org","description":"Bitcoin.org website","fork":false,"url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org","forks_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/forks","keys_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/teams","hooks_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/hooks","issue_events_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/events","assignees_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/tags","blobs_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/languages","stargazers_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/stargazers","contributors_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/contributors","subscribers_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/subscribers","subscription_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/subscription","commits_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/merges","archive_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/downloads","issues_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/releases{/id}","created_at":"2011-08-31T21:58:01Z","updated_at":"2015-09-02T22:59:25Z","pushed_at":"2015-09-09T12:08:01Z","git_url":"git://github.com/bitcoin-dot-org/bitcoin.org.git","ssh_url":"git@github.com:bitcoin-dot-org/bitcoin.org.git","clone_url":"https://github.com/bitcoin-dot-org/bitcoin.org.git","svn_url":"https://github.com/bitcoin-dot-org/bitcoin.org","homepage":"https://bitcoin.org/","size":34547,"stargazers_count":246,"watchers_count":246,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":393,"mirror_url":null,"open_issues_count":37,"forks":393,"open_issues":37,"watchers":246,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/pulls/1048"},"html":{"href":"https://github.com/bitcoin-dot-org/bitcoin.org/pull/1048"},"issue":{"href":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/issues/1048"},"comments":{"href":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/issues/1048/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/pulls/1048/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/pulls/1048/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin-dot-org/bitcoin.org/statuses/7a82c6d0004f63856790483e8322570db370f3fb"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"harding","id":61096,"avatar_url":"https://avatars.githubusercontent.com/u/61096?v=3","gravatar_id":"","url":"https://api.github.com/users/harding","html_url":"https://github.com/harding","followers_url":"https://api.github.com/users/harding/followers","following_url":"https://api.github.com/users/harding/following{/other_user}","gists_url":"https://api.github.com/users/harding/gists{/gist_id}","starred_url":"https://api.github.com/users/harding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harding/subscriptions","organizations_url":"https://api.github.com/users/harding/orgs","repos_url":"https://api.github.com/users/harding/repos","events_url":"https://api.github.com/users/harding/events{/privacy}","received_events_url":"https://api.github.com/users/harding/received_events","type":"User","site_admin":false},"comments":3,"review_comments":2,"commits":3,"additions":89,"deletions":0,"changed_files":8}}