content updates
This commit is contained in:
@ -178,7 +178,7 @@ entries:
|
||||
version: all
|
||||
|
||||
- title: Links
|
||||
url: /doc_links.html
|
||||
url: /doc_hyperlinks.html
|
||||
audience: writers, designers
|
||||
platform: all
|
||||
product: all
|
||||
@ -285,7 +285,7 @@ entries:
|
||||
version: all
|
||||
|
||||
- title: iTerm profiles
|
||||
url: /iterm_profiles.html
|
||||
url: /doc_iterm_profiles.html
|
||||
audience: writers, designers
|
||||
platform: all
|
||||
product: all
|
||||
@ -392,7 +392,7 @@ entries:
|
||||
product: all
|
||||
|
||||
- title: Special layout pages
|
||||
url: /doc_special-layouts.html
|
||||
url: /doc_tag-special-layouts.html
|
||||
audience: writers, designers
|
||||
platform: all
|
||||
version: all
|
||||
|
@ -60,8 +60,8 @@
|
||||
{% capture doc_labels %}<a href="doc_labels.html">Labels</a>{% endcapture %}
|
||||
{% capture doc_labels_i %}<a href="doc_labels.html">{% endcapture %}
|
||||
|
||||
{% capture doc_links %}<a href="doc_links.html">Links</a>{% endcapture %}
|
||||
{% capture doc_links_i %}<a href="doc_links.html">{% endcapture %}
|
||||
{% capture doc_hyperlinks %}<a href="doc_hyperlinks.html">Links</a>{% endcapture %}
|
||||
{% capture doc_hyperlinks_i %}<a href="doc_hyperlinks.html">{% endcapture %}
|
||||
|
||||
|
||||
{% capture doc_navtabs %}<a href="doc_navtabs.html">Navtabs</a>{% endcapture %}
|
||||
|
@ -10,12 +10,15 @@
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
</script>
|
||||
{% if page.video == true and site.print == false %}
|
||||
{% unless site.print == true %}
|
||||
{% if page.video == true %}
|
||||
<link href="https://vjs.zencdn.net/4.12/video-js.css" rel="stylesheet">
|
||||
<script src="https://vjs.zencdn.net/4.12/video.js"></script>
|
||||
{% endif %}
|
||||
{% endunless %}
|
||||
|
||||
{% if page.datatable == true and site.print == false %}
|
||||
{% unless site.print == true %}
|
||||
{% if page.datatable == true %}
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.5/css/jquery.dataTables.css">
|
||||
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.5/js/jquery.dataTables.js"></script>
|
||||
<script>
|
||||
@ -28,6 +31,7 @@
|
||||
);
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endunless %}
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -50,7 +50,6 @@ defaults:
|
||||
values:
|
||||
layout: "page"
|
||||
comments: true
|
||||
search: true
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
@ -58,6 +57,5 @@ defaults:
|
||||
values:
|
||||
layout: "post"
|
||||
comments: true
|
||||
search: true
|
||||
|
||||
|
||||
|
@ -51,7 +51,6 @@ defaults:
|
||||
values:
|
||||
layout: "page"
|
||||
comments: true
|
||||
search: true
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
@ -59,6 +58,5 @@ defaults:
|
||||
values:
|
||||
layout: "post"
|
||||
comments: true
|
||||
search: true
|
||||
|
||||
|
||||
|
@ -98,6 +98,24 @@ Note that you have to specify the full condition each time. You can't shorten th
|
||||
|
||||
This won't work.
|
||||
|
||||
## Unless operator
|
||||
|
||||
You can also use `unless` in your logic, like this:
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% unless site.print == true %}
|
||||
...
|
||||
{% endunless %}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
When figuring out this logic, read it like this: "Run the code here *unless* this condition is satisfied." Or "If this condition is satisfied, don't run this code."
|
||||
|
||||
Don't read it the other way around or you'll get confused. (It's not executing the code only if the condition is satisfied.)
|
||||
|
||||
In this situation, if `site.print == true`, then the code will *not* be run here.
|
||||
|
||||
## Storing conditions in the \_data folder
|
||||
|
||||
Here's an example of using conditional logic based on a value in a data file:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,16 +8,14 @@ summary:
|
||||
---
|
||||
{% include linkrefs.html %}
|
||||
|
||||
By default, all files in your project are included in your output. To exclude files, note them in the `exclude` section in the configuration file. Here's a sample:
|
||||
By default, all files in your project are included in your output (regardless of whether they're listed in the sidebar_doc.yml file or not). To exclude files, note them in the `exclude` section in the configuration file. Here's a sample:
|
||||
|
||||
```
|
||||
|
||||
exclude:
|
||||
- "Gemfile"
|
||||
- "Gemfile.lock"
|
||||
- drafts
|
||||
- _site/documentation-theme-jekyll
|
||||
- doc_writers_*
|
||||
- bower_components
|
||||
- Gemfile
|
||||
```
|
||||
|
||||
If you have different outputs for your site, you'll want to customize the exclude sections in your various configuration files.
|
||||
@ -37,6 +35,7 @@ exclude:
|
||||
In your exclude list for your alpha project, specify it as follows:
|
||||
|
||||
```
|
||||
exclude:
|
||||
- beta_*
|
||||
```
|
||||
|
||||
@ -61,9 +60,16 @@ exclude:
|
||||
|
||||
- alpha_cpp_*
|
||||
- alpha_beta_*
|
||||
```
|
||||
|
||||
When you exclude folders, include the trailing slash at the end of the folder name:
|
||||
|
||||
There isn't a way to automatically exclude all folders. By default, everything is included unless you explicitly list it under the exclude section.
|
||||
```
|
||||
exclude:
|
||||
- images/alpha/
|
||||
```
|
||||
|
||||
There isn't a way to automatically exclude anything. By default, everything is included unless you explicitly list it under the exclude section.
|
||||
|
||||
## Excluding draft content
|
||||
|
||||
@ -71,4 +77,4 @@ If you're working on a draft, put it inside the \_drafts folder or add `publishe
|
||||
|
||||
## Limitations
|
||||
|
||||
What if a file should appear in two projects but not the third? This can get tricky. For some files, rather than using a wildcard, you may need to manually specify the entire filename that you're excluding instead of excluding it by way of pattern.
|
||||
What if a file should appear in two projects but not the third? This can get tricky. For some files, rather than using a wildcard, you may need to manually specify the entire filename that you're excluding instead of excluding it by way of a wildcard pattern.
|
@ -8,9 +8,8 @@ summary:
|
||||
---
|
||||
{% include linkrefs.html %}
|
||||
|
||||
If you want to use an FAQ format, use the syntax shown on the faq.html page.
|
||||
If you want to use an FAQ format, use the syntax shown on the faq.html page. Rather than including code samples here (which are bulky with a lot of nested `div` tags), just look at the source in the doc_faq.html theme file.
|
||||
|
||||
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
|
||||
|
||||
<div class="panel-group" id="accordion">
|
||||
<div class="panel panel-default">
|
||||
|
@ -370,25 +370,24 @@ To generate the PDF, you just run several scripts that have the commands package
|
||||
|
||||
## JavaScript conflicts
|
||||
|
||||
I've noticed that when I have JavaScript in my pages, sometimes Prince doesn't like this, as it tries to process the JavaScript. As a result, it will create an error like this in Terminal:
|
||||
If you have JavaScript on any of your pages, Prince will note errors in Terminal like this:
|
||||
|
||||
```
|
||||
error: TypeError: value is not an object
|
||||
```
|
||||
|
||||
It's better to conditionalize out any JavaScript from your PDF output before building your PDFs. If Prince encounters JavaScript on a page, it will give you this error:
|
||||
|
||||
```
|
||||
prince: http://127.0.0.1:4002/designers/doc_shuffle.html:2: error: TypeError: value is not an object
|
||||
```
|
||||
|
||||
However, the PDF will still build.
|
||||
|
||||
If you encounter this error, surround the JavaScript with conditional tags like this:
|
||||
You need to conditionalize out any JavaScript from your PDF web output before building your PDFs. Make sure that the PDF configuration files have the `print: true` property.
|
||||
|
||||
Then surround the JavaScript with conditional tags like this:
|
||||
|
||||
```
|
||||
{% raw %}
|
||||
{% unless site.print == false %} javascript content here ... {% endunless %}
|
||||
{% unless site.print == true %}
|
||||
javascript content here ...
|
||||
{% endunless %}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
For more detail about using `unless` in conditional logic, see {{doc_conditional_logic}}. What this code means is basically the opposite of `{% raw %}if site.print == true {% endraw %}`.
|
||||
|
@ -44,7 +44,7 @@ In your Jekyll project, create a new folder called "_tooltips" and put every pag
|
||||
|
||||
## 2. Create pages in your collection
|
||||
|
||||
Create pages inside your new tooltips collection. Each page needs only a unique `id` in the frontmatter. Here's an example:
|
||||
Create pages inside your new tooltips collection (that is, inside the \_tooltips folder). Each page needs only a unique `id` in the frontmatter. Here's an example:
|
||||
|
||||
{%raw%}
|
||||
```liquid
|
||||
@ -81,15 +81,15 @@ layout: none
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
This code will loop through all pages in the tooltips collection and insert the id and body into key-value pairs for the JSON code. Here's an example of what that looks like after it's process by Jekyll in the site build: <a target="_blank" title="ToolTip Demo" href="{{ "/tooltips.json" | prepend: site.baseurl }}">Tooltips</a>.
|
||||
This code will loop through all pages in the tooltips collection and insert the id and body into key-value pairs for the JSON code. Here's an example of what that looks like after it's processed by Jekyll in the site build: <a target="_blank" title="ToolTip Demo" href="{{ "/tooltips.json" | prepend: site.baseurl }}">Tooltips</a>.
|
||||
|
||||
{{tip}} Check out <a href="https://google-styleguide.googlecode.com/svn/trunk/jsoncstyleguide.xml">Google's style guide for JSON</a>. These best practices can help you keep your JSON file valid.{{end}}
|
||||
|
||||
Store this file in your root directory. You can add different fields depending on how you want the JSON to be structured. Here I just have to fields: `id` and `body`. And the JSON is looking just in the tooltips collection that I created.
|
||||
Store this tooltips.json file in your root directory. You can add different fields depending on how you want the JSON to be structured. Here I just have to fields: `id` and `body`. And the JSON is looking just in the tooltips collection that I created.
|
||||
|
||||
When you build your site, Jekyll will iterate through every page in your _tooltips folder and put the page id and body into this format.
|
||||
|
||||
You could create different JSON files that specialize in different content. For example, suppose you have some getting started information. You could put that into a different JSON file. Using the same structure, you might add an `if` tag that checks whether the page has frontmatter that says "getting_started: true" or something. Or you could put it into a separate collection entirely (different from tooltips).
|
||||
You could create different JSON files that specialize in different content. For example, suppose you have some getting started information. You could put that into a different JSON file. Using the same structure, you might add an `if` tag that checks whether the page has frontmatter that says `getting_started: true` or something. Or you could put it into a separate collection entirely (different from tooltips).
|
||||
|
||||
By chunking up your JSON files, you can provide a quicker lookup, though I'm not sure how big the JSON file can be before you experience any latency with the jQuery lookup.
|
||||
|
||||
@ -107,12 +107,14 @@ If your server setup allows htaccess files to override general server permission
|
||||
Header set Access-Control-Allow-Origin "*"
|
||||
```
|
||||
|
||||
Store this in the same directory as your project. This is what I've done in a directory on my web host (bluehost.com). Inside http://idratherbewriting.com/wp-content/apidemos/, I uploaded a file called htaccess with the preceding code. After I uploaded it, I renamed it to .htaccess, right-clicked the file and set the permissions to 774.
|
||||
Store this in the same directory as your project. This is what I've done in a directory on my web host (bluehost.com). Inside http://idratherbetellingstories.com/wp-content/apidemos/, I uploaded a file called ".htaccess" with the preceding code.
|
||||
|
||||
After I uploaded it, I renamed it to .htaccess, right-clicked the file and set the permissions to 774.
|
||||
|
||||
To test whether your server permissions are set correctly, open a terminal and run the following curl command pointing to your tooltips.json file:
|
||||
|
||||
```
|
||||
curl -I http://idratherbewriting.com/wp-content/apidemos/tooltips.json
|
||||
curl -I http://idratherbetellingstories.com/wp-content/apidemos/tooltips.json
|
||||
```
|
||||
|
||||
If the server permissions are set correctly, you should see the following line somewhere in the response:
|
||||
@ -140,6 +142,8 @@ In other server setups, you may need to edit one of your Apache configuration fi
|
||||
|
||||
If you don't have CORS enabled, users will see a CORS error/warning message in the console of the page making the request.
|
||||
|
||||
{{tip}} If enabling CORS is problematic, you could always just send developers the tooltips.json file and ask them to place it on their own server. {{end}}
|
||||
|
||||
## 5. Explain how developers can access the help
|
||||
|
||||
Developers can access the help using the `.get` method from jQuery, among other methods. Here's an example of how to get a page with the ID of `basketball`:
|
||||
@ -149,7 +153,7 @@ Developers can access the help using the `.get` method from jQuery, among other
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
var url = "{{site.baseurl}}/tooltips.json";
|
||||
var url = "{url}/tooltips.json";
|
||||
|
||||
|
||||
$.get( url, function( data ) {
|
||||
@ -167,9 +171,9 @@ $.get( url, function( data ) {
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
The `url` is where your tooltips.json file is. The `each` method looks through all the JSON content to find the item whose `page.id` is `basketball`. It then looks for an element on the page named `#basketball` and adds a `data-content` attribute to that element.
|
||||
The `{url}` is where your tooltips.json file is. The `each` method looks through all the JSON content to find the item whose `page.id` is equal to `basketball`. It then looks for an element on the page named `#basketball` and adds a `data-content` attribute to that element.
|
||||
|
||||
{{warning}}<b>Note:</b> Make sure your JSON file is valid. Otherwise, this method won't work. I use the <a href="https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en">JSON Formatter extension for Chrome</a>. When I go to the tooltips.json page in my browser, the JSON content -- if valid -- is nicely formatted (and includes some color coding). If the file isn't valid, it's not formatted and there isn't any color. You can also check the JSON formatting using <a href="http://jsonformatter.curiousconcept.com/">JSON Formatter and Validator</a>. If your JSON file isn't valid, identify the problem area using the validator and troubleshoot the file causing issues. It's usually due to some code that isn't escaping correctly. {{end}}
|
||||
{{warning}}<b>Note:</b> Make sure your JSON file is valid. Otherwise, this method won't work. I use the <a href="https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en">JSON Formatter extension for Chrome</a>. When I go to the tooltips.json page in my browser, the JSON content — if valid — is nicely formatted (and includes some color coding). If the file isn't valid, it's not formatted and there isn't any color. You can also check the JSON formatting using <a href="http://jsonformatter.curiousconcept.com/">JSON Formatter and Validator</a>. If your JSON file isn't valid, identify the problem area using the validator and troubleshoot the file causing issues. It's usually due to some code that isn't escaping correctly. {{end}}
|
||||
|
||||
Why `data-content`? Well, in this case, I'm using [Bootstrap popovers](http://getbootstrap.com/javascript/#popovers) to display the tooltip content. The `data-content` attribute is how Bootstrap injects popovers.
|
||||
|
||||
@ -197,7 +201,7 @@ $(document).ready(function(){
|
||||
});
|
||||
```
|
||||
|
||||
By the way, Bootstrap's popovers require you to initialize them using the above code -- they aren't turned on by default.
|
||||
Note that even though you reference a Bootstrap js script, Bootstrap's popovers require you to initialize them using the above code as well — they aren't turned on by default.
|
||||
|
||||
View the source code of the <a target="_blank" title="ToolTip Demo" href="{{ "/tooltip_demo.html" | prepend: site.baseurl }}">Tooltip Demo</a> for the full comments.
|
||||
|
||||
@ -206,7 +210,7 @@ View the source code of the <a target="_blank" title="ToolTip Demo" href="{{ "/t
|
||||
You might also want to insert the same content into different parts of your help site. For example, if you have tooltips providing definitions for fields, you'll probably want to create a page in your help that lists those same definitions. You could use the same method developers use to pull help content into their applications. But it will probably be easier to simply use Jekyll's tags for doing it.
|
||||
|
||||
|
||||
Here's a demo:
|
||||
Here's how you would reuse the content:
|
||||
|
||||
```html
|
||||
{% raw %}
|
||||
|
@ -2,7 +2,6 @@
|
||||
title: Links
|
||||
audience: writer, designer
|
||||
tags: [formatting, navigation]
|
||||
last_updated:
|
||||
summary:
|
||||
---
|
||||
{% include linkrefs.html %}
|
@ -26,6 +26,10 @@ When you're working with tech docs, a lot of times you're single sourcing multip
|
||||
6. In the Working Directory section, select **Directory** and enter the directory for your project, such as **/Users/tjohnson/projects/documentation-theme-jekyll**.
|
||||
7. Close the profiles panel.
|
||||
|
||||
Here's an example:
|
||||
|
||||

|
||||
|
||||
## Launching a profile
|
||||
|
||||
1. In iTerm, make sure the Toolbar is shown. Go to **View > Toggle Toolbar**.
|
||||
|
@ -9,7 +9,7 @@ metadata: false
|
||||
---
|
||||
{% include linkrefs.html %}
|
||||
|
||||
This shows a sample layout for a knowledge base. Each square could link to a tag archive page. In this example, font icons from Font Awesome are enlarged to a large size. You could also add captions below each icon, and so forth. In a real implementation, you would probably make your own square graphics that included the text inside them.
|
||||
This shows a sample layout for a knowledge base. Each square could link to a tag archive page. In this example, font icons from Font Awesome are enlarged to a large size. You can also add captions below each icon.
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4"><a href="doc_tag-getting-started.html"><i class="fa fa-file-image-o fa-6x border"></i><div class="kbCaption">Getting Started</div></a></div>
|
||||
@ -25,14 +25,15 @@ This shows a sample layout for a knowledge base. Each square could link to a tag
|
||||
|
||||
|
||||
|
||||
## Linking to non-tag archive pages
|
||||
## Generating a list of all pages with a certain tag
|
||||
|
||||
If you don't want to link to a tag archive index, you could link to a page with code like this:
|
||||
If you don't want to link to a tag archive index, but instead want to list all pages that have a certain tag, you could use this code:
|
||||
{% raw %}
|
||||
```html
|
||||
Getting started pages:
|
||||
<ul>
|
||||
{% for page in site.pages %}
|
||||
{% assign sorted_pages = (site.pages | sort: 'title') %}
|
||||
{% for page in sorted_pages %}
|
||||
{% for tag in page.tags %}
|
||||
{% if tag == "getting-started" %}
|
||||
<li><a href="{{page.url}}">{{page.title}}</a></li>
|
||||
@ -45,10 +46,9 @@ Getting started pages:
|
||||
|
||||
Getting started pages:
|
||||
|
||||
Here are all pages tagged with getting_started:
|
||||
|
||||
<ul>
|
||||
{% for page in site.pages %}
|
||||
{% assign sorted_pages = (site.pages | sort: 'title') %}
|
||||
{% for page in sorted_pages %}
|
||||
{% for tag in page.tags %}
|
||||
{% if tag == "getting-started" %}
|
||||
<li><a href="{{page.url}}">{{page.title}}</a></li>
|
||||
|
@ -11,16 +11,21 @@ summary: "You can push your build to AWS using commands from the command line."
|
||||
If you have the AWS Command Line Interface installed and are pushing your builds to AWS, the following commands show how you can build and push to an AWS location from the command line:
|
||||
|
||||
```
|
||||
#aws s3 cp ~/users/tjohnson/projects/documentation-theme-jekyll-builds/writer s3://[aws path]documentation-theme-jekyll/writer --recursive
|
||||
#aws s3 cp ~/users/tjohnson/projects/documentation-theme-jekyll-builds/doc_writers s3://[aws path]documentation-theme-jekyll/doc_writers --recursive
|
||||
|
||||
#aws s3 cp ~/users/tjohnson/projects/documentation-theme-jekyll-builds/designer s3://[aws path]/documentation-theme-jekyll/designer --recursive
|
||||
#aws s3 cp ~/users/tjohnson/projects/documentation-theme-jekyll-builds/doc_designers s3://[aws path]/documentation-theme-jekyll/doc_designers --recursive
|
||||
```
|
||||
|
||||
The first path is the local location; the second path is the destination.
|
||||
|
||||
## Pushing to a regular server
|
||||
|
||||
If you're pushing to a regular server that you can ssh into, you can use `scp` commands to push your build. Here's an example:
|
||||
|
||||
```
|
||||
scp -r /Applications/XAMPP/xamppfiles/htdocs/documentation-theme-jekyll/writers name@domain:/var/www/html/documentation-theme-jekyll/writers
|
||||
scp -r /users/tjohnson/projects/documentation-theme-jekyll-builds/doc_writers name@domain:/var/www/html/documentation-theme-jekyll/doc_writers
|
||||
```
|
||||
|
||||
Similar to the above, the first path is the local location; the second path is the destination.
|
||||
|
||||
|
||||
|
@ -7,7 +7,12 @@ tags: special-layouts
|
||||
{% include linkrefs.html %}
|
||||
|
||||
<p>This page demonstrates how you the integration of a script called ScrollTo, which is used here to link definitions of a JSON code sample to a list of definitions for that particular term. The scenario here is that the JSON blocks are really long, with extensive nesting and subnesting, which makes it difficult for tables below the JSON to adequately explain the term in a usable way.</p>
|
||||
{% unless site.print == false %}
|
||||
|
||||
{% if site.print == true %}
|
||||
{{note}} The content on this page doesn't display well on PDF, but I included it anyway so you could see the problems this layout poses if you're including it in PDF. {{end}}
|
||||
{% endif %}
|
||||
|
||||
{% unless site.print == true %}
|
||||
<script src="{{ "/js/jquery.scrollTo.min.js" | prepend:site.baseurl }}"></script>
|
||||
<!-- local scroll must come after scrollTo, because localScroll is based on scrollTo, which is based on jQuery -->
|
||||
<script src="{{ "/js/jquery.localScroll.min.js" | prepend:site.baseurl }}"></script>
|
||||
@ -32,7 +37,6 @@ $('#small-box-links').localScroll({
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endunless %}
|
||||
|
||||
<!-- documentation for localScroll function: http://flesler.blogspot.com/2007/10/jquerylocalscroll-10.html -->
|
||||
<style type="text/css">
|
||||
@ -114,7 +118,7 @@ $('#small-box-links').localScroll({
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
{% endunless %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
@ -230,6 +234,5 @@ $('#small-box-links').localScroll({
|
||||
</div> <!-- end row -->
|
||||
</div> <!-- end container -->
|
||||
|
||||
|
||||
|
||||
{{note}} This was mostly an experiment to see if there was a better way to document a long JSON code example. I haven't actually used this approach in my own documentation.{{end}}
|
||||
|
||||
|
@ -8,35 +8,17 @@ summary:
|
||||
---
|
||||
{% include linkrefs.html %}
|
||||
|
||||
The search is configured through the search.json file in the root directory. Take a look at that code if you want to change what content is included.
|
||||
The search is configured through the search.json file in the root directory. Take a look at that code if you want to change what fields are included.
|
||||
|
||||
The search is a simple search that looks at content in pages. It looks at both titles and bodies. However, the search doesn't work like google -- you can't hit return and see a list of results on the search results page, with the keywords in bold. Instead, this search shows a list of page titles that contain keyword matches. It's fast, but simple.
|
||||
The search is a simple search that looks at content in pages. It looks at titles, summaries, keywords, tags, and bodies.
|
||||
|
||||
However, the search doesn't work like google — you can't hit return and see a list of results on the search results page, with the keywords in bold. Instead, this search shows a list of page titles that contain keyword matches. It's fast, but simple.
|
||||
|
||||
## Excluding pages form search
|
||||
|
||||
By default, every page is included in the search. The configuration file specifies this default in the frontmatter of every page:
|
||||
By default, every page is included in the search. Depending on the type of content you're including, you may find that some pages will break the JSON formatting. If that happens, then the search will no longer work.
|
||||
|
||||
```json
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
type: "pages"
|
||||
values:
|
||||
layout: "page"
|
||||
comments: true
|
||||
search: true
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
type: "posts"
|
||||
values:
|
||||
layout: "post"
|
||||
comments: true
|
||||
search: true
|
||||
```
|
||||
|
||||
Some pages will break the JSON formatting. If that happens, then the search will no longer work. If you want to exclude a page from search add `search: exclude` in the frontmatter.
|
||||
If you want to exclude a page from search add `search: exclude` in the frontmatter.
|
||||
|
||||
## Troubleshooting search
|
||||
|
||||
@ -54,9 +36,9 @@ The search.json file already tries to strip out content that would otherwise mak
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
However, it's possible that the formatting may not account for all the scenarios that would invalidate the JSON. (Sometimes it's an extra comma after the last item that makes it invalid.)
|
||||
|
||||
However, it's possible that the formatting may not account for all the scenarios that would invalidate the JSON.
|
||||
|
||||
{% if site.audience == "designers" %}
|
||||
## Customizing search results
|
||||
|
||||
At some point, you may want to customize the search results more. Here's a little more detail that will be helpful. The search.json file retrieves various page values:
|
||||
@ -103,3 +85,4 @@ fuzzy: true,
|
||||
Where you see `{url}` and `{title}`, the search is retrieving the values for these as specified in the search.json file.
|
||||
|
||||
At some point, you may want to add in the `{summary}` as well. You could create a dedicated search page that could include the summary as an instant result as you type.
|
||||
{% endif %}
|
@ -6,7 +6,14 @@ keywords:
|
||||
summary:
|
||||
---
|
||||
{% include linkrefs.html %}
|
||||
{% unless site.print == false %}
|
||||
|
||||
This layout shows an example of a knowledge-base style navigation system, where there is no hierarchy, just groups of pages that have certain tags.
|
||||
|
||||
{% if site.print == true %}
|
||||
{{note}} The content on this page doesn't display well on PDF, but I included it anyway so you could see the problems this layout poses if you're including it in PDF. {{end}}
|
||||
{% endif %}
|
||||
|
||||
{% unless site.print == true %}
|
||||
<script src="js/jquery.shuffle.min.js"></script>
|
||||
<script src="js/jquery.ba-throttle-debounce.min.js"></script>
|
||||
{% endunless %}
|
||||
@ -96,6 +103,7 @@ summary:
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">Publishing</div>
|
||||
<div class="panel-body">
|
||||
<ul>
|
||||
{% for page in site.pages %}
|
||||
{% for tag in page.tags %}
|
||||
{% if tag == "publishing" %}
|
||||
@ -103,6 +111,7 @@ summary:
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -133,7 +142,10 @@ summary:
|
||||
|
||||
</div><!-- /#grid -->
|
||||
|
||||
{% unless site.print == true %}
|
||||
{% include initialize_shuffle.html %}
|
||||
|
||||
{% endunless %}
|
||||
|
||||
{{note}} This was mostly an experiment to see if there was a better way to document a long JSON code example. I haven't actually used this approach in my own documentation.{{end}}
|
||||
|
||||
|
||||
|
8682
doc_writers_pdf.pdf
8682
doc_writers_pdf.pdf
File diff suppressed because it is too large
Load Diff
BIN
images/itermexample.png
Normal file
BIN
images/itermexample.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 67 KiB |
Reference in New Issue
Block a user