swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 383 forks source link

Adding support for home pages that immediately redirect to other sites. #717

Closed gvwilson closed 9 years ago

gvwilson commented 9 years ago

Some sites would like to use their own home pages for workshops rather than GitHub pages. However, all of our website machinery expects to harvest workshop information from GitHub. The (hacked) solution is to allow people to create a GitHub repository containing a home page that immediately redirects to their own site. To do this, we:

  1. Create a new layout called redirect.html containing a YAML header key redirect.
  2. Tell them to mv redirect-index.html index.html and then edit the header.
  3. Modify the bin/swc_index_validator.py script to take a -r flag, and then check for redirection if that flag is present.

I'm sure a cleaner implementation of all of this is possible...

gvwilson commented 9 years ago

@jduckles @r-gaia-cs @philippbayer Please have a look.

rgaiacs commented 9 years ago

I'm sure a cleaner implementation of all of this is possible...

What about add

<meta http-equiv="refresh" content="0; url={{page.redirect}}" />

into _layouts/bootcamp.html as

{% if page.redirect %}
<meta http-equiv="refresh" content="0; url={{page.redirect}}" />
{% endif %}
philippbayer commented 9 years ago

+1 @r-gaia-cs, that's how I did it with the pycon AU redirect page

rgaiacs commented 9 years ago

I'm closing this in favor of #764.