Skip to content

Commit

Permalink
Merge github.com:RichardFevrier/jekyll-feed; github.com:jekyll/jekyll…
Browse files Browse the repository at this point in the history
…-feed
  • Loading branch information
RichardFevrier committed May 6, 2023
2 parents 7d210c5 + 7d9c3a4 commit da0cde8
Show file tree
Hide file tree
Showing 17 changed files with 266 additions and 110 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release Gem

on:
push:
branches: ["master"]
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@v2
- 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-feed"
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_GEM_PUSH_API_KEY }}
10 changes: 1 addition & 9 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ on:

jobs:
test:
if: "!contains(github.event.commits[0].message, '[ci skip]')"
name: 'Ruby ${{ matrix.ruby-version }}'
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0']
ruby-version: ['2.6', '2.7', '3.0', '3.1']

steps:
- uses: actions/checkout@v2
Expand All @@ -22,12 +21,5 @@ jobs:
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Cache dependencies
uses: actions/[email protected]
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Run tests
run: bash script/cibuild
43 changes: 29 additions & 14 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
inherit_from: .rubocop_todo.yml

require: rubocop-jekyll

inherit_gem:
rubocop-jekyll: .rubocop.yml

AllCops:
TargetRubyVersion: 2.4
Include:
- lib/**/*.rb

TargetRubyVersion: 2.5
SuggestExtensions: false
Exclude:
- .gitignore
- .rspec
- .rubocop.yml
- .travis.yml
- vendor/**/*

- Gemfile.lock
- History.markdown
- LICENSE.txt
- README.md
Layout/LineEndStringConcatenationIndentation:
Enabled: true

- script/**/*
- vendor/**/*
Lint/EmptyInPattern:
Enabled: false

Metrics/AbcSize:
IgnoredMethods:
- generate # in generator.rb

Naming/InclusiveLanguage:
Enabled: false
Naming/MemoizedInstanceVariableName:
Exclude:
- lib/jekyll-feed/page-without-a-file.rb

Performance/MapCompact:
Enabled: true
Performance/RedundantEqualityComparisonBlock:
Enabled: true
Performance/RedundantSplitRegexpArgument:
Enabled: true

Style/InPatternThen:
Enabled: false
Style/MultilineInPatternThen:
Enabled: false
Style/QuotedSymbols:
Enabled: true
65 changes: 65 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-09-17 11:44:51 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
# Cop supports --auto-correct.
Layout/EmptyLines:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 15
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 144

# Offense count: 3
# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec/jekyll-feed_spec.rb'
- 'spec/spec_helper.rb'

# Offense count: 3
# Cop supports --auto-correct.
Performance/RegexpMatch:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
Performance/StringInclude:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'spec/jekyll-feed_spec.rb'

# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'spec/jekyll-feed_spec.rb'
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
source "https://rubygems.org"
gemspec

gem "rss" if RUBY_VERSION >= "3.0.0"
gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"]
gem "kramdown-parser-gfm" if ENV["JEKYLL_VERSION"] == "~> 3.9"
gem "rss" if RUBY_VERSION >= "3.0.0"

install_if -> { Gem.win_platform? } do
gem "tzinfo", "~> 1.2"
Expand Down
42 changes: 40 additions & 2 deletions History.markdown
Original file line number Diff line number Diff line change
@@ -1,8 +1,48 @@
## HEAD

### Development Fixes

* Upgrade to Rake 13 to fix master (#381)

### Documentation

* Fix typos in Readme (#384)

## 0.17.0 / 2022-10-14

### Documentation

* Update CI status badge (#363)

### Development Fixes

* Add Ruby 3.1 to the CI matrix (#365)

### Minor Enhancements

* Allow disabling of jekyll-feed while in development (#370)

## 0.16.0 / 2022-01-03

### Minor Enhancements

* Add support for `page.description` in front matter to become entry `<summary>` (#297)

### Bug Fixes

* Fold private methods into the `:render` method as local variables (#327)
* Check `post.categories` instead of `post.category` (#357)
* Switched xml_escape for `<![CDATA[]]>` for post content (#332)

### Development Fixes

* Add Ruby 3.0 to CI (#337)
* Lock RuboCop to v1.18.x (#348)
* Add workflow to release gem via GH Action (#355)

### Documentation

* Use `.atom` extension in documented examples since we write an Atom feed (#359)

## 0.15.1 / 2020-10-04

Expand Down Expand Up @@ -109,8 +149,6 @@

* fix <entry> template for posts with post.lang defined (#168)

## 0.9.3 / 2017-03-28

## 0.9.1 / 2017-02-17

### Minor Enhancements
Expand Down
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Jekyll plugin to generate an Atom (RSS-like) feed of your Jekyll posts

[![Build Status](https://travis-ci.org/jekyll/jekyll-feed.svg)](https://travis-ci.org/jekyll/jekyll-feed) [![Gem Version](https://badge.fury.io/rb/jekyll-feed.svg)](https://badge.fury.io/rb/jekyll-feed)
[![Continuous Integration](https://github.com/jekyll/jekyll-feed/actions/workflows/ruby.yml/badge.svg)](https://github.com/jekyll/jekyll-feed/actions/workflows/ruby.yml) [![Gem Version](https://badge.fury.io/rb/jekyll-feed.svg)](https://badge.fury.io/rb/jekyll-feed)

## Installation

Expand Down Expand Up @@ -40,7 +40,7 @@ Do you already have an existing feed someplace other than `/feed.xml`, but are o

```yml
feed:
path: atom.xml
path: /blog/feed.atom
```

To note, you shouldn't have to do this unless you already have a feed you're using, and you can't or wish not to redirect existing subscribers.
Expand All @@ -62,13 +62,15 @@ Additionally, the plugin will use the following values, if present in a post's Y

* `author` - The author of the post, e.g., "Dr. Jekyll". If none is given, feed readers will look to the feed author as defined in `_config.yml`. Like the feed author, this can also be an object or a reference to an author in `_data/authors.yml` (see below).

* `description` - A short description of the post.

### Author information

*TL;DR: In most cases, put `author: [your name]` in the document's front matter, for sites with multiple authors. If you need something more complicated, read on.*

There are several ways to convey author-specific information. Author information is found in the following order of priority:

1. An `author` object, in the documents's front matter, e.g.:
1. An `author` object, in the document's front matter, e.g.:

```yml
author:
Expand Down Expand Up @@ -176,16 +178,16 @@ By default, collection feeds will be outputted to `/feed/<COLLECTION>.xml`. If y
feed:
collections:
changes:
path: "/changes.xml"
path: "/changes.atom"
```

Finally, collections can also have category feeds which are outputted as `/feed/<COLLECTION>/<CATEGORY>.xml`. Specify categories like so:
Finally, collections can also have category feeds that are outputted as `/feed/<COLLECTION>/<CATEGORY>.xml`. Specify categories like so:

```yml
feed:
collections:
changes:
path: "/changes.xml"
path: "/changes.atom"
categories:
- news
- updates
Expand All @@ -195,15 +197,15 @@ feed:

Optional flag `excerpt_only` allows you to exclude post content from the Atom feed. Default value is `false` for backward compatibility.

When in `config.yml` is `true` than all posts in feed will be without `<content>` tags.
When in `config.yml` is `true` then all posts in feed will be without `<content>` tags.

```yml
feed:
excerpt_only: true
```

The same flag can be used directly in post file. It will be disable `<content>` tag for selected post.
Settings in post file has higher priority than in config file.
The same flag can be used directly in post file. It will disable `<content>` tag for selected post.
Settings in post file have higher priority than in config file.

## Tags

Expand Down Expand Up @@ -244,6 +246,16 @@ feed:

Note that if you include a tag that is excluded a feed will not be generated for it.

## Skip development

Use `disable_in_development: true` if you want to turn off feed generation when `jekyll.environment == "development"`,
but don't want to remove the plugin (so you don't accidentally commit the removal). Default value is `false`.

```yml
feed:
disable_in_development: true
```

## Contributing

1. Fork it (https://github.com/jekyll/jekyll-feed/fork)
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ environment:
- RUBY_FOLDER_VER: "26"
JEKYLL_VERSION : ">= 4.0.0.pre.alpha1"
- RUBY_FOLDER_VER: "26"
- RUBY_FOLDER_VER: "24"

install:
- SET PATH=C:\Ruby%RUBY_FOLDER_VER%-x64\bin;%PATH%
Expand Down
6 changes: 3 additions & 3 deletions jekyll-feed.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r!^spec/!)
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.4.0"
spec.required_ruby_version = ">= 2.5.0"

spec.add_dependency "jekyll", ">= 3.7", "< 5.0"

spec.add_development_dependency "bundler"
spec.add_development_dependency "nokogiri", "~> 1.6"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rubocop-jekyll", "~> 0.5"
spec.add_development_dependency "rubocop-jekyll", "~> 0.12.0"
spec.add_development_dependency "typhoeus", ">= 0.7", "< 2.0"
end
Loading

0 comments on commit da0cde8

Please sign in to comment.