github / github/pages-gem

External styles are being added when no theme is declared in _config.yml

Open
#613 2 comments 4 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
1.9k
Forks
360
PR merge metrics
No merged PRs in 30d

Description

### Before submitting an issue, please be sure to

- [x] Read [the contributing instructions](https://github.com/github/pages-gem/blob/master/docs/CONTRIBUTING.md#contributing-to-the-github-pages-gem)
- [x] Update to the latest Gem version (run `bundle update github-pages`)

### This issue affects

- [x] The site generated by GitHub Pages
- [x] Building sites locally

*The GitHub Pages Gem is intended to help users replicate the GitHub Pages build environment locally. If your issue affects both the hosted version and the version previewed locally, you may be better suited reporting [seeking support in other forums](https://github.com/github/pages-gem/blob/master/docs/SUPPORT.md).*

### What did you do (e.g., steps to reproduce)

1. Clone my repo: `git clone git@github.com:bryanbraun/bryanbraun.github.io.git`
2. Install dependencies: `bundle install`
3. Delete every file ending in `.scss` (for good measure)
4. Run `jekyll build`.
5. See the generated file in `_site/assets/style.css`

### What did you expect to happen?

No CSS files should be generated.

### What happened instead?

A CSS file is generated containing `normalize.css` and other styles from `jekyll-theme-primer`. It looks like my site is falling back to using `jekyll-theme-primer` as its theme, even though I have no themes defined in `_config.yml` (and I don't want to use any external theme).

Possible workaround: If I set `theme: null` it seems like the stylesheet doesn't get added. I'm not sure if this is good to rely on, since it isn't documented anywhere.

### Additional information

This issue [was previously reported in jekyll/jekyll](https://github.com/jekyll/jekyll/issues/7478) but it appears to be an issue with `pages-gem`.

* Link to the live site (if applicable): https://www.bryanbraun.com
* Link to the generated CSS file: https://www.bryanbraun.com/assets/css/style.css
* Link to the source repo (if applicable): https://github.com/bryanbraun/bryanbraun.github.io

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the reported repository by running `bundle install` and `jekyll build`, then inspect `_config.yml` and the generated `_site/assets/style.css`. Trace how pages-gem handles an absent theme versus `theme: null`; done means no external theme stylesheet is generated when no theme is declared, with coverage for both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
jekyll, ruby
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.