From eedf838d1f1f35116d9ad80abf6d5838f2f38e52 Mon Sep 17 00:00:00 2001 From: Fernando Ribeiro Date: Fri, 7 Oct 2016 21:45:59 +0100 Subject: [PATCH 01/13] add image helper for easier image insertion in posts --- _includes/image | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 _includes/image diff --git a/_includes/image b/_includes/image new file mode 100644 index 00000000..1c619bd7 --- /dev/null +++ b/_includes/image @@ -0,0 +1,14 @@ +{% include base_path %} + +
+ {% if include.alt %}{{ include.alt }}{% endif %} + {% if include.caption %} +
{{ include.caption | markdownify | remove: "

" | remove: "

" }}
+ {% endif %} +
From 6710cae9ef46f00a21681133f450f5dfa03d8d99 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Fri, 4 Nov 2016 14:05:59 -0400 Subject: [PATCH 02/13] Update docs --- docs/_docs/01-quick-start-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/01-quick-start-guide.md b/docs/_docs/01-quick-start-guide.md index 19be6b65..134ced3e 100644 --- a/docs/_docs/01-quick-start-guide.md +++ b/docs/_docs/01-quick-start-guide.md @@ -110,7 +110,7 @@ Scaffolding out a site with the `jekyll new` command requires you to modify a fe Edit `_config.yml` and create `_data/ui-text.yml` and `_data/navigation.yml` same as above. Then: -- Replace `/index.html` with a modified [Minimal Mistakes `index.html`](https://github.com/mmistakes/minimal-mistakes/blob/master/index.html). +- Replace `/index.md` with a modified [Minimal Mistakes `index.html`](https://github.com/mmistakes/minimal-mistakes/blob/master/index.html). Be sure to enable pagination if using the [`home` layout]({{ "/docs/layouts/#home-page" | absolute_url }}) by adding the necessary lines to **_config.yml**. - Change `layout: post` in `_posts/0000-00-00-welcome-to-jekyll.markdown` to `layout: single`. - Remove `about.md`, or at the very least change `layout: page` to `layout: single` and remove references to `icon-github.html` (or [copy to your `_includes`](https://github.com/jekyll/minima/tree/master/_includes) if using it). From 37d4eb8807465f964046680417dce9bd10060610 Mon Sep 17 00:00:00 2001 From: Fernando Ribeiro Date: Sat, 5 Nov 2016 21:27:59 +0000 Subject: [PATCH 03/13] Update image --- _includes/image | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/_includes/image b/_includes/image index 1c619bd7..fb8d9d23 100644 --- a/_includes/image +++ b/_includes/image @@ -1,11 +1,9 @@ -{% include base_path %} -
{% if include.alt %}{{ include.alt }}{% endif %} {% if include.caption %} From 637e5d99343cceeae9bd93cb0ea7231be5dcd10e Mon Sep 17 00:00:00 2001 From: Fernando Ribeiro Date: Sat, 5 Nov 2016 21:46:02 +0000 Subject: [PATCH 04/13] Replace base_path with `absolute_url` filter --- _includes/image | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/image b/_includes/image index fb8d9d23..63fe593d 100644 --- a/_includes/image +++ b/_includes/image @@ -3,7 +3,7 @@ {% if include.image_path contains "://" %} "{{ include.image_path }}" {% else %} - "{{ include.image_path | prepend: "/assets/images/" | prepend: absolute_url }}" + "{{ include.image_path | prepend: "/assets/images/" | absolute_url }}" {% endif %} alt="{% if include.alt %}{{ include.alt }}{% endif %}"> {% if include.caption %} From da9525974307e85bae3f4f676f7d20fc79541cfc Mon Sep 17 00:00:00 2001 From: Fernando Ribeiro Date: Tue, 8 Nov 2016 20:15:41 +0000 Subject: [PATCH 05/13] Do not assume images would be placed in `/assets/images/` In order to add an image to a post, just use the following syntax: {% include image image_path="/full/path/to/MyPostImage.png" caption="The optional image caption" %} or {% include image image_path="https://example.com/images/MyPostImage.png" caption="The optional image caption" alt="The optional alt text" %} --- _includes/image | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/image b/_includes/image index 63fe593d..da829e48 100644 --- a/_includes/image +++ b/_includes/image @@ -3,7 +3,7 @@ {% if include.image_path contains "://" %} "{{ include.image_path }}" {% else %} - "{{ include.image_path | prepend: "/assets/images/" | absolute_url }}" + "{{ include.image_path | absolute_url }}" {% endif %} alt="{% if include.alt %}{{ include.alt }}{% endif %}"> {% if include.caption %} From ce83d3d60e55afe343ffb073845ad7c881e0563f Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Sun, 13 Nov 2016 20:38:49 +0000 Subject: [PATCH 06/13] Add structured data markup for `itemprop="person"` in author-profile Adds schema.org data for image, name, homeLocation, url, email, and sameAs (for all the social media links). --- _includes/author-profile.html | 149 +++++++++++++++++++++++++++------- 1 file changed, 119 insertions(+), 30 deletions(-) diff --git a/_includes/author-profile.html b/_includes/author-profile.html index 97261f32..6b849a3f 100644 --- a/_includes/author-profile.html +++ b/_includes/author-profile.html @@ -1,5 +1,7 @@ {% if page.author and site.data.authors[page.author] %} - {% assign author = site.data.authors[page.author] %}{% else %}{% assign author = site.author %} + {% assign author = site.data.authors[page.author] %} +{% else %} + {% assign author = site.author %} {% endif %}
@@ -7,95 +9,182 @@ {% if author.avatar %}
{% if author.avatar contains "://" %} - {{ author.name }} + {{ author.name }} {% else %} - {{ author.name }} + {{ author.name }} {% endif %}
{% endif %}
-

{{ author.name }}

- {% if author.bio %}

{{ author.bio }}

{% endif %} +

{{ author.name }}

+ {% if author.bio %} +

+ {{ author.bio }} +

+ {% endif %}
From 61160d548f795d6bd965ca82ad0aa4a25e95e5b9 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 14 Nov 2016 19:56:35 -0400 Subject: [PATCH 07/13] Fixed improper formatting of some locales This was causing stack level too deep errors. --- _data/ui-text.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/_data/ui-text.yml b/_data/ui-text.yml index c423109b..da4bd210 100644 --- a/_data/ui-text.yml +++ b/_data/ui-text.yml @@ -342,14 +342,14 @@ zh: &DEFAULT_ZH comment_success_msg : "Thanks for your comment! It will show on the site once it has been approved." comment_error_msg : "Sorry, there was an error with your submission. Please make sure all required fields have been completed and try again." loading_label : "Loading..." - zh-CN: - <<: *DEFAULT_ZH - zh-HK: - <<: *DEFAULT_ZH - zh-SG: - <<: *DEFAULT_ZH - zh-TW: - <<: *DEFAULT_ZH +zh-CN: + <<: *DEFAULT_ZH +zh-HK: + <<: *DEFAULT_ZH +zh-SG: + <<: *DEFAULT_ZH +zh-TW: + <<: *DEFAULT_ZH # German / Deutsch # ----------------- From 33fe81992298348d26c50e2e0decffa8fd0be142 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Tue, 15 Nov 2016 09:36:22 -0500 Subject: [PATCH 08/13] Fix locales --- docs/_data/ui-text.yml | 68 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/docs/_data/ui-text.yml b/docs/_data/ui-text.yml index 21c31532..da4bd210 100644 --- a/docs/_data/ui-text.yml +++ b/docs/_data/ui-text.yml @@ -342,14 +342,66 @@ zh: &DEFAULT_ZH comment_success_msg : "Thanks for your comment! It will show on the site once it has been approved." comment_error_msg : "Sorry, there was an error with your submission. Please make sure all required fields have been completed and try again." loading_label : "Loading..." - zh-CN: - <<: *DEFAULT_ZH - zh-HK: - <<: *DEFAULT_ZH - zh-SG: - <<: *DEFAULT_ZH - zh-TW: - <<: *DEFAULT_ZH +zh-CN: + <<: *DEFAULT_ZH +zh-HK: + <<: *DEFAULT_ZH +zh-SG: + <<: *DEFAULT_ZH +zh-TW: + <<: *DEFAULT_ZH + +# German / Deutsch +# ----------------- +de: &DEFAULT_DE + page : "Seite" + pagination_previous : "Vorherige" + pagination_next : "Nächste" + breadcrumb_home_label : "Home" + breadcrumb_separator : "/" + toc_label : "Auf dieser Seite" + ext_link_label : "Direkter Link" + less_than : "weniger als" + minute_read : "Minuten zum lesen" + share_on_label : "Teilen auf" + meta_label : + tags_label : "Tags:" + categories_label : "Kategorien:" + date_label : "Aktualisiert:" + comments_label : "Hinterlassen sie einen Kommentar" + comments_title : "Kommentare" + more_label : "Mehr anzeigen" + related_label : "Ihnen gefällt vielleicht auch" + follow_label : "Folgen:" + feed_label : "Feed" + powered_by : "Powered by" + website_label : "Webseite" + email_label : "E-Mail" + recent_posts : "Aktuelle Beiträge" + undefined_wpm : "Undefinierter Parameter words_per_minute in _config.yml" + comment_form_info : "Ihre E-Mail Adresse wird nicht veröffentlicht. Benötigte Felder sind markiert" + comment_form_comment_label : "Kommentar" + comment_form_md_info : "Markdown wird unterstützt." + comment_form_name_label : "Name" + comment_form_email_label : "E-Mail Addresse" + comment_form_website_label : "Webseite (optional)" + comment_btn_submit : "Kommentar absenden" + comment_btn_submitted : "Versendet" + comment_success_msg : "Danke für ihren Kommentar! Er wird auf der Seite angezeigt, nachdem er geprüft wurde." + comment_error_msg : "Entschuldigung, es gab einen Fehler. Bitte füllen sie alle benötigten Felder aus und versuchen sie es erneut." + loading_label : "Lade..." +de-DE: + <<: *DEFAULT_DE +de-AT: + <<: *DEFAULT_DE +de-CH: + <<: *DEFAULT_DE +de-BE: + <<: *DEFAULT_DE +de-LI: + <<: *DEFAULT_DE +de-LU: + <<: *DEFAULT_DE # Another locale # -------------- From 749c780736b20922b86a8a2fdabd1f80f9d2cd2c Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Tue, 15 Nov 2016 12:12:14 -0500 Subject: [PATCH 09/13] Rename image helper to figure --- _includes/{image => figure} | 0 docs/_includes/figure | 12 ++++++++++++ 2 files changed, 12 insertions(+) rename _includes/{image => figure} (100%) create mode 100644 docs/_includes/figure diff --git a/_includes/image b/_includes/figure similarity index 100% rename from _includes/image rename to _includes/figure diff --git a/docs/_includes/figure b/docs/_includes/figure new file mode 100644 index 00000000..da829e48 --- /dev/null +++ b/docs/_includes/figure @@ -0,0 +1,12 @@ +
+ {% if include.alt %}{{ include.alt }}{% endif %} + {% if include.caption %} +
{{ include.caption | markdownify | remove: "

" | remove: "

" }}
+ {% endif %} +
From 554e8477a87819dfdb8053842b5ebc75e2ff8df5 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Tue, 15 Nov 2016 12:12:27 -0500 Subject: [PATCH 10/13] Document figure helper --- docs/_docs/14-helpers.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/docs/_docs/14-helpers.md b/docs/_docs/14-helpers.md index f30141b4..325b8b9b 100644 --- a/docs/_docs/14-helpers.md +++ b/docs/_docs/14-helpers.md @@ -30,7 +30,7 @@ feature_row: - image_path: /assets/images/unsplash-gallery-image-3-th.jpg title: "Placeholder 3" excerpt: "This is some sample content that goes here with **Markdown** formatting." -modified: 2016-11-03T11:15:48-04:00 +modified: 2016-11-15T12:11:48-05:00 --- {% include toc icon="gears" title="Helpers" %} @@ -64,6 +64,33 @@ The Liquid based taxonomy archives found amongst the demo pages rely on this hel [tag-array]: https://github.com/{{ site.repository }}/blob/master/docs/_pages/tag-archive.html [tag-array-demo]: {{ "/tags/" | absolute_url }} +## Figure + +Generate a `
` element with a single image and caption. + +| Include Parameter | Required | Description | +| ---- | -------- | ----------- | +| **image_path** | **Required** | Full path to image eg: `/assets/images/filename.jpg`. Use absolute URLS for those hosted externally. | +| **alt** | Optional | Alternate text for image. | +| **caption** | Optional | Figure caption text. Markdown is allowed. | + +Using the `figure` include like so: + +```liquid +{% raw %}{% include figure image_path="/assets/images/unsplash-image-10.jpg" alt="this is a placeholder image" caption="This is a figure caption." %}{% endraw %} +``` + +Will output the following: + +{% include figure image_path="/assets/images/unsplash-image-10.jpg" alt="this is a placeholder image" caption="This is a figure caption." %} + +```html +
+ this is a placeholder image +
This is a figure caption.
+
+``` + ## Gallery Generate a `
` element with optional caption of arrays with two or more images. @@ -73,7 +100,7 @@ To place a gallery add the necessary YAML Front Matter. | Name | Required | Description | | ---- | -------- | ----------- | | **url** | Optional | URL to link gallery image to (eg. a larger detail image). | -| **image_path** | **Required** | Full path to image eg: `assets/images/filename.jpg`. Use absolute URLS for those hosted externally. | +| **image_path** | **Required** | Full path to image eg: `/assets/images/filename.jpg`. Use absolute URLS for those hosted externally. | | **alt** | Optional | Alternate text for image. | | **title** | Optional | Title text for image. Will display as a caption in a Magnific Popup overlay when linked to a larger image with `url`. | @@ -120,7 +147,7 @@ To add a feature row containing three content blocks with text and image, add th | Name | Required | Description | Default | | ---- | ----------- | ----------- | ------- | -| **image_path** | **Required** | Full path to image eg: `assets/images/filename.jpg`. Use absolute URLS for those hosted externally. | | +| **image_path** | **Required** | Full path to image eg: `/assets/images/filename.jpg`. Use absolute URLS for those hosted externally. | | | **alt** | Optional | Alternate text for image. | | | **title** | Optional | Content block title. | | | **excerpt** | Optional | Content block excerpt text. Markdown is allowed. | | From 91afe6c2d81569eb57a3ffa278daa1e32fa8e8cb Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 16 Nov 2016 11:21:56 -0500 Subject: [PATCH 11/13] Add `rake preview` task for testing `/test` during theme development --- README.md | 6 ++++ Rakefile | 75 ++++++++++++++++++++++++++++++++++++++++++++++++ test/_config.yml | 6 ++-- 3 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 Rakefile diff --git a/README.md b/README.md index d070a9d2..84f7d316 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,12 @@ To help me out try to avoid creating pull requests on `master` and instead branc Theme documentation and demo pages can be found in the [`/docs`](docs) if submitting improvements, typo corrections, etc. +## Development + +To set up your environment to develop this theme, run `bundle install`. + +To test the theme, run `bundle exec rake preview` and open your browser at `http://localhost:4000/test/`. This starts a Jekyll server using your theme and the contents of the `test/` 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. + --- ## Credits diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..e50d89f8 --- /dev/null +++ b/Rakefile @@ -0,0 +1,75 @@ +require "bundler/gem_tasks" +require "jekyll" +require "listen" + +def listen_ignore_paths(base, options) + [ + /_config\.ya?ml/, + /_site/, + /\.jekyll-metadata/ + ] +end + +def listen_handler(base, options) + site = Jekyll::Site.new(options) + Jekyll::Command.process_site(site) + proc do |modified, added, removed| + t = Time.now + c = modified + added + removed + n = c.length + relative_paths = c.map{ |p| Pathname.new(p).relative_path_from(base).to_s } + print Jekyll.logger.message("Regenerating:", "#{relative_paths.join(", ")} changed... ") + begin + Jekyll::Command.process_site(site) + puts "regenerated in #{Time.now - t} seconds." + rescue => e + puts "error:" + Jekyll.logger.warn "Error:", e.message + Jekyll.logger.warn "Error:", "Run jekyll build --trace for more information." + end + end +end + +task :preview do + base = Pathname.new('.').expand_path + options = { + "source" => base.join('test').to_s, + "destination" => base.join('test/_site').to_s, + "force_polling" => false, + "serving" => true, + "theme" => "minimal-mistakes-jekyll" + } + + options = Jekyll.configuration(options) + + ENV["LISTEN_GEM_DEBUGGING"] = "1" + listener = Listen.to( + base.join("_includes"), + base.join("_layouts"), + base.join("_sass"), + base.join("assets"), + options["source"], + :ignore => listen_ignore_paths(base, options), + :force_polling => options['force_polling'], + &(listen_handler(base, options)) + ) + + begin + listener.start + Jekyll.logger.info "Auto-regeneration:", "enabled for '#{options["source"]}'" + + unless options['serving'] + trap("INT") do + listener.stop + puts " Halting auto-regeneration." + exit 0 + end + + loop { sleep 1000 } + end + rescue ThreadError + # You pressed Ctrl-C, oh my! + end + + Jekyll::Commands::Serve.process(options) +end diff --git a/test/_config.yml b/test/_config.yml index ee2135d3..8f614a4d 100644 --- a/test/_config.yml +++ b/test/_config.yml @@ -14,7 +14,7 @@ title_separator : "-" name : "Your Name" description : "Minimal Mistakes theme test." url : # the base hostname & protocol for your site e.g. "https://mmistakes.github.io" -baseurl : # the subpath of your site, e.g. "/blog" +baseurl : "/test" repository : # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes" teaser : # path of fallback teaser image, e.g. "/assets/images/500x300.png" # breadcrumbs : false # true, false (default) @@ -57,7 +57,7 @@ yandex_site_verification : # Social Sharing twitter: - username : + username : "mmistakes" facebook: username : app_id : @@ -102,7 +102,7 @@ author: stackoverflow : # "123456/username" (the last part of your profile url, e.g. http://stackoverflow.com/users/123456/username) steam : tumblr : - twitter : + twitter : "mmistakes" vine : weibo : xing : From 8d016a51741de71ec26f8fe01908060fcbf4c97b Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 16 Nov 2016 11:40:28 -0500 Subject: [PATCH 12/13] Update CHANGELOG.md and history --- CHANGELOG.md | 16 ++++++++++++++++ docs/_docs/18-history.md | 18 +++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bcd035a..3e4e1209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## [4.0.6](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.0.6) + +### Enhancements + +- Add [`figure` helper](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#figure) to make generating a `
` element with a single image and caption easier. [#572](https://github.com/mmistakes/minimal-mistakes/pull/572) +- Add structured data markup for `itemprop="person"` in author profile sidebar. [#647](https://github.com/mmistakes/minimal-mistakes/pull/647) + +### Bug Fixes + +- Fix improper YAML formatting of some locales. [#651](https://github.com/mmistakes/minimal-mistakes/pull/651) + +### Maintenance + +- Clarify "migrating to gem-theme" instructions in **Quick Start Guide**. +- Add `rake preview` task for testing `/test` during theme development. + ## [4.0.5](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.0.5) ### Enhancements diff --git a/docs/_docs/18-history.md b/docs/_docs/18-history.md index dc1512da..20330adc 100644 --- a/docs/_docs/18-history.md +++ b/docs/_docs/18-history.md @@ -4,9 +4,25 @@ permalink: /docs/history/ excerpt: "Change log of enhancements and bug fixes made to the theme." sidebar: nav: docs -modified: 2016-11-04T12:36:05-04:00 +modified: 2016-11-16T11:40:00-05:00 --- +## [4.0.6](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.0.6) + +### Enhancements + +- Add [`figure` helper](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#figure) to make generating a `
` element with a single image and caption easier. [#572](https://github.com/mmistakes/minimal-mistakes/pull/572) +- Add structured data markup for `itemprop="person"` in author profile sidebar. [#647](https://github.com/mmistakes/minimal-mistakes/pull/647) + +### Bug Fixes + +- Fix improper YAML formatting of some locales. [#651](https://github.com/mmistakes/minimal-mistakes/pull/651) + +### Maintenance + +- Clarify "migrating to gem-theme" instructions in **Quick Start Guide**. +- Add `rake preview` task for testing `/test` during theme development. + ## [4.0.5](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.0.5) ### Enhancements From 85f80a1c0f0a3e4893beaffb48ac9257cec000fb Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 16 Nov 2016 11:43:32 -0500 Subject: [PATCH 13/13] Bump version to 4.0.6 --- docs/_pages/home.md | 2 +- minimal-mistakes-jekyll.gemspec | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_pages/home.md b/docs/_pages/home.md index fee47dcc..663abe12 100644 --- a/docs/_pages/home.md +++ b/docs/_pages/home.md @@ -7,7 +7,7 @@ header: cta_label: " Install Now" cta_url: "/docs/quick-start-guide/" caption: -excerpt: 'A flexible two-column Jekyll theme. Perfect for personal sites, blogs, and portfolios hosted on GitHub or your own server.
Latest release v4.0.5

{::nomarkdown} {:/nomarkdown}' +excerpt: 'A flexible two-column Jekyll theme. Perfect for personal sites, blogs, and portfolios hosted on GitHub or your own server.
Latest release v4.0.6

{::nomarkdown} {:/nomarkdown}' feature_row: - image_path: /assets/images/mm-customizable-feature.png alt: "customizable" diff --git a/minimal-mistakes-jekyll.gemspec b/minimal-mistakes-jekyll.gemspec index 858d6b0d..77125d9a 100644 --- a/minimal-mistakes-jekyll.gemspec +++ b/minimal-mistakes-jekyll.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "minimal-mistakes-jekyll" - spec.version = "4.0.5" + spec.version = "4.0.6" spec.authors = ["Michael Rose"] spec.summary = %q{A flexible two-column Jekyll theme.} diff --git a/package.json b/package.json index 963e5e65..120db144 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minimal-mistakes", - "version": "4.0.5", + "version": "4.0.6", "description": "Minimal Mistakes Jekyll theme npm build scripts", "repository": { "type": "git",