From c84111dd378cb7a1c3a692dd135622fa537713bb Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Wed, 3 Jan 2018 11:49:37 -0500 Subject: [PATCH 01/47] Update README.md --- README.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 801d7a96ecd..424e1097347 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ *Hacker is a Jekyll theme for GitHub Pages. You can [preview the theme to see what it looks like](http://pages-themes.github.io/hacker), or even [use it today](#usage).* -![Thumbnail of hacker](thumbnail.png) +![Thumbnail of Hacker](thumbnail.png) ## Usage @@ -22,8 +22,6 @@ To use the Hacker theme: gem "github-pages", group: :jekyll_plugins ``` - - ## Customizing ### Configuration variables @@ -56,6 +54,8 @@ 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: @@ -65,6 +65,23 @@ If you'd like to change the theme's HTML layout: 3. Paste the default layout content copied in the first step 4. Customize the layout as you'd like +### 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/hacker/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 See the [open issues](https://github.com/pages-themes/hacker/issues) for a list of proposed features (and known issues). @@ -75,7 +92,7 @@ The Hacker theme is intended to make it quick and easy for GitHub Pages users to ## Contributing -Interested in contributing to Hacker? We'd love your help. Hacker is an open source project, built one contribution at a time by users like you. See [the CONTRIBUTING file](CONTRIBUTING.md) for instructions on how to contribute. +Interested in contributing to Hacker? We'd love your help. Hacker is an open source project, built one contribution at a time by users like you. See [the CONTRIBUTING file](docs/CONTRIBUTING.md) for instructions on how to contribute. ### Previewing the theme locally From 36bd972c7ce535e7e62005d1de082aafdf86819d Mon Sep 17 00:00:00 2001 From: Malik Butler Date: Sat, 27 Jan 2018 09:17:03 -0500 Subject: [PATCH 02/47] added post layout --- _layouts/post.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 _layouts/post.html diff --git a/_layouts/post.html b/_layouts/post.html new file mode 100644 index 00000000000..0676aff31c4 --- /dev/null +++ b/_layouts/post.html @@ -0,0 +1,14 @@ +--- +layout: default +--- + +{{ page.date | date: "%-d %B %Y" }} +

{{ page.title }}

+ +

by {{ page.author | default: site.author }}

+ +{{content}} + +{% if page.tags %} + tags: {{ page.tags | join: " - " }} +{% endif %} From f1c80ddaa23b3d24f8bc9d8c706b434591d9e86e Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Tue, 13 Feb 2018 15:55:10 +0200 Subject: [PATCH 03/47] Increase overall width to max 1000px The maximum width is currently set to 600px, while this works, it could easily have an increased width (say 1000px), which would improve readability of long code snippets. --- _sass/jekyll-theme-hacker.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sass/jekyll-theme-hacker.scss b/_sass/jekyll-theme-hacker.scss index bca8aa1448e..ccaba3a8455 100644 --- a/_sass/jekyll-theme-hacker.scss +++ b/_sass/jekyll-theme-hacker.scss @@ -21,7 +21,7 @@ body { .container { width: 90%; - max-width: 600px; + max-width: 1000px; margin: 0 auto; } From 39a52d72a207b20e210ecd81ee158d8e086b62a7 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Mon, 9 Apr 2018 19:50:37 -0400 Subject: [PATCH 04/47] Validate and enforce style via CI --- .rubocop.yml | 6 ++++++ jekyll-theme-hacker.gemspec | 4 ++++ script/cibuild | 3 +++ script/validate-html | 27 +++++++++++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 .rubocop.yml create mode 100755 script/validate-html diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000000..648dfb112f2 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,6 @@ +AllCops: + Exclude: + - _site/**/* + +Metrics/LineLength: + Enabled: false diff --git a/jekyll-theme-hacker.gemspec b/jekyll-theme-hacker.gemspec index 5a9729b3867..6c7dc526953 100644 --- a/jekyll-theme-hacker.gemspec +++ b/jekyll-theme-hacker.gemspec @@ -16,4 +16,8 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.add_runtime_dependency "jekyll", "~> 3.5" s.add_runtime_dependency "jekyll-seo-tag", "~> 2.0" + s.add_development_dependency 'w3c_validators', "~> 1.3" + s.add_development_dependency 'html-proofer', "~> 3.0" + s.add_development_dependency 'rubocop', "~> 0.50" + end diff --git a/script/cibuild b/script/cibuild index 5a4da9a5846..b9a29627904 100755 --- a/script/cibuild +++ b/script/cibuild @@ -3,4 +3,7 @@ set -e bundle exec jekyll build +bundle exec htmlproofer ./_site --check-html --disable-external +bundle exec rubocop -D +bundle exec script/validate-html gem build jekyll-theme-hacker.gemspec diff --git a/script/validate-html b/script/validate-html new file mode 100755 index 00000000000..f6b17eb2e07 --- /dev/null +++ b/script/validate-html @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby + +require 'w3c_validators' + +def validator(file) + extension = File.extname(file) + if extension == '.html' + W3CValidators::NuValidator.new + elsif extension == '.css' + W3CValidators::CSSValidator.new + end +end + +def validate(file) + puts "Checking #{file}..." + + path = File.expand_path "../_site/#{file}", __dir__ + results = validator(file).validate_file(path) + + return puts 'Valid!' if results.errors.empty? + + results.errors.each { |err| puts err.to_s } + exit 1 +end + +validate 'index.html' +validate File.join 'assets', 'css', 'style.css' From 9e1a44fb22f68213b36220e0783254a62ff70e6b Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Mon, 9 Apr 2018 19:50:39 -0400 Subject: [PATCH 05/47] Correct some style/validation errors --- _layouts/default.html | 4 ++-- index.md | 6 +++--- jekyll-theme-hacker.gemspec | 29 +++++++++++++---------------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index f8ccdd2f72f..909e43c55cc 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -2,7 +2,7 @@ - + @@ -33,7 +33,7 @@

{{ site.description | default: site.github.project_tagline }}

{% if site.google_analytics %} - +{% endif %} diff --git a/_includes/head-custom.html b/_includes/head-custom.html index eae554404ee..44cdb83f523 100644 --- a/_includes/head-custom.html +++ b/_includes/head-custom.html @@ -1,9 +1,12 @@ - + {% include head-custom-theme-colors.html %} - + +{% include head-custom-google-analytics.html %} + + diff --git a/_layouts/default.html b/_layouts/default.html index db8218fbc46..1c8c883a480 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -34,16 +34,5 @@

{{ site.description | default: site.github.project_tagline }}

{{ content }} - - {% if site.google_analytics %} - - {% endif %} From c21f95f2056cbb4ed4f6a4ece5512f581fed6537 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 26 Jul 2021 16:56:22 -0400 Subject: [PATCH 41/47] Update README.md --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f4e3582e316..4c2fac074ba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The Hacker theme -[Build Status](https://github.com/pages-themes/hacker/actions/workflows/ci.yaml) [![Gem Version](https://badge.fury.io/rb/jekyll-theme-hacker.svg)](https://badge.fury.io/rb/jekyll-theme-hacker) +[![.github/workflows/ci.yaml](https://github.com/pages-themes/hacker/actions/workflows/ci.yaml/badge.svg)](https://github.com/pages-themes/hacker/actions/workflows/ci.yaml) [![Gem Version](https://badge.fury.io/rb/jekyll-theme-hacker.svg)](https://badge.fury.io/rb/jekyll-theme-hacker) *Hacker is a Jekyll theme for GitHub Pages. You can [preview the theme to see what it looks like](http://pages-themes.github.io/hacker), or even [use it today](#usage).* @@ -13,7 +13,9 @@ To use the Hacker theme: 1. Add the following to your site's `_config.yml`: ```yml - theme: jekyll-theme-hacker + remote_theme: pages-themes/hacker@v0.2.0 + 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`: @@ -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] ``` @@ -66,6 +68,10 @@ If you'd like to change the theme's HTML layout: 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: @@ -107,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. From 4c942506cf8d5329a9cbc66b1eff75ad86a49e34 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 29 Jul 2021 13:56:34 -0400 Subject: [PATCH 42/47] jekyll-theme-hacker :gem: v0.2.0 --- jekyll-theme-hacker.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jekyll-theme-hacker.gemspec b/jekyll-theme-hacker.gemspec index 0464ddc223b..893e841f9b8 100644 --- a/jekyll-theme-hacker.gemspec +++ b/jekyll-theme-hacker.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = "jekyll-theme-hacker" - s.version = "0.1.2" + s.version = "0.2.0" s.license = "CC0-1.0" s.authors = ["Jason Costello", "GitHub, Inc."] s.email = ["opensource+jekyll-theme-hacker@github.com"] From dbea24696ef7bd27b8d317389b4b1f64af26c7b8 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Tue, 2 Jan 2024 16:07:20 -0600 Subject: [PATCH 43/47] Create publish-gem.yml --- .github/workflows/publish-gem.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/publish-gem.yml diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 00000000000..e48c355dad2 --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -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: '2.7.8' + - name: Build gem + run: | + gem build github-pages.gemspec + - name: Publish + run: | + gem push github-pages.gem --key ${{ secrets.PAGES_GEM_PUBLISH }} From 5cea62c2f6098ba8876c1ca80efc716bb1b92959 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Wed, 3 Jan 2024 17:32:04 -0600 Subject: [PATCH 44/47] Update publish-gem.yml --- .github/workflows/publish-gem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index e48c355dad2..2e939a01811 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -13,7 +13,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7.8' + ruby-version: '3.2' - name: Build gem run: | gem build github-pages.gemspec From 58bf1e75a6e881a23ed7f4922b5b0465b0039573 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Wed, 3 Jan 2024 17:34:55 -0600 Subject: [PATCH 45/47] Update ci.yaml --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d9249a52545..0323d522ef3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 From 91732ecd65d9a368c1275aecda9c1dca2365ca3d Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Wed, 3 Jan 2024 17:36:09 -0600 Subject: [PATCH 46/47] Update validate-html --- script/validate-html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/validate-html b/script/validate-html index 43d8fca8945..8f51642ea54 100755 --- a/script/validate-html +++ b/script/validate-html @@ -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 From b14e2cb56a0f94b0f4f15e3bc3c5a1569c3fde26 Mon Sep 17 00:00:00 2001 From: Fabian Aguilar Gomez Date: Fri, 5 Jan 2024 12:48:59 -0600 Subject: [PATCH 47/47] Update CONTRIBUTING.md --- docs/CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 37bc385828b..f59423126a9 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -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.