Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jekyll/github-metadata
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.13.0
Choose a base ref
...
head repository: jekyll/github-metadata
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.14.0
Choose a head ref
Loading
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 99
34 changes: 34 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Continuous Integration

on:
push:
branches:
- main
- /.*-stable/
pull_request:
branches:
- main
- /.*-stable/

jobs:
ci:
if: "!contains(github.event.commits[0].message, '[ci skip]')"
name: 'Ruby ${{ matrix.ruby_version }} ${{ matrix.os }}'
runs-on: '${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
ruby_version:
- 2.7
- '3.0'
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: script/cibuild
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release Gem

on:
push:
branches:
- main
paths:
- "lib/**/version.rb"

jobs:
release:
if: "github.repository_owner == 'jekyll'"
name: "Release Gem (Ruby ${{ matrix.ruby_version }})"
runs-on: "ubuntu-latest"
strategy:
fail-fast: true
matrix:
ruby_version:
- 2.7
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: "Set up Ruby ${{ matrix.ruby_version }}"
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Build and Publish Gem
uses: ashmaroli/release-gem@dist
with:
gemspec_name: jekyll-github-metadata
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_GEM_PUSH_API_KEY }}
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
.bundle
.bundle/
vendor/
.tags*
Gemfile.lock
pkg
_site
tmp
_site/
tmp/
*.gem
.jekyll-cache/
.jekyll-metadata
4 changes: 3 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
inherit_from: .rubocop_todo.yml

require: rubocop-jekyll
inherit_gem:
rubocop-jekyll: .rubocop.yml

AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.5
Exclude:
- vendor/**/*
- script/*
117 changes: 117 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-04-20 05:48:15 UTC using RuboCop version 1.18.4.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Configuration parameters: Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'jekyll-github-metadata.gemspec'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
# AllowedMethods: alias_method, public, protected, private
Layout/EmptyLinesAroundAttributeAccessor:
Exclude:
- 'lib/jekyll-github-metadata/repository_finder.rb'

# Offense count: 2
# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec/owner_spec.rb'

# Offense count: 1
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
Lint/DuplicateBranch:
Exclude:
- 'lib/jekyll-github-metadata/sanitizer.rb'

# Offense count: 1
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
Exclude:
- 'spec/edit_link_tag_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Lint/RedundantCopDisableDirective:
Exclude:
- 'lib/jekyll-github-metadata/client.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowedMethods.
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
Lint/RedundantSafeNavigation:
Exclude:
- 'lib/jekyll-github-metadata/repository_finder.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, consistent
Lint/SymbolConversion:
Exclude:
- 'spec/github_metadata_spec.rb'

# Offense count: 1
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 22

# Offense count: 1
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
Naming/VariableNumber:
Exclude:
- 'spec/spec_helpers/web_mock_helper.rb'

# Offense count: 1
Performance/ChainArrayAllocation:
Exclude:
- 'lib/jekyll-github-metadata/repository_finder.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/NegatedIfElseCondition:
Exclude:
- 'lib/jekyll-github-metadata/pages.rb'

# Offense count: 1
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'lib/jekyll-github-metadata/client.rb'

# Offense count: 3
# Cop supports --auto-correct.
Style/RedundantBegin:
Exclude:
- 'lib/jekyll-github-metadata/metadata_drop.rb'
- 'lib/jekyll-github-metadata/owner.rb'
- 'lib/jekyll-github-metadata/repository_finder.rb'

# Offense count: 3
# Cop supports --auto-correct.
Style/RedundantRegexpEscape:
Exclude:
- 'lib/jekyll-github-metadata/edit-link-tag.rb'
- 'lib/jekyll-github-metadata/repository_finder.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: Mode.
Style/StringConcatenation:
Exclude:
- 'spec/edit_link_tag_spec.rb'
- 'spec/value_spec.rb'
7 changes: 1 addition & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -7,10 +7,5 @@ gem "faraday", "~> #{ENV["FARADAY_VERSION"]}" if ENV["FARADAY_VERSION"]
gem "jekyll", "~> #{ENV["JEKYLL_VERSION"]}" if ENV["JEKYLL_VERSION"]

group :test do
# Temporarily lock rspec dependencies to last known versions with
# which tests passed successfully on CI
gem "rspec-expectations", "3.8.4"
gem "rspec-mocks", "3.8.1"

gem "webmock", "~> 2.0"
gem "webmock", "~> 3.14"
end
25 changes: 25 additions & 0 deletions History.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
## 2.14.0 / 2022-05-04

### Minor Enhancements

* Use owner name as site title for User and Organization sites. (#197)
* Add `site.github.public_repositories[].releases` (#224)
* Add `site.github.public_repositories[].contributors` (#234)

### Documentation

* docs: Add dev docs (#212)
* set `PAGES_GITHUB_HOSTNAME` to hostname without protocol (#191)
* Add `JEKYLL_ENV` limitation for git remote (#185)

### Development Fixes

* Restore log level after running tests that modify it. (#202)
* Add GitHub Actions CI (#211)
* Update rubocop-jekyll requirement from `~> 0.5.0` to `~> 0.12.0` (#226)
* Create dependabot.yml (#225)
* Add rubocop todo file (#230)
* Upgrade rspec to 3.11.x (#231)
* CI: use 'main' branch instead of 'master' (#232)
* Add release workflow (#235)

## 2.13.0 / 2020-01-15

### Minor Enhancements
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ version: "{build}"
clone_depth: 5
branches:
only:
- master
- main

build: off

@@ -22,7 +22,6 @@ environment:
FARADAY_VERSION: "0.17"
- RUBY_FOLDER_VER: "25"
- RUBY_FOLDER_VER: "24"
- RUBY_FOLDER_VER: "23"

install:
- SET PATH=C:\Ruby%RUBY_FOLDER_VER%-x64\bin;%PATH%
11 changes: 7 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -19,22 +19,24 @@ Jekyll plugin to propagate the `site.github` namespace and set default values fo

## Usage

Usage of this gem is pretty straight-forward. Add it to your bundle like this:
Usage of this gem is pretty straight-forward. Add it to your `Gemfile` like this:

```ruby
gem "jekyll-github-metadata"
```

Now add it to your `_config.yml`:
Add it to your `_config.yml`:

```yaml
plugins:
- "jekyll-github-metadata"
```
:warning: If you are using Jekyll < 3.5.0 use the `gems` key instead of `plugins`.
:warning: If you are using Jekyll < 3.5.0, use the `gems` key instead of `plugins`.

Then go ahead and run `bundle install`. Once you've done that jekyll-github-metadata will run when you run Jekyll.
Then go ahead and run `bundle install`.

Now, whenever you build or serve with Jekyll, the `jekyll-github-metadata` plugin will run.


## Further reading
@@ -43,3 +45,4 @@ Then go ahead and run `bundle install`. Once you've done that jekyll-github-meta
* [Configuration](configuration.md)
* [Using `site.github`](site.github.md)
* [Edit on GitHub link](edit-on-github-link.md)
* [Development](development.md)
6 changes: 4 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,9 @@ be able to determine the repository NWO (name with owner, e.g. `jekyll/jekyll-gi
The easiest way to accomplish this is by setting an "origin" remote with a
github.com URL. If you ran `git clone` from GitHub, this is almost 100% the
case & no further action is needed. If you run `git remote -v` in your
repository, you should see your repo's URL.
repository, you should see your repo's URL. However, this only works if the
environment variable `JEKYLL_ENV` is either `development` or `test`.
The default value of `JEKYLL_ENV` is `development`.

If you don't have a git remote available, you have two other options:

@@ -39,7 +41,7 @@ Some `site.github` values can be overridden by environment variables.
- `PAGES_ENV` – the `site.github.pages_env` (default: `development`)
- `PAGES_API_URL` – the `site.github.api_url` (default: `https://api.github.com`)
- `PAGES_HELP_URL` – the `site.github.help_url` (default: `https://help.github.com`)
- `PAGES_GITHUB_HOSTNAME` – the `site.github.hostname` (default: `https://github.com`)
- `PAGES_GITHUB_HOSTNAME` – the `site.github.hostname` (default: `github.com`)
- `PAGES_PAGES_HOSTNAME` – the `site.github.pages_hostname` (default: `github.io`)
- `NO_NETRC` – set if you don't want the fallback to `~/.netrc`

Loading