Skip to content

Commit

Permalink
Merge pull request jekyll#43 from ashmaroli/css-to-assets
Browse files Browse the repository at this point in the history
Merge pull request 43
  • Loading branch information
jekyllbot authored Sep 30, 2016
2 parents 2817b3b + cc49d2e commit 23e95b0
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 14 deletions.
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,31 @@ And then execute:
$ bundle
Then add a `css/main.scss` file based on the following template, don't forget to include the frontmatter:
```css
---
---
## Usage
@import "minima";
```
### Customization
To override the default structure and style of minima, simply create the concerned directory at the root of your site, copy the file you wish to customize to that directory, and then edit the file.
e.g., to override the [`_includes/head.html `](_includes/head.html) file to specify a custom style path, create an `_includes` directory, copy `_includes/head.html` from minima gem folder to `<yoursite>/_includes` and start editing that file.

You can choose to override the [`_includes/head.html `](_includes/head.html) file to specify a custom style path.
The site's default CSS has now moved to a new place within the gem itself, [`assets/main.scss`](assets/main.scss). To **override the default CSS**, the file has to exist at your site source. Do either of the following:
- Create a new instance of `main.scss` at site source.
- Create a new file `main.scss` at `<your-site>/assets/`
- Add the frontmatter dashes, and
- Add `@import "minima";`, to `<your-site>/assets/main.scss`
- Add your custom CSS.
- Download the file from this repo
- Create a new file `main.scss` at `<your-site>/assets/`
- Copy the contents at [assets/main.scss](assets/main.scss) onto the `main.scss` you just created, and edit away!
- Copy directly from Minima 2.0 gem
- Go to your local minima gem installation directory ( run `bundle show minima` to get the path to it ).
- Copy the `assets/` folder from there into the root of `<your-site>`
- Change whatever values you want, inside `<your-site>/assets/main.scss`

## Enabling comments (via Disqus)
--

### Enabling comments (via Disqus)

Optionally, if you have a Disqus account, you can tell Jekyll to use it to show a comments section below each post.

Expand All @@ -50,7 +63,9 @@ Comments are enabled by default and will only appear in production, i.e., `JEKYL

If you don't want to display comments for a particular post you can disable them by adding `comments: false` to that post's YAML Front Matter.

## Enabling Google Analytics
--

### Enabling Google Analytics

To enable Google Anaytics, add the following lines to your Jekyll site:

Expand Down
2 changes: 1 addition & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{% assign custom_url = site.url | append: site.baseurl %}
{% assign full_base_url = custom_url | default: site.github.url %}
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: full_base_url }}">
<link rel="stylesheet" href="{{ "/assets/main.css" | prepend: full_base_url }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: full_base_url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | prepend: full_base_url }}">

Expand Down
39 changes: 39 additions & 0 deletions assets/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# Only the main Sass file needs front matter (the dashes are enough)
---
@charset "utf-8";

// Our variables
$base-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
$base-font-size: 16px;
$base-font-weight: 400;
$small-font-size: $base-font-size * 0.875;
$base-line-height: 1.5;

$spacing-unit: 30px;

$text-color: #111;
$background-color: #fdfdfd;
$brand-color: #2a7ae2;

$grey-color: #828282;
$grey-color-light: lighten($grey-color, 40%);
$grey-color-dark: darken($grey-color, 25%);

// Width of the content area
$content-width: 800px;

$on-palm: 600px;
$on-laptop: 800px;

// Minima also includes a mixin for defining media queries.
// Use media queries like this:
// @include media-query($on-palm) {
// .wrapper {
// padding-right: $spacing-unit / 2;
// padding-left: $spacing-unit / 2;
// }
// }

// Import partials from the `minima` theme.
@import "minima";
4 changes: 0 additions & 4 deletions example/css/main.scss

This file was deleted.

16 changes: 16 additions & 0 deletions minima.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ Gem::Specification.new do |spec|
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }

spec.post_install_message = <<-msg
----------------------------------------------
Thank you for installing minima 2.0!
Minima 2.0 comes with a breaking change that
renders '<your-site>/css/main.scss' redundant.
That file is now bundled with this gem as
'<minima>/assets/main.scss'.
More Information:
https://github.com/jekyll/minima#customization
----------------------------------------------
msg

spec.add_development_dependency "jekyll", "~> 3.2"
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 10.0"
Expand Down

0 comments on commit 23e95b0

Please sign in to comment.