Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jekyll/minima into excerpt
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Apr 7, 2017
2 parents 16d7ff1 + f6964b9 commit 1d3bada
Show file tree
Hide file tree
Showing 20 changed files with 167 additions and 59 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.bundle
.sass-cache
Gemfile.lock
example/_site
_site
.sass-cache
*.gem
23 changes: 23 additions & 0 deletions History.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## HEAD

### Minor Enhancements

* Close #55: Improve mobile user experience (#62)
* Remove incomplete status from spec summary (#63)
* Use date_format if set in configuration (#70)
* Corrected misspelled word (#72)
* Scale headings relative to base-font-size (#78)
* Remove 2.0 post-install message (#82)
* Fixes #115 - Only include the nav tag if there are pages to be displayed in the menu (#116)
* Fixes #80, #106. Make the hamburger work with pure CSS. (#111)
* add `header_pages` config to link only specific files in header (#52)

### Development Fixes

* Remove duplicate .sass-cache (#71)
* Demo minima on GitHub Pages (#76)

### Documentation

* Update README with theme content description (#91)

## 2.1.0 / 2016-11-15

### Minor Enhancements
Expand Down
59 changes: 57 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,48 @@ theme: minima
And then execute:
$ bundle
## Contents At-A-Glance
Minima has been scaffolded by the `jekyll new-theme` command and therefore has all the necessary files and directories to have a new Jekyll site up and running with zero-configuration.

### Layouts

Refers to files within the `_layouts` directory, that define the markup for your theme.

- `default.html` — The base layout that lays the foundation for subsequent layouts. The derived layouts inject their contents into this file at the line that says ` {{ content }} ` and are linked to this file via [FrontMatter](https://jekyllrb.com/docs/frontmatter/) declaration `layout: default`.
- `home.html` — The layout for your landing-page / home-page / index-page.
- `page.html` — The layout for your documents that contain FrontMatter, but are not posts.
- `post.html` — The layout for your posts.

### Includes

Refers to snippets of code within the `_includes` directory that can be inserted in multiple layouts (and another include-file as well) within the same theme-gem.

- `disqus_comments.html` — Code to markup disqus comment box.
- `footer.html` — Defines the site's footer section.
- `google-analytics.html` — Inserts Google Analytics module (active only in production environment).
- `head.html` &mdash; Code-block that defines the `<head></head>` in *default* layout.
- `header.html` &mdash; Defines the site's main header section.
- `icon-* files` &mdash; Inserts github and twitter ids with respective icons.

### Sass

Refers to `.scss` files within the `_sass` directory that define the theme's styles.

- `minima.scss` &mdash; The core file imported by preprocessed `main.scss`, it defines the variable defaults for the theme and also further imports sass partials to supplement itself.
- `minima/_base.scss` &mdash; Resets and defines base styles for various HTML elements.
- `minima/_layout.scss` &mdash; Defines the visual style for various layouts.
- `minima/_syntax-highlighting.scss` &mdash; Defines the styles for syntax-highlighting.

### Assets

Refers to various asset files within the `assets` directory.
Contains the `main.scss` that imports sass files from within the `_sass` directory. This `main.scss` is what gets processed into the theme's main stylesheet `main.css` called by `_layouts/default.html` via `_includes/head.html`.

This directory can include sub-directories to manage assets of similar type, and will be copied over as is, to the final transformed site directory.


## Usage

Expand All @@ -46,6 +87,20 @@ The site's default CSS has now moved to a new place within the gem itself, [`ass

--

### Change default date format

You can change the default date format by specifying `site.minima.date_format`
in `_config.yml`.

```
# Minima date format
# refer to http://shopify.github.io/liquid/filters/date/ if you want to customize this
minima:
date_format: "%b %-d, %Y"
```
--
### 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 Down Expand Up @@ -93,7 +148,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/jekyll

To set up your environment to develop this theme, run `bundle install`.

To test your theme, run `bundle exec rake preview` and open your browser at `http://localhost:4000/minima/`. This starts a Jekyll server using your theme and the contents of the `example/` directory. As you make modifications to your theme and to the example site, your site will regenerate and you should see the changes in the browser after a refresh.
To test your theme, run `bundle exec rake preview` and open your browser at `http://localhost:4000/minima/`. This starts a Jekyll server using your theme and the contents. As you make modifications, your site will regenerate and you should see the changes in the browser after a refresh.

## License

Expand Down
2 changes: 0 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ end
task :preview do
base = Pathname.new('.').expand_path
options = {
"source" => base.join('example').to_s,
"destination" => base.join('example/_site').to_s,
"force_polling" => false,
"serving" => true,
"theme" => "minima"
Expand Down
12 changes: 11 additions & 1 deletion example/_config.yml → _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ description: > # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "/minima"
twitter_username: jekyllrb
github_username: jekyll
show_excerpts: enabled

# Minima date format
# refer to http://shopify.github.io/liquid/filters/date/ if you want to customize this
minima:
date_format: "%b %-d, %Y"

# If you want to link only specific pages in your header, uncomment
# this and add the path to the pages in order as they should show up
#header_pages:
# - about.html

# Build settings
markdown: kramdown
theme: minima
Expand Down
47 changes: 26 additions & 21 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
<header class="site-header" role="banner">

<div class="wrapper">
{% assign default_paths = site.pages | map: "path" %}
{% assign page_paths = site.header_pages | default: default_paths %}
<a class="site-title" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>

{% if page_paths %}
<nav class="site-nav">
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger">
<span class="menu-icon">
<svg viewBox="0 0 18 15" width="18px" height="15px">
<path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
<path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
<path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
</svg>
</span>
</label>

<a class="site-title" href="{{ "/" | relative_url}}">{{ site.title | escape }}</a>

<nav class="site-nav">
<span class="menu-icon">
<svg viewBox="0 0 18 15" width="18px" height="15px">
<path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
<path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
<path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
</svg>
</span>

<div class="trigger">
{% for my_page in site.pages %}
{% if my_page.title %}
<a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
{% endif %}
{% endfor %}
</div>
</nav>

<div class="trigger">
{% for path in page_paths %}
{% assign my_page = site.pages | where: "path", path | first %}
{% if my_page.title %}
<a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
{% endif %}
{% endfor %}
</div>
</nav>
{% endif %}
</div>

</header>
3 changes: 2 additions & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ <h1 class="page-heading">Posts</h1>
<ul class="post-list">
{% for post in site.posts %}
<li>
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
{% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}
<span class="post-meta">{{ post.date | date: date_format }}</span>

<h2>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
Expand Down
9 changes: 8 additions & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@

<header class="post-header">
<h1 class="post-title" itemprop="name headline">{{ page.title | escape }}</h1>
<p class="post-meta"><time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%b %-d, %Y" }}</time>{% if page.author %} • <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{% endif %}</p>
<p class="post-meta">
<time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
{% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}
{{ page.date | date: date_format }}
</time>
{% if page.author %}
<span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>
{% endif %}</p>
</header>

<div class="post-content" itemprop="articleBody">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 18 additions & 1 deletion _sass/minima/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,15 @@ a {
color: $text-color;
text-decoration: underline;
}
}

.social-media-list &:hover {
text-decoration: none;

.username {
text-decoration: underline;
}
}
}


/**
Expand Down Expand Up @@ -199,3 +206,13 @@ pre {
fill: $grey-color;
}
}

.social-media-list {
.icon {
padding-right: 5px;
}

li + li {
padding-top: 5px;
}
}
21 changes: 17 additions & 4 deletions _sass/minima/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
float: right;
line-height: 56px;

.nav-trigger {
display: none;
}

.menu-icon {
display: none;
}
Expand All @@ -51,6 +55,15 @@
border-radius: 5px;
text-align: right;

label[for="nav-trigger"] {
display: block;
float: right;
width: 36px;
height: 36px;
z-index: 2;
cursor: pointer;
}

.menu-icon {
display: block;
float: right;
Expand All @@ -65,12 +78,12 @@
}
}

.trigger {
input ~ .trigger {
clear: both;
display: none;
}

&:hover .trigger {
input:checked ~ .trigger {
display: block;
padding-bottom: 5px;
}
Expand Down Expand Up @@ -98,7 +111,7 @@
}

.footer-heading {
font-size: 18px;
font-size: $base-font-size * 1.125;
margin-bottom: $spacing-unit / 2;
}

Expand Down Expand Up @@ -167,7 +180,7 @@
}

.page-heading {
font-size: 20px;
font-size: $base-font-size * 1.25;
}

.post-list {
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions example/Gemfile

This file was deleted.

File renamed without changes.
18 changes: 1 addition & 17 deletions minima.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
spec.authors = ["Joel Glovier"]
spec.email = ["[email protected]"]

spec.summary = %q{A beautiful, minimal theme for Jekyll. NOT DONE YET.}
spec.summary = %q{A beautiful, minimal theme for Jekyll.}
spec.homepage = "https://github.com/jekyll/minima"
spec.license = "MIT"

Expand All @@ -19,22 +19,6 @@ 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_runtime_dependency "jekyll", "~> 3.3"

spec.add_development_dependency "bundler", "~> 1.12"
Expand Down
4 changes: 2 additions & 2 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

set -e

echo "Buidling the example site..."
bundle exec jekyll build --source example
echo "Building the example site..."
bundle exec jekyll build
3 changes: 2 additions & 1 deletion script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ script/build
if test -e "./_site/index.html";then
echo "It builds!"
rm -Rf _site
exit 0
else
echo "Huh. That's odd. The example site doesn't seem to build."
exit 1
fi

gem build minima.gemspec

0 comments on commit 1d3bada

Please sign in to comment.