Skip to content

Commit

Permalink
Switch to github_override
Browse files Browse the repository at this point in the history
  • Loading branch information
caitlinelfring committed Jul 23, 2021
1 parent acf9d6c commit d150beb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,18 @@ If you'd like to change the theme's HTML layout:

Templates often rely on URLs supplied by GitHub such as links to your repository or links to download your project. If you'd like to override one or more default URLs:

1. Look at [the template source](https://github.com/pages-themes/midnight/blob/master/_layouts/default.html) to determine the name of the variable. It will be in the form of `{{ site.github.zip_url }}`.
**NOTE** It seems you can no longer override the `github` key: <https://github.com/mmistakes/minimal-mistakes/issues/1992>

1. Look at [the template source](https://github.com/pages-themes/midnight/blob/master/_layouts/default.html) to determine the name of the variable. It will be in the form of `{{ site.github_override.zip_url }}`.
2. Specify the URL that you'd like the template to use in your site's `_config.yml`. For example, if the variable was `site.github.url`, you'd add the following:
```yml
github:
github_override:
zip_url: http://example.com/download.zip
another_url: another value
```
3. When your site is built, Jekyll will use the URL you specified, rather than the default one provided by GitHub.

*Note: You must remove the `site.` prefix, and each variable name (after the `github.`) should be indent with two space below `github:`.*
*Note: You must remove the `site.` prefix, and each variable name (after the `github_override.`) should be indent with two space below `github_override:`.*

For more information, see [the Jekyll variables documentation](https://jekyllrb.com/docs/variables/).

Expand Down
6 changes: 3 additions & 3 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<div id="header">
<nav>
<ul>
<li class="fork"><a href="{{ site.github.repository_url }}">View On GitHub</a></li>
<li class="fork"><a href="{{ site.github_override.repository_url | default: site.github.repository_url }}">View On GitHub</a></li>
{% if site.show_downloads %}
<li class="downloads"><a href="{{ site.github.zip_url }}">ZIP</a></li>
<li class="downloads"><a href="{{ site.github.tar_url }}">TAR</a></li>
<li class="downloads"><a href="{{ site.github_override.zip_url | default: site.github.zip_url }}">ZIP</a></li>
<li class="downloads"><a href="{{ site.github_override.tar_url | default: site.github.tar_url }}">TAR</a></li>
<li class="title">DOWNLOADS</li>
{% endif %}
</ul>
Expand Down

0 comments on commit d150beb

Please sign in to comment.