From 56ae20eccd5087be88d573915e66aadbb87c714b Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 8 Mar 2017 16:07:22 -0500 Subject: [PATCH] Add layout documentation --- README.md | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e3a361c..799f81f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # WIP Basically Basic Jekyll Theme -Basically Basic is a [Jekyll theme](https://jekyllrb.com/docs/themes/) meant as a substitute for the default `jekyll new` theme --- [Minima](https://github.com/jekyll/minima). Conventions and features found in Minima are fully supported by **Basically Basic**, with a few enhancements here and there. +Basically Basic is a [Jekyll theme](https://jekyllrb.com/docs/themes/) meant as a substitute for the default `jekyll new` theme --- [Minima](https://github.com/jekyll/minima). Conventions and features found in Minima are fully supported by **Basically Basic**, with a few enhancements here and there: + +- Clean responsive design with six customizable variations +- About page layout +- Curriculum Vitæ/Resume layout powered by [JSON data](http://registry.jsonresume.org/) +- Disqus Comments and Google Analytics support +- SEO best practices via [Jekyll SEO Tag](https://github.com/jekyll/jekyll-seo-tag/) ## Table of Contents @@ -72,6 +78,48 @@ Break up the main listing of posts into smaller lists and display them over mult 3. Create `index.html` (or rename `index.md`) in the root of your project and add `layout: home` `paginate: true` to its YAML Front Matter. +### Author + +Author information is used as meta data for post "by lines" and propagates the `creator` field of Twitter summary cards with the following YAML Front Matter in `_config.yml`: + +```yaml +author: + name: John Doe + twitter: johndoetwitter + picture: /assets/images/johndoe.png +``` + +Site-wide author information can be overridden in a document's YAML Front Matter in the same way: + +```yaml +author: + name: Jane Doe + twitter: janedoetwitter + picture: /assets/images/janedoe.png +``` + +Or by specifying a corresponding key in the document's YAML Front Matter, that exists in `site.data.authors`. E.g., you have the following in the document's YAML Front Matter: + +```yaml +author: megaman +``` + +And you have the following in `_data/authors.yml`: + +```yaml +megaman: + name: Mega Man + twitter: megamantwitter + picture: /assets/images/megaman.png + +drlight: + name: Dr. Light + twitter: drlighttwitter + picture: /assets/images/drlight.png +``` + +Currently `author.picture` is only used in `layout: about`. Recommended size is `300 x 300` pixels. + ### Comments (via Disqus) Optionally, if you have a [Disqus](https://disqus.com/) account, you can show a comments section below each post. @@ -109,16 +157,77 @@ layout: name ### `layout: default` +This layout handles all of the basic page scaffolding placing the page content between the masthead and footer elements. All other layouts inherit this one and provide additional styling and features inside of the `{{ content }}` block. + ### `layout: post` +This layout accommodates the following YAML Front Matter: + +```yaml +# optional alternate title to replace page.title at the top of the page +alt_title: "Basically Basic" + +# optional sub-title below the page title +sub_title: "The name says it all" + +# optional intro text below titles, Markdown allowed +introduction: | + Basically Basic is a Jekyll theme meant to be a substitute for the default `jekyll new` theme --- [Minima](https://github.com/jekyll/minima). Conventions and features found in Minima are fully supported by **Basically Basic**. + +# optional call to action links +actions: + - label: "Learn More" + icon: github # references name of svg icon, see full list below + url: "http://url-goes-here.com" + - label: "Download" + icon: download # references name of svg icon, see full list below + url: "http://url-goes-here.com" + +image: # URL to an image associated with the post (e.g., /assets/page-pic.jpg) + +# post specific author data if different from what is set in _config.yml +author: + name: John Doe + twitter: johndoetwitter + +comments: false # disable comments on this post +``` + ### `layout: page` +Visually this layout looks and acts the same as `layout: post`, with two minor differences. + +- Author "by line" and publish date are omitted. +- Disqus comments are omitted. + ### `layout: home` +This layout accommodates the same YAML Front Matter as `layout: page`, with the addition of the following: + +```yaml +paginate: true # enables pagination loop, see section above for additional setup +``` + ### `layout: about` +This layout accommodates the same YAML Front Matter as `layout: page`, with the addition of the following to display an author picture: + +```yaml +author: + name: John Doe + picture /assets/images/johndoe.png +``` + +Recommended `picture` size is approximately `300 x 300` pixels. If `author` object is not explicitly set in the about page's YAML Front Matter the theme will default to the value set in `_config.yml`. + +If blank there no image will appear. + ### `layout: cv` +This layout accommodates the same YAML Front Matter as `layout: page`. It leverages a [JSON-based file standard](https://jsonresume.org/schema/) for resume data to conveniently render a curriculum vitæ or resume painlessly. + +Simply use JSON Resume's [in-browser resume builder](http://registry.jsonresume.org/) to export a JSON file and save to your project as `_data/cv.json`. + ## Customization The default structure, style, and scripts of this theme can be overridden and customized in the following two ways. @@ -172,6 +281,40 @@ To override the default JavaScript bundled in the theme, do one of the following - Copy the contents of [assets/javascripts/main.js](assets/javascripts/main.js) to ``. - Customize want you want inside `/assets/javascripts/main.js`. +### SVG Icons + +The theme uses social network logos and other iconography saved as SVGs for performance and flexibility. Said SVGs are located in the `_includes` directory and prefixed with `icon-`. Each icon has been sized and designed to fit a `16 x 16` viewbox and optimized with [SVGO](https://github.com/svg/svgo). + +Fill colors are defined in the `_sass/basically-basic/_icons.scss` partial and set with `.icon-name` where class name matches the corresponding icon. + +For example the Twitter icon is given a fill color of `#1da1f2` like so: + +```html + +``` + +Alongside the SVG assets, there are icon helper includes to aid in generating social network links. + +| Include Parameter | Description | Required | +| ----------------- | ---------------------------------| ----------------------- | +| `username` | Username on given social network | **Required** | +| `label` | Text used for hyperlink | Optional, defaults to `username` | + +For example, the following `icon-github.html` include: + +```liquid +{% include icon-github.html username=jekyll label='GitHub' %} +``` + +Will output the following HTML: + +```html + + + GitHub + +``` + ### Customizing Sidebar Content ---