Skip to content

Commit

Permalink
Merge branch 'master' into history
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyF authored Dec 29, 2017
2 parents c71d2f2 + 3b7c257 commit ef62f13
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 20 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Minima has been scaffolded by the `jekyll new-theme` command and therefore has a
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.
- `home.html` — The layout for your landing-page / home-page / index-page. [[More Info.](#home-layout)]
- `page.html` — The layout for your documents that contain FrontMatter, but are not posts.
- `post.html` — The layout for your posts.

Expand Down Expand Up @@ -71,6 +71,25 @@ Minima comes with [`jekyll-seo-tag`](https://github.com/jekyll/jekyll-seo-tag) p

## Usage

### Home Layout

`home.html` is a flexible HTML layout for the site's landing-page / home-page / index-page. <br/>

#### Main Heading and Content-injection

From Minima v2.2 onwards, the *home* layout will inject all content from your `index.md` / `index.html` **before** the **`Posts`** heading. This will allow you to include non-posts related content to be published on the landing page under a dedicated heading. *We recommended that you title this section with a Heading2 (`##`)*.

Usually the `site.title` itself would suffice as the implicit 'main-title' for a landing-page. But, if your landing-page would like a heading to be explicitly displayed, then simply define a `title` variable in the document's front matter and it will be rendered with an `<h1>` tag.

#### Post Listing

This section is optional from Minima v2.2 onwards.<br/>
It will be automatically included only when your site contains one or more valid posts or drafts (if the site is configured to `show_drafts`).

The title for this section is `Posts` by default and rendered with an `<h2>` tag. You can customize this heading by defining a `list_title` variable in the document's front matter.

--

### 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.
Expand Down
32 changes: 18 additions & 14 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@
---

<div class="home">
{% if page.title %}
<h1 class="page-heading">{{ page.title }}</h1>
{% endif %}

{{ content }}

<h1 class="page-heading">Posts</h1>

<ul class="post-list">
{% for post in site.posts %}
<li>
{% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}
<span class="post-meta">{{ post.date | date: date_format }}</span>
{% if site.posts.size > 0 %}
<h2 class="post-list-heading">{{ page.list_title | default: "Posts" }}</h2>
<ul class="post-list">
{% for post in site.posts %}
<li>
{% 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>
</h2>
</li>
{% endfor %}
</ul>
<h3>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
</h3>
</li>
{% endfor %}
</ul>

<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></p>
<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></p>
{% endif %}

</div>
6 changes: 5 additions & 1 deletion _sass/minima/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@
}

.page-heading {
@include relative-font-size(1.25);
@include relative-font-size(2);
}

.post-list-heading {
@include relative-font-size(1.75);
}

.post-list {
Expand Down
4 changes: 0 additions & 4 deletions minima.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ Gem::Specification.new do |spec|
f.match(%r{^(assets|_(includes|layouts|sass)/|(LICENSE|README)((\.(txt|md|markdown)|$)))}i)
end

spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }

spec.add_runtime_dependency "jekyll", "~> 3.5"
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.1"

spec.add_development_dependency "bundler", "~> 1.12"
end

0 comments on commit ef62f13

Please sign in to comment.