Spica Jekyll documentation
The home page
Set Spica's home page greeting, choose grid, list or text style, feature one post, and understand page numbers and the newsletter panel.
The home page is index.html, and everything on it is set in _config.yml under spica.home. It shows an optional greeting, one large featured post, the list of posts, page numbers and the newsletter panel. There’s only one home page: the three looks come from one setting.
spica:
home:
intro: "Hello, I'm Spica. I write about design, writing and the tools behind them."
style: grid
featured: true
The greeting
intro is a short line of plain text in large type above the posts. It shows on the first page only. Leave it empty (intro: "") to hide it. The page still has a heading for screen readers and search engines: when there’s no greeting, a hidden heading with your site title is used instead.
Three styles
style sets how every list of posts looks, on the home page and on category pages.
| Style | What it looks like |
|---|---|
grid |
Cards with a picture, category, title, short excerpt and date. One column on phones, two on tablets and laptops, three on very wide screens. This is the demo’s look. |
list |
One post per row, with a small picture beside the title. On screens wider than a phone it also shows two lines of the excerpt. |
text |
Titles and dates only, with no pictures. The lightest of the three. |
Change the word, restart the server, and the site changes everywhere. The Tags page always uses the text style.
The featured post
spica:
home:
featured: true
Mark a post with featured: true in its front matter and the newest post marked that way becomes one large card at the top of the first page, with a “Featured” label. It isn’t repeated in the list below, but it still counts toward the number of posts on the page.
- With
style: text, there’s no large card, because the text style has no pictures. - Set
featured: falseto turn the card off. Posts keep theirfeatured: trueline. - With no post marked, there’s no large card.
Page numbers
paginate: 9
paginate_path: /page/:num/
These two lines, near the bottom of _config.yml, set how many posts one page lists (9) and the address of the next pages (/page/2/, /page/3/ and so on). With more posts than fit on one page, page numbers appear under the list, with Newer and Older buttons. Under one page of posts, nothing shows.
Page numbers come from the jekyll-paginate plugin, which works only in index.html. That’s why the home page isn’t an index.md. The greeting and the featured post show on the first page only.
The newsletter panel
At the bottom of the home page, and of each numbered page, sits a soft panel with a heading and an email field. It’s set by spica.newsletter:
provider: demo(the starting value) sends nothing.- A real provider and its
actionaddress makes it work. provider: noneremoves the panel.
See Newsletter and contact form. The panel appears only on the home page. To put the same form on another page, see that page.
Other pages built the same way
- Category pages use your home
style. See Writing posts. - The Archive (
/archive/) lists every post by year, one line each. - The Tags page (
/tags/) lists every tag, with its posts.
The words on these pages, such as the title and the line under it, are in each page’s front matter (archive.html, tags.html, projects.html).