Skip to content

Instantly share code, notes, and snippets.

@tonyfast
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyfast/76f694a2357b3ffcf838 to your computer and use it in GitHub Desktop.
Save tonyfast/76f694a2357b3ffcf838 to your computer and use it in GitHub Desktop.
A HTML view of the Github Pages hosted by a User
---
---
<!--
This code can be hosted on a users Github pages repository ( username.github.io ) to
aggregate the homepages attached to their repositories. This code uses the
Create a simple bootstrap page to showcase a user's Github repository Homepages.
There is a statement that assumes the user's name is in their homepage name.
Hosting on Github pages (i.e. username.github.io) is perfect for this script.
-->
<head>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>{{site.github['public_repositories'][0]['owner']['login']}}'s Github Repository Homepages</h2>
{% for repos in site.github['public_repositories'] %}
<!--
The condition in the if statement assigns that the repository's username is part of
the homepage url. If you are hosting on Github pages then this statement is sufficient.
-->
{% if repos['homepage'] contains repos.owner['login'] %}
<div class="panel panel-{% cycle 'default','info' %}">
<!-- Link to homepage-->
<div class="panel-heading">
<a href="http://{{repos['homepage']}}">
<h3>{{repos['name']}}</h3>
</a>
</div>
<!-- Report description if it exists-->
{% if repos['description'] %}
<div class="panel-body">
{{repos['description'] }}
</div>
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>
<div class="row">
<div class="well well-lg">This page was generated using <a href="http://www.getbootstrap.com">Bootstrap</a>,
<a href="https://help.github.com/articles/repository-metadata-on-github-pages">Github API</a>,
<a href="http://www.jekyllrb.com">Jekyll</a>, and <a href="http://pages.github.com">Github Pages</a>.
<br>
<a href="https://gist.github.com/tonyfast/76f694a2357b3ffcf838">Source</a>
</div>
</div>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment