Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Conditionally build some pages differently based on environmental variables #1048
Conversation
saivann
commented on an outdated diff
Sep 5, 2015
| @@ -297,6 +297,27 @@ run if the API site is running slow. | ||
| For a list of languages, look in the `_translations` directory. | ||
| +#### Publishing Previews | ||
| + | ||
| +You can publish your previews online to any static hosting service. | ||
| +[GitHub pages](https://pages.github.com/) is a free service available to | ||
| +all GitHub users that works with Bitcoin.org's site hierarchy. | ||
| + | ||
| +Before building a preview site, it is recommended that you set the | ||
| +environmental variable `BITCOINORG_BUILD_TYPE` to "preview". This will | ||
| +enable some content that would otherwise be hidden and also create a | ||
| +robots.txt file that will help prevent the site from being indexed by | ||
| +search engines and mistaken for the actual Bitcoin.org website. | ||
| + | ||
| +In the bash shell, you can this by running the following command line |
|
|
|
Thanks, very nice! Untested LGTM. |
saivann
commented on an outdated diff
Sep 5, 2015
| @@ -83,3 +84,16 @@ <h3 id="github">{% translate github %}</h3> | ||
| </div> | ||
| {% endfor %} | ||
| </div> | ||
| +{% else %} | ||
| +{% comment %} | ||
| +<!-- if you've cloned bitcoin.org, feel free to fill in your own About | ||
| +Us below. It would be appreciated it if you link back to Bitcoin.org, | ||
| +but please make it clear that your site is not affiliated with | ||
| +Bitcoin.org. --> |
saivann
Contributor
|
harding
added some commits
Sep 4, 2015
|
@saivann implemented both your comments as suggested (commits amended). Thank you for your review! Regarding the names and emails in the README.md, I don't know how much of a problem that is. Except for Bitcoin.com, I don't think any of the other clone sites are hosting their clone source on GitHub, so nobody sees the README file. Long-term, I think our README.md is getting awfully long and needs something like a table of contents. I had the idea of moving most of it to a |
|
In the absence of critical feedback, this will be merged on Tuesday. |
harding
added
the
Merge Scheduled
label
Sep 6, 2015
harding
added a commit
to harding/bitcoin.org
that referenced
this pull request
Sep 9, 2015
harding
merged commit 7a82c6d
into
bitcoin-dot-org:master
Sep 9, 2015
1 check passed
|
Merged and build script updated. I've verified that the main site robots.txt and about us page are correct. |
harding commentedSep 4, 2015
This PR has three commits:
A new plugin which makes environmental variables (env vars) starting with
BITCOINORG_available as template variables.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
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:
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.
Previews
The above commits mean the site can be compiled in three different states, so a separate preview is provided for each:
I will update both the build server build script and the translation preview server build script at merge time.