Skip to content

Commit

Permalink
Fix 'Edit on GitHub' link if using 'docs' folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosperate committed Nov 10, 2019
1 parent 9f5a50f commit 4e7a7ea
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ webrick:
site_author: Carlos Pereira Atencio
repo_url: 'https://github.com/carlosperate/jekyll-theme-rtd'
edit_on_github: true
github_docs_folder: false
sticky_navigation: true
prev_next_buttons_location: both
search_enabled: true
Expand Down
2 changes: 1 addition & 1 deletion _includes/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{%- endif %}
<li class="wy-breadcrumbs-aside">
{%- unless site.edit_on_github == false %}
<a href="{{ site.repo_url | url }}/blob/master/{{ page.path }}" class="icon icon-github"> Edit on GitHub</a>
<a href="{{ site.repo_url | url }}/blob/master/{%- if site.github_docs_folder %}docs/{% endif %}{{ page.path }}" class="icon icon-github" target="_blank"> Edit on GitHub</a>
{%- endunless %}
</li>
</ul>
Expand Down
16 changes: 6 additions & 10 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700" />
<link rel="stylesheet" href="{{ 'assets/css/theme.css' | absolute_url }}" />
<link rel="stylesheet" href="{{ 'assets/css/theme_extra.css' | absolute_url }}" />
{%- if site.hljs_style -%}
{%- if site.hljs_style %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/{{site.hljs_style}}.min.css" />
{%- else -%}
{%- else %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github-gist.min.css" />
{%- endif %}

{%- if site.google_analytics %} {%- include ganalytics.html -%} {% endif %}
{%- if site.google_analytics %}{% include ganalytics.html %}{% endif %}
</head>

<body class="wy-body-for-nav" role="document">

<div class="wy-grid-for-nav">

{% comment %} SIDE NAV, TOGGLES ON MOBILE {% endcomment %}
{%- comment %} SIDE NAV, TOGGLES ON MOBILE {% endcomment %}
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
Expand Down Expand Up @@ -87,13 +87,13 @@

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

{% comment %} MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE {% endcomment %}
{%- comment %} MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE {% endcomment %}
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="{{ site.url | absolute_url }}">{{ site.title }}</a>
</nav>

{% comment %} PAGE CONTENT {% endcomment %}
{%- comment %} PAGE CONTENT {% endcomment %}
<div class="wy-nav-content">
<div class="rst-content">
{% include breadcrumbs.html %}
Expand Down Expand Up @@ -122,10 +122,6 @@
window.addEventListener('load', function() {
SphinxRtdTheme.Navigation.enable({{ site.sticky_navigation | default: 'false' }});
});

/* site.github
{{ site.github }}
*/
</script>
<!-- Build Date: {{ site.time | date: "%Y-%m-%d %H:%M" }} -->
</body>
Expand Down
2 changes: 2 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ remote_theme: carlosperate/jekyll-theme-rtd
# Theme settings:
site_author: Carlos Pereira Atencio
repo_url: "https://github.com/carlosperate/jekyll-theme-rtd"
edit_on_github: true
github_docs_folder: true
sticky_navigation: true
prev_next_buttons_location: bottom
search_enabled: true
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ description: Port of the Read the Docs theme to Jekyll to use with GitHub Pages.
site_author: Carlos Pereira Atencio
repo_url: 'https://github.com/carlosperate/jekyll-theme-rtd'
edit_on_github: true
github_docs_folder: true
site_favicon: 'https://your.url/here.ico'
sticky_navigation: true
prev_next_buttons_location: None
Expand Down

0 comments on commit 4e7a7ea

Please sign in to comment.