From 8a0f37d9138c5876442557e2cf776f8fc34e43a2 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Thu, 2 Nov 2017 11:02:48 -0700 Subject: [PATCH] fix issue with apostrophes in titles --- _includes/topnav.html | 2 +- index.md | 2 +- js/jekyll-search.js | 2 +- pages/mydoc/mydoc_about.md | 4 ++-- pages/mydoc/mydoc_search_configuration.md | 5 +++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/_includes/topnav.html b/_includes/topnav.html index e3d4d2c..5acf50c 100644 --- a/_includes/topnav.html +++ b/_includes/topnav.html @@ -66,7 +66,7 @@ searchInput: document.getElementById('search-input'), resultsContainer: document.getElementById('results-container'), dataSource: '{{ "search.json" }}', - searchResultTemplate: '
  • {title}
  • ', + searchResultTemplate: '
  • {title}
  • ', noResultsText: '{{site.data.strings.search_no_results_text}}', limit: 10, fuzzy: true, diff --git a/index.md b/index.md index fa9d36d..d2df97e 100644 --- a/index.md +++ b/index.md @@ -1,5 +1,5 @@ --- -title: Getting started with the Documentation Theme for Jekyll +title: "Getting started with the Documentation's Theme for Jekyll" keywords: sample homepage tags: [getting_started] sidebar: mydoc_sidebar diff --git a/js/jekyll-search.js b/js/jekyll-search.js index 04d6a0d..d884a24 100644 --- a/js/jekyll-search.js +++ b/js/jekyll-search.js @@ -1 +1 @@ -!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o=0}var self=this;self.matches=function(string,crit){return"string"!=typeof string?!1:(string=string.trim(),doMatch(string,crit))}}module.exports=new LiteralSearchStrategy},{}],4:[function(require,module){module.exports=function(){function findMatches(store,crit,strategy){for(var data=store.get(),i=0;i{title}',noResultsText:"No results found",limit:10,fuzzy:!1};self.init=function(_opt){validateOptions(_opt),assignOptions(_opt),isJSON(opt.dataSource)?initWithJSON(opt.dataSource):initWithURL(opt.dataSource)}}var Searcher=require("./Searcher"),Templater=require("./Templater"),Store=require("./Store"),JSONLoader=require("./JSONLoader"),searcher=new Searcher,templater=new Templater,store=new Store,jsonLoader=new JSONLoader;window.SimpleJekyllSearch=new SimpleJekyllSearch}(window,document)},{"./JSONLoader":1,"./Searcher":4,"./Store":5,"./Templater":6}]},{},[7]); \ No newline at end of file +!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o=0}var self=this;self.matches=function(string,crit){return"string"!=typeof string?!1:(string=string.trim(),doMatch(string,crit))}}module.exports=new LiteralSearchStrategy},{}],4:[function(require,module){module.exports=function(){function findMatches(store,crit,strategy){for(var data=store.get(),i=0;i{title}',noResultsText:"No results found",limit:10,fuzzy:!1};self.init=function(_opt){validateOptions(_opt),assignOptions(_opt),isJSON(opt.dataSource)?initWithJSON(opt.dataSource):initWithURL(opt.dataSource)}}var Searcher=require("./Searcher"),Templater=require("./Templater"),Store=require("./Store"),JSONLoader=require("./JSONLoader"),searcher=new Searcher,templater=new Templater,store=new Store,jsonLoader=new JSONLoader;window.SimpleJekyllSearch=new SimpleJekyllSearch}(window,document)},{"./JSONLoader":1,"./Searcher":4,"./Store":5,"./Templater":6}]},{},[7]); diff --git a/pages/mydoc/mydoc_about.md b/pages/mydoc/mydoc_about.md index c6edad5..7c35791 100644 --- a/pages/mydoc/mydoc_about.md +++ b/pages/mydoc/mydoc_about.md @@ -1,5 +1,5 @@ --- -title: About the theme author +title: About the theme's author keywords: documentation theme, jekyll, technical writers, help authoring tools, hat replacements last_updated: July 3, 2016 tags: [getting_started] @@ -9,7 +9,7 @@ permalink: mydoc_about.html folder: mydoc --- -My name is Tom Johnson, and I'm a technical writer, blogger, and podcaster based in San Jose, California. My blog is here: [http://idratherbewriting.com](http://idratherbewriting.com). I write several posts there a week. See [my blog's about page](http://idratherbewriting.com/aboutme/) for more details about me. +My name is Tom Johnson, and I'm a technical writer, blogger, and podcaster based in San Jose, California. For more details, see my [technical writing blog](http://idratherbewriting.com) and my [course on API documentation](http://idratherbewriting.com/learnapidoc/). See [my blog's about page](http://idratherbewriting.com/aboutme/) for more details about me. I have used this theme and variations of it for various documentation projects. This theme has undergone several major iterations, and now it's fairly stable and full of all the features that I need. You are welcome to use it for your documentation projects for free. diff --git a/pages/mydoc/mydoc_search_configuration.md b/pages/mydoc/mydoc_search_configuration.md index 0107493..8b99617 100644 --- a/pages/mydoc/mydoc_search_configuration.md +++ b/pages/mydoc/mydoc_search_configuration.md @@ -31,7 +31,8 @@ If this happens, go directly to the search.json file in your browser, and then c The search.json file already tries to strip out content that would otherwise make the JSON invalid. ## Including the body field in search -I've found that include the `body` field in the search creates too many problems, and so I've removed `body` from the search. You can see the results of including the `body` by adding this along with the other fields in search.json: + +I've found that including the `body` field in the search creates too many problems, and so I've removed `body` from the search. You can see the results of including the `body` by adding this along with the other fields in search.json: {% raw %} ```json @@ -114,6 +115,6 @@ Where you see `{url}` and `{title}`, the search is retrieving the values for the ## More robust search -For more robust search, consider integrating either [Algolia](http://algolia.com) or [Swifttype](http://swiftype.com). +Overall, the built-in search only works for small documentation projects. If you have more robust search needs, consider integrating [Google Custom Search](https://cse.google.com/cse/), [Algolia](http://algolia.com), or [Swifttype](http://swiftype.com). {% include links.html %}