Prevent site indexing for preview builds

This commit is contained in:
David A. Harding 2015-09-04 13:08:00 -04:00
parent adef074df5
commit b035a0a619
No known key found for this signature in database
GPG key ID: 4B29C30FF29EC4B7
3 changed files with 35 additions and 0 deletions

View file

@ -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 do this by running the following command line
before building you preview:
export BITCOINORG_BUILD_TYPE=preview
You can also add this line to your `~/.bashrc` file if you frequently
build site previews so that you don't have to remember to run it for
each shell.
## Developer Documentation
Most parts of the documentation can be found in the [_includes](https://github.com/bitcoin-dot-org/bitcoin.org/tree/master/_includes)

View file

@ -11,6 +11,9 @@ WORKDIR=`mktemp -d`
LIVEDIR=`mktemp -d`
SITEDIR='/bitcoin.org/txpreview'
DESTDIR='/var/www/txpreview'
BITCOINORG_BUILD_TYPE='preview'
export BITCOINORG_BUILD_TYPE
# Stop script in case a single command fails
set -e

View file

@ -1 +1,12 @@
---
# This file is licensed under the MIT License (MIT) available on
# http://opensource.org/licenses/MIT.
layout: null
---
{% if site.env.BITCOINORG_BUILD_TYPE == 'preview' %}
User-agent: *
Disallow: /
{% else %}
Sitemap: https://bitcoin.org/sitemap.xml
{% endif %}