From 0484b45bfbcf73e8be301bcc4210ea48ee61db98 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Tue, 14 Feb 2023 11:00:18 -0800 Subject: [PATCH] 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 Screenshot 2023-01-03 at 6 41 49 PM In particular, the generated HTML is ```html this content ``` Looking at the source code for both features ```html ``` ```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. --- Gemfile | 2 ++ _config.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Gemfile b/Gemfile index 43563e9..aef0d56 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,6 @@ source "https://rubygems.org" gemspec +gem "jekyll-github-metadata", ">= 2.15" + gem "webrick", "~> 1.7" diff --git a/_config.yml b/_config.yml index 5123872..06bd17f 100644 --- a/_config.yml +++ b/_config.yml @@ -17,6 +17,7 @@ title: Just the Docs description: A Jekyll theme for documentation baseurl: "/just-the-docs" # the subpath of your site, e.g. /blog url: "https://just-the-docs.github.io" # the base hostname & protocol for your site, e.g. http://example.com +repository: just-the-docs/just-the-docs # for github-metadata permalink: pretty @@ -161,6 +162,7 @@ callouts: plugins: - jekyll-seo-tag + - jekyll-github-metadata kramdown: syntax_highlighter_opts: