-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
111 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 | ||
ignore: | ||
- dependency-name: y18n | ||
versions: | ||
- 4.0.1 | ||
- 4.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
on: push | ||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: script/cibuild | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-ruby@v1 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler-cache: true | ||
- name: build | ||
run: script/bootstrap | ||
- name: test | ||
run: script/cibuild | ||
run: script/cibuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ Gemfile.lock | |
*.gem | ||
assets/**/*.html | ||
assets/**/*.md | ||
.jekyll-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
# The Primer theme | ||
|
||
[![Build Status](https://travis-ci.org/pages-themes/primer.svg?branch=master)](https://travis-ci.org/pages-themes/primer) [![Gem Version](https://badge.fury.io/rb/jekyll-theme-primer.svg)](https://badge.fury.io/rb/jekyll-theme-primer) | ||
[![.github/workflows/ci.yaml](https://github.com/pages-themes/primer/actions/workflows/ci.yaml/badge.svg)](https://github.com/pages-themes/primer/actions/workflows/ci.yaml) [![Gem Version](https://badge.fury.io/rb/jekyll-theme-primer.svg)](https://badge.fury.io/rb/jekyll-theme-primer) | ||
|
||
*Primer is a Jekyll theme for GitHub Pages. You can [preview the theme to see what it looks like](http://pages-themes.github.io/primer), or even [use it today](#usage).* | ||
|
||
## Usage | ||
![Thumbnail of Primer](thumbnail.png) | ||
|
||
> **_NOTE:_** Primer is now the default theme for GitHub Pages, but you can still specify the theme you're using as below. | ||
## Usage | ||
|
||
To use the Primer theme: | ||
|
||
1. Add the following to your site's `_config.yml`: | ||
|
||
```yml | ||
theme: jekyll-theme-primer | ||
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`: | ||
|
@@ -22,8 +24,6 @@ To use the Primer theme: | |
gem "github-pages", group: :jekyll_plugins | ||
``` | ||
|
||
|
||
|
||
## Customizing | ||
|
||
### Configuration variables | ||
|
@@ -38,6 +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" (unquoted) to indicate whether to provide a download URL] | ||
google_analytics: [Your Google Analytics tracking ID] | ||
``` | ||
|
||
|
@@ -55,14 +56,38 @@ If you'd like to add your own custom styles: | |
``` | ||
3. Add any custom CSS (or Sass, including imports) you'd like immediately after the `@import` line | ||
|
||
*Note: If you'd like to change the theme's Sass variables, you must set new values before the `@import` line in your stylesheet.* | ||
|
||
### Layouts | ||
|
||
If you'd like to change the theme's HTML layout: | ||
|
||
1. [Copy the original template](https://github.com/pages-themes/primer/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/primer/tree/master/_includes) provide a starting point and are included by the [original layout template](https://github.com/pages-themes/primer/blob/master/_layouts/default.html). | ||
2. For more extensive changes, [copy the original template](https://github.com/pages-themes/primer/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 | ||
|
||
Templates often rely on URLs supplied by GitHub such as links to your repository or links to download your project. If you'd like to override one or more default URLs: | ||
|
||
1. Look at [the template source](https://github.com/pages-themes/primer/blob/master/_layouts/default.html) to determine the name of the variable. It will be in the form of `{{ site.github.zip_url }}`. | ||
2. Specify the URL that you'd like the template to use in your site's `_config.yml`. For example, if the variable was `site.github.url`, you'd add the following: | ||
```yml | ||
github: | ||
zip_url: http://example.com/download.zip | ||
another_url: another value | ||
``` | ||
3. When your site is built, Jekyll will use the URL you specified, rather than the default one provided by GitHub. | ||
|
||
*Note: You must remove the `site.` prefix, and each variable name (after the `github.`) should be indent with two space below `github:`.* | ||
|
||
For more information, see [the Jekyll variables documentation](https://jekyllrb.com/docs/variables/). | ||
|
||
## Roadmap | ||
|
||
|
@@ -88,4 +113,4 @@ If you'd like to preview the theme locally (for example, in the process of propo | |
|
||
### Running tests | ||
|
||
The theme contains a minimal test suite, to ensure a site with the theme would build successfully. To run the tests, simply run `script/cibuild`. You'll need to run `script/bootstrap` one before the test script will work. | ||
The theme contains a minimal test suite, to ensure a site with the theme would build successfully. To run the tests, simply run `script/cibuild`. You'll need to run `script/bootstrap` once before the test script will work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-primer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |s| | ||
s.name = 'jekyll-theme-primer' | ||
s.version = '0.5.4' | ||
s.authors = ['GitHub, Inc.'] | ||
s.email = ['[email protected]'] | ||
s.homepage = 'https://github.com/pages-themes/jekyll-theme-primer' | ||
s.name = "jekyll-theme-primer" | ||
s.version = "0.6.0" | ||
s.authors = ["GitHub, Inc."] | ||
s.email = ["[email protected]"] | ||
s.homepage = "https://github.com/pages-themes/jekyll-theme-primer" | ||
s.summary = "Primer is a Jekyll theme for GitHub Pages based on GitHub's Primer styles" | ||
|
||
s.files = `git ls-files -z`.split("\x0").select do |f| | ||
f.match(%r{^(assets|_(includes|layouts|sass)/|(LICENSE|README)((\.(txt|md)|$)))}i) | ||
end | ||
|
||
s.platform = Gem::Platform::RUBY | ||
s.license = 'MIT' | ||
s.license = "MIT" | ||
|
||
s.add_dependency 'jekyll', '> 3.5', '< 5.0' | ||
s.add_runtime_dependency 'jekyll-github-metadata', '~> 2.9' | ||
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.required_ruby_version = ">= 2.4.0" | ||
|
||
s.add_dependency "jekyll", "> 3.5", "< 5.0" | ||
s.add_runtime_dependency "jekyll-github-metadata", "~> 2.9" | ||
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters