Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nouveautés de Cayman, mai 2022 #18

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2d81552
Update .github/config.yml
parkr Aug 8, 2020
22af2e7
Update docs/SUPPORT.md
parkr Aug 8, 2020
56b874b
Update docs/CONTRIBUTING.md
parkr Aug 8, 2020
1bcabf8
Create .github/workflows/ci.yaml
parkr Aug 8, 2020
9c3e707
Use `font-display: swap`
ogonkov Jul 1, 2020
0ce015a
Add Google fonts CSS preloading
ogonkov Jul 1, 2020
6853220
Add Google Fonts url to ignore
ogonkov Jul 1, 2020
c60bc38
Fix param
ogonkov Jul 1, 2020
e44678c
Merge pull request #101 from ogonkov/patch-1
parkr Feb 4, 2021
9c5c963
Update .github/workflows/ci.yaml
parkr Jul 14, 2021
ede1917
Update .github/settings.yml
parkr Jul 15, 2021
d6b071a
Rely on rubocop-github for Ruby formatting
parkr Jul 15, 2021
02f4eb0
Update .github/workflows/ci.yaml
parkr Jul 15, 2021
45e745d
Fix rubocop to work with vendor/ gems
parkr Jul 15, 2021
f0ea27b
Remove .jekyll-cache and fix script/cibuild
parkr Jul 15, 2021
ee7049f
Allow script/cibuild to be executed
parkr Jul 15, 2021
cd47cc1
Update README.md
parkr Jul 15, 2021
cc44da5
Add _sass/cayman.scss to allow importing with theme name while using …
parkr Jul 26, 2021
50957f2
Fix CI error
parkr Jul 26, 2021
dfb16f0
Merge pull request #132 from pages-themes/repo-name-scss
parkr Jul 26, 2021
854f51d
Add head-custom.html to allow easier customization of the <head>
parkr Jul 26, 2021
40f8f3d
Update head-custom.html
parkr Jul 26, 2021
2f96786
Merge pull request #133 from pages-themes/head-custom
parkr Jul 26, 2021
dab4be0
Update README.md
parkr Jul 26, 2021
29f8a34
jekyll-theme-cayman gem v0.2.0
parkr Jul 29, 2021
3cbd43c
Create publish-gem.yml
tsusdere Jan 2, 2024
150ba21
Update publish-gem.yml
tsusdere Jan 3, 2024
c038c41
Update ci.yaml
tsusdere Jan 3, 2024
d46c5da
Update validate-html
tsusdere Jan 3, 2024
74e11c1
Update CONTRIBUTING.md
tsusdere Jan 5, 2024
56aa6db
Merge pull request #198 from pages-themes/publish-gem
tsusdere Jan 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ requestInfoLabelToAdd: more-information-needed
# Welcome!

# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
newPRWelcomeComment: Welcome! Congrats on your first pull request to The Cayman Theme. If you haven't already, please be sure to check out [the contributing guidelines](https://github.com/pages-themes/cayman/blob/master/docs/CONTRIBUTING.md).
newPRWelcomeComment: Welcome! Congrats on your first pull request to the Cayman theme. If you haven't already, please be sure to check out [the contributing guidelines](https://github.com/pages-themes/cayman/blob/master/docs/CONTRIBUTING.md).

# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
firstPRMergeComment: "Congrats on getting your first pull request to The Cayman Theme merged! Without amazing humans like you submitting pull requests, we couldn’t run this project. You rock! :tada:<br /><br />If you're interested in tackling another bug or feature, take a look at [the open issues](https://github.com/pages-themes/cayman/issues), especially those [labeled `help wanted`](https://github.com/pages-themes/cayman/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)."
firstPRMergeComment: "Congrats on getting your first pull request to the Cayman theme merged! Without amazing humans like you submitting pull requests, we couldn’t run this project. You rock! :tada:<br /><br />If you're interested in tackling another bug or feature, take a look at [the open issues](https://github.com/pages-themes/cayman/issues), especially those [labeled `help wanted`](https://github.com/pages-themes/cayman/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)."
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ branch_protection:
required_status_checks:
strict: true
contexts:
- "continuous-integration/travis-ci"
- "script/cibuild" # GitHub Actions CI workflow
required_pull_request_reviews:
require_code_owner_reviews: true
18 changes: 18 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
pull_request:
types: [opened, synchronize]
jobs:
build:
runs-on: ubuntu-latest
name: script/cibuild
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: build
run: script/bootstrap
- name: test
run: script/cibuild
22 changes: 22 additions & 0 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish Gem

on:
release:
types: [released]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- name: Build gem
run: |
gem build github-pages.gemspec
- name: Publish
run: |
gem push github-pages.gem --key ${{ secrets.PAGES_GEM_PUBLISH }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ _site
.sass-cache
Gemfile.lock
*.gem
.jekyll-cache
.jekyll-cache
7 changes: 6 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
inherit_gem:
rubocop-github:
- config/default.yml

AllCops:
Exclude:
- _site/**/*
- vendor/**/*

Metrics/LineLength:
Layout/LineLength:
Enabled: false
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'
source "https://rubygems.org"

gemspec
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The Cayman theme

[![Build Status](https://travis-ci.org/pages-themes/cayman.svg?branch=master)](https://travis-ci.org/pages-themes/cayman) [![Gem Version](https://badge.fury.io/rb/jekyll-theme-cayman.svg)](https://badge.fury.io/rb/jekyll-theme-cayman)
[![.github/workflows/ci.yaml](https://github.com/pages-themes/cayman/actions/workflows/ci.yaml/badge.svg)](https://github.com/pages-themes/cayman/actions/workflows/ci.yaml) [![Gem Version](https://badge.fury.io/rb/jekyll-theme-cayman.svg)](https://badge.fury.io/rb/jekyll-theme-cayman)

*Cayman is a Jekyll theme for GitHub Pages. You can [preview the theme to see what it looks like](http://pages-themes.github.io/cayman), or even [use it today](#usage).*

Expand All @@ -13,7 +13,9 @@ To use the Cayman theme:
1. Add the following to your site's `_config.yml`:

```yml
theme: jekyll-theme-cayman
remote_theme: pages-themes/[email protected]
plugins:
- jekyll-remote-theme # add this line to the plugins list if you already have one
```

2. Optionally, if you'd like to preview your site on your computer, add the following to your site's `Gemfile`:
Expand All @@ -36,7 +38,7 @@ description: [A short description of your site's purpose]
Additionally, you may choose to set the following optional variables:

```yml
show_downloads: ["true" or "false" to indicate whether to provide a download URL]
show_downloads: ["true" or "false" (unquoted) to indicate whether to provide a download URL]
google_analytics: [Your Google Analytics tracking ID]
```

Expand All @@ -60,10 +62,15 @@ If you'd like to add your own custom styles:

If you'd like to change the theme's HTML layout:

1. [Copy the original template](https://github.com/pages-themes/cayman/blob/master/_layouts/default.html) from the theme's repository<br />(*Pro-tip: click "raw" to make copying easier*)
2. Create a file called `/_layouts/default.html` in your site
3. Paste the default layout content copied in the first step
4. Customize the layout as you'd like
1. For some changes such as a custom `favicon`, you can add custom files in your local `_includes` folder. The files [provided with the theme](https://github.com/pages-themes/cayman/tree/master/_includes) provide a starting point and are included by the [original layout template](https://github.com/pages-themes/cayman/blob/master/_layouts/default.html).
2. For more extensive changes, [copy the original template](https://github.com/pages-themes/cayman/blob/master/_layouts/default.html) from the theme's repository<br />(*Pro-tip: click "raw" to make copying easier*)
3. Create a file called `/_layouts/default.html` in your site
4. Paste the default layout content copied in the first step
5. Customize the layout as you'd like

### Customizing Google Analytics code

Google has released several iterations to their Google Analytics code over the years since this theme was first created. If you would like to take advantage of the latest code, paste it into `_includes/head-custom-google-analytics.html` in your Jekyll site.

### Overriding GitHub-generated URLs

Expand Down
10 changes: 10 additions & 0 deletions _includes/head-custom-google-analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% if site.google_analytics %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
9 changes: 9 additions & 0 deletions _includes/head-custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- start custom head snippets, customize with your own _includes/head-custom.html file -->

<!-- Setup Google Analytics -->
{% include head-custom-google-analytics.html %}

<!-- You can set your favicon here -->
<!-- link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}" -->

<!-- end custom head snippets -->
13 changes: 3 additions & 10 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>

{% if site.google_analytics %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
</script>
{% endif %}
<meta charset="UTF-8">

{% seo %}
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap" as="style" type="text/css" crossorigin>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#157878">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
{% include head-custom.html %}
</head>
<body>
<a id="skip-to-content" href="#content">Skip to the content.</a>
Expand Down
4 changes: 4 additions & 0 deletions _sass/cayman.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Placeholder file. If your site uses
// @import "{{ site.theme }}";
// Then using this theme with jekyll-remote-theme will work fine.
@import "jekyll-theme-cayman";
2 changes: 1 addition & 1 deletion _sass/jekyll-theme-cayman.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "normalize";
@import "rouge-github";
@import "variables";
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700');
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap');

@mixin large {
@media screen and (min-width: #{$large-breakpoint}) {
Expand Down
13 changes: 8 additions & 5 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contributing to The Cayman Theme
# Contributing to the Cayman theme

Hi there! We're thrilled that you'd like to contribute to The Cayman Theme. Your help is essential for keeping it great.
Hi there! We're thrilled that you'd like to contribute to the Cayman theme. Your help is essential for keeping it great.

The Cayman Theme is an open source project supported by the efforts of an entire community and built one contribution at a time by users like you. We'd love for you to get involved. Whatever your level of skill or however much time you can give, your contribution is greatly appreciated. There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests, helping other users by commenting on issues, or writing code which can be incorporated into The Cayman Theme itself.
the Cayman theme is an open source project supported by the efforts of an entire community and built one contribution at a time by users like you. We'd love for you to get involved. Whatever your level of skill or however much time you can give, your contribution is greatly appreciated. There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests, helping other users by commenting on issues, or writing code which can be incorporated into the Cayman theme itself.

Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.

Expand All @@ -28,7 +28,7 @@ Here are a few tips for writing *great* bug reports:

## How to suggest a feature or enhancement

If you find yourself wishing for a feature that doesn't exist in The Cayman Theme, you are probably not alone. There are bound to be others out there with similar needs. Many of the features that The Cayman Theme has today have been added because our users saw the need.
If you find yourself wishing for a feature that doesn't exist in the Cayman theme, you are probably not alone. There are bound to be others out there with similar needs. Many of the features that the Cayman theme has today have been added because our users saw the need.

Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and goals of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible, including describing the problem you're trying to solve.

Expand All @@ -38,7 +38,7 @@ Feature requests are welcome. But take a moment to find out whether your idea fi

## Your first contribution

We'd love for you to contribute to the project. Unsure where to begin contributing to The Cayman Theme? You can start by looking through these "good first issue" and "help wanted" issues:
We'd love for you to contribute to the project. Unsure where to begin contributing to the Cayman theme? You can start by looking through these "good first issue" and "help wanted" issues:

* [Good first issues](https://github.com/pages-themes/cayman/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) - issues which should only require a few lines of code and a test or two
* [Help wanted issues](https://github.com/pages-themes/cayman/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) - issues which may be a bit more involved, but are specifically seeking community contributions
Expand Down Expand Up @@ -77,6 +77,9 @@ At a high level, [the process for proposing changes](https://guides.github.com/i

`script/cibuild`

## Publishing Gem
In order to publish the Gem bump the version in *this file*, commit, create a tag with the new version number, and finally push the commit and tag to the repo.

## Code of conduct

This project is governed by [the Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
Expand Down
8 changes: 4 additions & 4 deletions docs/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Where to get help

If you think you've found a bug in The Cayman Theme, please [check the existing issues](https://github.com/pages-themes/cayman/issues), and if no one has reported the problem, [open a new issue](https://github.com/pages-themes/cayman/issues/new).
If you think you've found a bug in the Cayman theme, please [check the existing issues](https://github.com/pages-themes/cayman/issues), and if no one has reported the problem, [open a new issue](https://github.com/pages-themes/cayman/issues/new).

If you have a general question about the theme, how to implement it, or how to customize it for your site you have two options:

1. [Contact GitHub Support](https://github.com/contact?form%5Bsubject%5D=GitHub%20Pages%20theme%20pages-themes/cayman), or
If you have a general question about the theme, how to implement it, or how to customize it for your site you have two options:

1. Search for your query on [`support.github.com`](https://support.github.com/?q=pages+Cayman+theme), which will also look for similar topics on [`github.community`](https://github.community/search?q=pages+Cayman+theme)
2. Ask your question of the Jekyll community on [talk.jekyllrb.com](https://talk.jekyllrb.com/)
3. [Contact GitHub Support](https://github.com/contact?form%5Bsubject%5D=GitHub%20Pages%20theme%20pages-themes/cayman)
26 changes: 14 additions & 12 deletions jekyll-theme-cayman.gemspec
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# frozen_string_literal: true

Gem::Specification.new do |s|
s.name = 'jekyll-theme-cayman'
s.version = '0.1.1'
s.license = 'CC0-1.0'
s.authors = ['Jason Long', 'GitHub, Inc.']
s.email = ['[email protected]']
s.homepage = 'https://github.com/pages-themes/cayman'
s.summary = 'Cayman is a Jekyll theme for GitHub Pages'
s.name = "jekyll-theme-cayman"
s.version = "0.2.0"
s.license = "CC0-1.0"
s.authors = ["Jason Long", "GitHub, Inc."]
s.email = ["[email protected]"]
s.homepage = "https://github.com/pages-themes/cayman"
s.summary = "Cayman is a Jekyll theme for GitHub Pages"

s.files = `git ls-files -z`.split("\x0").select do |f|
f.match(%r{^((_includes|_layouts|_sass|assets)/|(LICENSE|README)((\.(txt|md|markdown)|$)))}i)
end

s.required_ruby_version = ">= 2.4.0"

s.platform = Gem::Platform::RUBY
s.add_runtime_dependency 'jekyll', '> 3.5', '< 5.0'
s.add_runtime_dependency 'jekyll-seo-tag', '~> 2.0'
s.add_development_dependency 'html-proofer', '~> 3.0'
s.add_development_dependency 'rubocop', '~> 0.50'
s.add_development_dependency 'w3c_validators', '~> 1.3'
s.add_runtime_dependency "jekyll", "> 3.5", "< 5.0"
s.add_runtime_dependency "jekyll-seo-tag", "~> 2.0"
s.add_development_dependency "html-proofer", "~> 3.0"
s.add_development_dependency "rubocop-github", "~> 0.16"
s.add_development_dependency "w3c_validators", "~> 1.3"
end
4 changes: 2 additions & 2 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

bundle exec jekyll build
bundle exec htmlproofer ./_site --check-html --check-sri
bundle exec rubocop -D
bundle exec htmlproofer ./_site --check-html --check-sri --url-ignore '/fonts.gstatic.com/'
bundle exec rubocop -D --config .rubocop.yml
bundle exec script/validate-html
gem build jekyll-theme-cayman.gemspec
14 changes: 7 additions & 7 deletions script/validate-html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'w3c_validators'
require "w3c_validators"

def validator(file)
extension = File.extname(file)
if extension == '.html'
if extension == ".html"
W3CValidators::NuValidator.new
elsif extension == '.css'
elsif extension == ".css"
W3CValidators::CSSValidator.new
end
end
Expand All @@ -18,11 +18,11 @@ def validate(file)
path = File.expand_path "../_site/#{file}", __dir__
results = validator(file).validate_file(path)

return puts 'Valid!' if results.errors.empty?
return puts "Valid!" if results.errors.empty?

results.errors.each { |err| puts err.to_s }
results.errors.each { |err| puts err }
exit 1
end

validate 'index.html'
validate File.join 'assets', 'css', 'style.css'
validate "index.html"
validate File.join "assets", "css", "style.css"