Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2
bundler-cache: true
- name: build
run: script/bootstrap
Expand Down
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 }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ 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]
google_analytics_v4: [Your Google Analytics tracking ID if you use new Google Analytics v4 (GA4)]
google_analytics: [Your legacy Universal Analytics (UA) tracking ID, for backward compatibility]
```

### Stylesheet
Expand Down Expand Up @@ -71,6 +72,7 @@ If you'd like to change the theme's HTML layout:
### 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.
Alternatively, set `google_analytics_v4:` (for new Google Analytics v4; GA4) or `google_analytics:` (for old Universal Analytics; UA) in `_config.yml`.

### Overriding GitHub-generated URLs

Expand Down
11 changes: 11 additions & 0 deletions _includes/head-custom-google-analytics-v4.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% if site.google_analytics_v4 %}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_v4 }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ site.google_analytics_v4 }}');
</script>
{% endif %}
3 changes: 3 additions & 0 deletions _includes/head-custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
{% include head-custom-theme-colors.html %}

<!-- Setup Google Analytics -->
<!-- Legacy Universal Analytics (UA) variant to preserve backward compatibility -->
{% include head-custom-google-analytics.html %}
<!-- New Google Analytics v4 (GA4) variant -->
{% include head-custom-google-analytics-v4.html %}

<!-- You can set your favicon here -->
<!-- link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}" -->
Expand Down
3 changes: 3 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion script/validate-html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def validate(file)

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

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

Expand Down