From 8e48284b994195bc10f5f13802dda2a3a5cd4231 Mon Sep 17 00:00:00 2001 From: Dan Beghin Date: Tue, 14 Jul 2020 11:13:21 -0500 Subject: [PATCH] feat(config): add a namespace to the theme config map (#2) - update readme - ensure normalize.css is included - fix padding on index article element --- README.md | 60 +++++-- _config.yml | 18 +- _includes/analytics.html | 4 +- _includes/disqus.html | 4 +- _includes/footer.html | 6 +- _includes/git-info.html | 10 +- _includes/header.html | 2 +- _sass/_index.scss | 20 ++- assets/css/app.scss | 2 +- assets/css/normalize.css | 349 +++++++++++++++++++++++++++++++++++++++ screenshot.png | Bin 0 -> 199367 bytes 11 files changed, 429 insertions(+), 46 deletions(-) create mode 100644 screenshot.png diff --git a/README.md b/README.md index 82e5199..6f91724 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,13 @@ # jekyll-theme-guardian -Welcome to your new Jekyll theme! In this directory, you'll find the files you need to be able to package up your theme into a gem. Put your layouts in `_layouts`, your includes in `_includes`, your sass files in `_sass` and any other assets in `assets`. - -To experiment with this code, add some sample content and run `bundle exec jekyll serve` – this directory is setup just like a Jekyll site! - -TODO: Delete this and the text above, and describe your gem - +![jekyll-theme-guardian preview](/screenshot.png) ## Installation Add this line to your Jekyll site's `Gemfile`: ```ruby -gem "jekyll-theme-guardian" +gem "jekyll-theme-guardian", git: 'git@github.com:widen/jekyll-theme-guardian.git', branch: "master" ``` And add this line to your Jekyll site's `_config.yml`: @@ -23,19 +18,54 @@ theme: jekyll-theme-guardian And then execute: - $ bundle +```bash +$ bundle +``` + +## Usage -Or install it yourself as: +### Configuration - $ gem install jekyll-theme-guardian +A number of configuration options are setup for use within your Jekyll site's `_config.yml`, all of the theme-specific options are prefixed with `guardian`: -## Usage +```yaml +guardian: + style: + logo_url: + header_background_url: + social_links: + twitter: + github_org: + github_repo: + tracking: + google_analytics_code: + disqus_shortname: +``` + +### Layouts + +* `default` - includes a header, content, and footer section +* `post` - extends `default` and optionally includes a Disqus comment block + +### includes -TODO: Write usage instructions here. Describe your available layouts, includes, sass and/or assets. +* `head` - included on the `default` layout; specifies title, stylesheets, etc. + * `favicons` - sets up links to favicons for browsers and mobile devices + * `analytics` - if `site.guardian.tracking.google_analytics_code` is populated, this will include GA tracking code +* `header` - included on the `default` layout; renders the header with `site.guardian.style.logo_url` and `site.guardian.style.header_background_url` +* `footer` - included on the `default` layout; renders a footer with social links + * `git-info` - includes links to GitHub to view/edit content +* `disqus` - included on the `post` layout; if `site.guardian.tracking.disqus_shortname` is populated, this will include a Disqus comment block + +### Assets + +* `app.css` - the main stylesheet; includes imported content from `_sass` as well as `normalize.css` +* `fonts` - the Ionicon font-family is included and wired for use +* `images` - a number of Widen-branded favicons are included in various sizes ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hello. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. +Bug reports and pull requests are welcome on GitHub at https://github.com/widen/jekyll-theme-guardian. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## Development @@ -43,10 +73,6 @@ To set up your environment to develop this theme, run `bundle install`. Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal. -When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled. -To add a custom directory to your theme-gem, please edit the regexp in `jekyll-theme-guardian.gemspec` accordingly. - ## License The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). - diff --git a/_config.yml b/_config.yml index da5acab..b696b2f 100644 --- a/_config.yml +++ b/_config.yml @@ -1,8 +1,12 @@ # theme configuration -logo_url: https://embed.widencdn.net/img/widen/c17yrvuaac/400px@2x/Widen Engineering White Logo.png?u=mcuc7i -header_background_url: https://embed.widencdn.net/img/widen/m4ml1kuspv/exact/1680x90_Engineering Blog Banner.png?keep=c&crop=yes&u=ksmgip -twitter_username: widendev -github_widen: https://github.com/widen -github_repository: https://github.com/widen/jekyll-theme-guardian -google_analytics_code: -disqus_shortname: +guardian: + style: + logo_url: https://embed.widencdn.net/img/widen/c17yrvuaac/400px@2x/Widen Engineering White Logo.png?u=mcuc7i + header_background_url: https://embed.widencdn.net/img/widen/m4ml1kuspv/exact/1680x90_Engineering Blog Banner.png?keep=c&crop=yes&u=ksmgip + social_links: + twitter: widendev + github_org: widen + github_repo: jekyll-theme-guardian + tracking: + google_analytics_code: + disqus_shortname: diff --git a/_includes/analytics.html b/_includes/analytics.html index 77180e9..85e5312 100644 --- a/_includes/analytics.html +++ b/_includes/analytics.html @@ -1,7 +1,7 @@ -{% if site.google_analytics_code %} +{% if site.guardian.tracking.google_analytics_code %}