From 649764eda4c2e2c09621205e55eb4bbe354d9b95 Mon Sep 17 00:00:00 2001 From: Pat Dryburgh Date: Tue, 31 Jul 2018 09:16:19 -0700 Subject: [PATCH] add menu --- README.md | 31 ++++++++++++++++++++++++++----- _data/menu.yml | 0 _layouts/home.html | 35 +++++++++++++++++++++++++++-------- _layouts/post.html | 2 +- _sass/_article.scss | 15 +++++++++++---- _sass/_base.scss | 7 ++++++- _sass/_masthead.scss | 33 ++++++++++++++++++++++++++++++--- _sass/_mixins.scss | 2 +- about.md | 14 ++++++++++++++ 9 files changed, 116 insertions(+), 23 deletions(-) create mode 100644 _data/menu.yml create mode 100644 about.md diff --git a/README.md b/README.md index e613db6..cca56a5 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,31 @@ Or install it yourself as: ## Usage -TODO: Write usage instructions here. Describe your available layouts, includes, sass and/or assets. +### Home Layout + +The `home` layout presents a list of articles ordered chronologically. All articles are presented in one page, similar to a book's table of contents. + +The masthead of the home page is derived from the `title` and `description` set in your site's `_config.yml` file. + +#### Navigation + +To include navigation in your site's masthead: + +1. Create a `_data` directory in the root of your site. +2. Add a `menu.yml` file to the `_data` directory. +3. Use the following format to list your menu items: + +``` +- title: About + url: /about +``` + +Be sure to start your `url`s with a `/`. + + +### Post Layout + +A sparsely decorated layout designed to present long-form writing in a manner that's pleasing to read. ## Contributing @@ -38,10 +62,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/patdry To set up your environment to develop this theme, run `bundle install`. -Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal. - -When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled. -To add a custom directory to your theme-gem, please edit the regexp in `hitchens.gemspec` accordingly. +The theme is setup just like a normal Jekyll site. To test the theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using the theme. Add pages, documents, data, etc. like normal to test the theme's contents. As you make modifications to the theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal. ## License diff --git a/_data/menu.yml b/_data/menu.yml new file mode 100644 index 0000000..e69de29 diff --git a/_layouts/home.html b/_layouts/home.html index 04e5822..ec6ec9b 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -2,19 +2,38 @@ layout: default --- +{% assign menu = site.data.menu %} +
-

- {{ site.title }} -

-

- {{ site.description }} -

+ {% if site.title %} +

+ {{ site.title }} +

+ {% endif %} + {% if site.title %} +

+ {{ site.description }} +

+ {% endif %} + {% if menu %} + + {% endif %}
-

- Contents
+

+ Contents