just-the-docs/Gemfile
Matt Wang 0484b45bfb
Readd jekyll-github-metadata plugin to site (#1108)
In my other cleaning, I also noticed:

- the contributors pane on the homepage is broken
- the following link to a repo page in the search docs is broken

<img width="762" alt="Screenshot 2023-01-03 at 6 41 49 PM" src="https://user-images.githubusercontent.com/14893287/210474679-bcb9af23-0a4e-4999-a0ec-f06d967ea726.png">

In particular, the generated HTML is

```html
<a href="/blob/main/assets/js/zzzz-search-data.json">this content</a>
```

Looking at the source code for both features

```html
<ul class="list-style-none">
{% for contributor in site.github.contributors %}
  <li class="d-inline-block mr-1">
     <a href="{{ contributor.html_url }}"><img src="{{ contributor.avatar_url }}" width="32" height="32" alt="{{ contributor.login }}"></a>
  </li>
{% endfor %}
</ul>
```

```md
[this content]({{ site.github.repository_url }}/blob/main/assets/js/zzzz-search-data.json).
```

It's clear that `site.github` is not being populated. This is controlled by the GitHub Metadata/[`jekyll-github-metadata`](http://jekyll.github.io/github-metadata/) plugin.

I'm not when this stopped working. If I had to guess, I think this is packaged as part of the `github-pages` gem; so, when the site moved off of it a while back, we never noticed this regression. This is the type of thing that can hopefully be caught by regression tests in the future.

This PR re-adds the plugin. I've opted to only add it to the `Gemfile` but not the `gemspec` so that it only affects our site. In other words, JtD does not have `jekyll-github-metadata` as a runtime dependency (since none of our theme code relies on it). Happy to change that if we'd like.

---

In the future, 

- short-term: I can write a filter that removes dependabot from our contributors
- longer-term: we could rewrite the "last edited on GitHub" feature to instead use `jekyll-github-metadata`. this would necessitate us to make it a runtime dependency, and it also wouldn't work as well for users of GitLab or other alternatives.
2023-02-14 11:00:18 -08:00

7 lines
104 B
Ruby

source "https://rubygems.org"
gemspec
gem "jekyll-github-metadata", ">= 2.15"
gem "webrick", "~> 1.7"