Skip to content

Commit

Permalink
Merge pull request #133 from mdo/v4
Browse files Browse the repository at this point in the history
Prepping v4
  • Loading branch information
mdo authored Apr 27, 2020
2 parents 79df445 + 8640b1e commit dd20799
Show file tree
Hide file tree
Showing 24 changed files with 9,052 additions and 589 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Enforce Unix newlines
* text=auto eol=lf
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI
on: [push, pull_request]
env:
CI: true
NODE: 12.x
RUBY: 2.6.x

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/checkout@v1

- name: Set Node.js version
uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE }}"

- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: "${{ env.RUBY }}"

- name: Disable gem docs
run: 'echo "gem: --no-document" > ~/.gemrc'

- name: Set up Ruby cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: |
${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('.github/workflows/ci.yml') }}
- name: Set up Bundler
run: gem install bundler -v "~> 1.17"

- run: ruby --version
- run: gem --version
- run: bundle --version
- run: node --version
- run: npm --version

- name: Install npm dependencies
run: npm ci

- name: Install bundler dependencies
run: bundle install --deployment --jobs=4 --retry=3 --clean

- name: Run tests
run: npm test

- name: Upload docs
uses: actions/upload-artifact@v1
if: success() && startsWith(github.ref, 'refs/tags/')
with:
name: docs
path: ./_site/

deploy:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2

- name: Download docs
uses: actions/download-artifact@v1
with:
name: docs
path: ./_site/

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
emptyCommits: false
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_branch: gh-pages
publish_dir: ./_site/
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ignore docs files
_gh_pages
_site
.ruby-version
/.sass-cache/
/_site/
/.ruby-version

# Numerous always-ignore extensions
*.diff
Expand Down Expand Up @@ -33,10 +33,11 @@ nbproject
*.komodoproject
.komodotools

# grunt-html-validation
validation-status.json
validation-report.json

# Folders to ignore
node_modules
bower_components
/.bundle/
/.jekyll-cache/
/node_modules/
/vendor/

# Local Netlify folder
.netlify
10 changes: 10 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": [
"stylelint-config-twbs-bootstrap/scss"
],
"rules": {
"no-duplicate-selectors": true,
"property-no-vendor-prefix": null,
"value-no-vendor-prefix": null
}
}
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'jekyll', '~> 4.0.0'
gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform?
74 changes: 74 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.6)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
eventmachine (1.2.7-x64-mingw32)
ffi (1.12.2)
ffi (1.12.2-x64-mingw32)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
jekyll (4.0.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (>= 0.9.5, < 2)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 1.8)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.2.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.4)
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.4)
rouge (3.18.0)
safe_yaml (1.0.5)
sassc (2.3.0)
ffi (~> 1.9)
sassc (2.3.0-x64-mingw32)
ffi (~> 1.9)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)
wdm (0.1.1)

PLATFORMS
ruby
x64-mingw32

DEPENDENCIES
jekyll (~> 4.0.0)
wdm (~> 0.1.1)

BUNDLED WITH
1.17.3
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
# GitHub Buttons
# GitHub Buttons [![Build Status](https://github.com/mdo/github-buttons/workflows/CI/badge.svg)](https://github.com/mdo/github-buttons/actions?workflow=CI)

Showcase your GitHub (repo's) success with these static buttons featuring links to your GitHub repo or profile page and up-to-date watch, fork, and follower counts.
Showcase your GitHub (repo's) success with these static buttons featuring links to your GitHub repo or profile page and up-to-date watch, fork, sponsor, and follower counts.

To get started, checkout <https://ghbtns.com>!
To get started, checkout <https://ghbtns.com/>!

## Bug tracker

Have a bug? Please create an issue here on GitHub at <https://github.com/mdo/github-buttons/issues>.

## Development

The GitHub buttons source code is split across three files in `src/`—the HTML, CSS, and JS—and compiled with [gulp](http://gulpjs.com).
The `github-btn.hml` file contains the button markup and includes the external CSS and JS. Those includes are inlined and the overall page minified with gulp.
Clone the project and install dependencies before getting started. GitHub Buttons require Node.js, Ruby, and Bundler for local development.

To build the files, just run gulp:
```shell
npm i
bundle i
```

The GitHub buttons source code is split across three files in `src/`—the HTML, CSS, and JS. We use inline-source-cli and html-minifer to include it all in the compiled `github-btn.html` file. To build this file:

```shell
$ gulp
npm run build
```

Lastly, the `https://ghbtns.com` site is built with Jekyll (requires Ruby and more). Install [Jekyll](http://jekyllrb.com) and run a local server to view your changes:
The `https://ghbtns.com/` site is built with Jekyll. After installing the dependencies, you can run a local server:

```shell
$ jekyll serve --watch
bundle exec jekyll serve
```

Open `http://127.0.0.1:4000` to browse locally.

## See also

- [ntkme/github-buttons](https://buttons.github.io)
* [ntkme/github-buttons](https://buttons.github.io/)

## Twitter account

Expand All @@ -37,9 +43,9 @@ Keep up to date on announcements and more by following Mark on Twitter, [@mdo](h

**Mark Otto**

* https://twitter.com/mdo
* https://github.com/mdo
* <https://twitter.com/mdo>
* <https://github.com/mdo>

## Copyright and license

Copyright 2014-2015 Mark Otto. Released under Apache 2.0.
Copyright 2014-2020 Mark Otto. Released under [Apache 2.0](LICENSE.md).
21 changes: 11 additions & 10 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Dependencies
markdown: kramdown
highlighter: pygments

# Permalinks
permalink: pretty
permalink: pretty

exclude:
- "node_modules"
- "src"
- "CNAME"
- "gulpfile.js"
- ".sass-cache"
- "Gemfile"
- "Gemfile.lock"
- "html-minifier.json"
- "LICENSE.md"
- "package.json"
- "package-lock.json"
- "README.md"
- "node_modules/"
- "src/"

sass:
style: compressed
19 changes: 19 additions & 0 deletions _includes/example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{%- comment -%}
Usage: include example.html content=markup [args],
where content is a capture with the HTML content

args can be one of the following:
id - null (default)
class - "example" (default)
{%- endcomment -%}

{%- assign id = include.id -%}
{%- assign class = include.class -%}

<div{% if id %} id="{{ id }}"{% endif %} class="example{% if class %} {{ class }}{% endif %}">
{{- include.content | replace: 'https://ghbtns.com/', '' | replace: ' frameborder="0" scrolling="0"' '' -}}
</div>

{%- highlight html -%}
{{- include.content -}}
{%- endhighlight -%}
3 changes: 3 additions & 0 deletions _includes/page.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Our bundle CSS files listed here so that we inlcude it in Jekyll
@import "page";
@import "syntax";
66 changes: 0 additions & 66 deletions _includes/syntax.css

This file was deleted.

Loading

0 comments on commit dd20799

Please sign in to comment.