OSL 10 logo

Oregon State University Open Source Lab

Build The Future

The Open Source Lab is an organization working for the advancement of open source technologies.

The lab provides hosting for more than 160 projects, including those of worldwide leaders like the Apache Software Foundation, the Linux Foundation and Drupal. Together, the OSL’s hosted sites deliver nearly 430 terabytes of information every month to people around the world.

Under the School of Electrical Engineering and Computer Science, the OSL and the Oregon State Business Solutions Group have joined together to create the Center for Applied Systems and Software (CASS).

Adding "Edit on Github"

Though the procedure for doing this is straight-forward enough, it was difficult for me to find any instructions on how to do this -- so I thought I’d write some! What we would like to accomplish is to go from this:

page source
To this:
edit on github

To do this, open up ‘conf.py’, and find where you define ‘html_theme’. I did this with the default theme -- I’m sure it works with other themes as well, but the mileage may vary. Below that, you want to add the following:

html_context = {
‘display_github’: True,
‘github_user’: ‘Your username’,
‘github_repo’: ‘Repo name’,
‘github_version’: ‘Branch name’,
‘conf_py_path’:  ‘/path to your conf.py from where you compile your site/’
‘source_suffix’: ‘suffix of your content files’
}

And then you’re done! A sparkly new ‘edit on github’ link should replace the ‘view page source’ link.

Read more