Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noob question on getting Github link to show up on page... #339

Closed
chrismarino opened this issue Nov 5, 2016 · 2 comments
Closed

Noob question on getting Github link to show up on page... #339

chrismarino opened this issue Nov 5, 2016 · 2 comments

Comments

@chrismarino
Copy link

Hi I'd like to use a variation of this RTD theme on my own hosted site. I've got most things up and looking OK, but I want to use the Edit on Github link in the breadcrumbs and I don't really know how to set that up. I saw that you can set page level meta data :github_url: but could not get it to do anything.

So, some basic questions: Will this conf option work on a self hosted site? I don't recall setting the github account info anywhere so thinking that this might only work on RTD.com??

If it will work, can you please provide an example of what/how to set the metadata? I put the :github_url: directive in my .rst files, but not even sure that is how this is supposed to work.

@thiyagaraj
Copy link

thiyagaraj commented Nov 29, 2016

Hi @chrismarino , add something like this to your conf.py's html_context variable

html_context = {
    # Enable the "Edit in GitHub link within the header of each page.
    'display_github': True,
    # Set the following variables to generate the resulting github URL for each page. 
    # Format Template: https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}
    'github_user': 'username',
    'github_repo': 'repo-name',
    'github_version': 'master/source/' 
}

@Blendify
Copy link
Member

Blendify commented Mar 3, 2017

@ericholscher please close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants