diff --git a/assets/js/search-data.json b/assets/js/search-data.json index 12de52214628d..49cbc9dcbc2ee 100644 --- a/assets/js/search-data.json +++ b/assets/js/search-data.json @@ -3,10 +3,10 @@ { {% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": { "id": "{{ forloop.index0 }}", - "title": "{{ page.title | xml_escape }}", - "content": "{{ page.content | newline_to_br | replace: '
', ' ' | replace: '', ' ' | strip_newlines | markdownify | strip_html | remove: 'Table of contents' | xml_excape | escape | replace: '\', ' ' | replace: '```', '' | replace: ' ', ' ' | replace: ' ', ' ' | remove: '---' | remove: '#####' | remove: '####' | remove: '###' | remove: '##' | strip_newlines }}", - "url": "{{ page.url | absolute_url | xml_escape }}", - "relUrl": "{{ page.url | xml_escape }}" - }{% if forloop.last %}{% else %},{% endif %} + "title": "{{ page.title | replace: '&', '&' }}", + "content": "{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | normalize_whitespace }}", + "url": "{{ page.url | absolute_url }}", + "relUrl": "{{ page.url }}" + }{% unless forloop.last %},{% endunless %} {% endif %}{% endfor %} } diff --git a/docs/configuration.md b/docs/configuration.md index fcab4953165db..64b23f1a26399 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -6,18 +6,18 @@ nav_order: 2 # Configuration -Just the Docs has some specific configuration parameters that can be definied in your Jekyll site's `_config.yml` file. +Just the Docs has some specific configuration parameters that can be defined in your Jekyll site's `_config.yml` file. ## Search enabled -```yml +```yaml # Enable or disable the site search search_enabled: true ``` ## Aux links -```yml +```yaml # Aux links for the upper right navigation aux_links: "Just the Docs on GitHub": @@ -26,7 +26,7 @@ aux_links: ## Color scheme -```yml +```yaml # Color scheme currently only supports "dark" or nil (default) color_scheme: "dark" ``` diff --git a/docs/customization.md b/docs/customization.md index 74c153c0bff7f..f3fe1c036d6bb 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -28,7 +28,7 @@ To enable a color scheme, set the `color_scheme` parameter in your site's `_conf #### Example {: .no_toc } -```yml +```yaml # Color scheme currently only supports "dark" or nil (default) color_scheme: "dark" ``` @@ -68,6 +68,6 @@ $link-color: $blue-000; // ... ``` -_Note:_ Editing the variables directly in `_sass/support/variables.scss` is not recommended and can cause other dependancies to fail. +_Note:_ Editing the variables directly in `_sass/support/variables.scss` is not recommended and can cause other dependencies to fail. --- diff --git a/docs/navigation-structure.md b/docs/navigation-structure.md index 8a72e5ba0cf3a..98107cfcc3807 100644 --- a/docs/navigation-structure.md +++ b/docs/navigation-structure.md @@ -200,7 +200,7 @@ To add a auxiliary navigation item to your site (in the upper right on all pages #### Example {: .no_toc } -```yml +```yaml # Aux links for the upper right navigation aux_links: "Just the Docs on GitHub": diff --git a/docs/search.md b/docs/search.md index 24afcd1bc0479..134e3997bccdc 100644 --- a/docs/search.md +++ b/docs/search.md @@ -33,17 +33,17 @@ $ bundle exec just-the-docs rake search:init This command creates the `search-data.json` file that Jekyll uses to create your search index. Alternatively, you can create the file manually in the `assets/js/` directory of your Jekyll site with this content: -```{% raw %} ---- +```liquid +{% raw %}--- --- { - {% for page in site.html_pages %}"{{ forloop.index0 }}": { + {% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": { "id": "{{ forloop.index0 }}", - "title": "{{ page.title | xml_escape }}", - "content": "{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | remove: page.title | strip_newlines | replace: '\', ' '}}", - "url": "{{ page.url | absolute_url | xml_escape }}", - "relUrl": "{{ page.url | xml_escape }}" - }{% if forloop.last %}{% else %}, + "title": "{{ page.title | replace: '&', '&' }}", + "content": "{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | normalize_whitespace }}", + "url": "{{ page.url | absolute_url }}", + "relUrl": "{{ page.url }}" + }{% unless forloop.last %},{% endunless %} {% endif %}{% endfor %} }{% endraw %} ``` @@ -54,7 +54,7 @@ _Note: If you don't run this rake command or create this file manually, search w In your site's `_config.yml`, enable search: -```yml +```yaml # Enable or disable the site search search_enabled: true ``` diff --git a/just-the-docs.gemspec b/just-the-docs.gemspec index 7a0260377a8f9..aba1bb57f3519 100644 --- a/just-the-docs.gemspec +++ b/just-the-docs.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |spec| spec.authors = ["Patrick Marsceill"] spec.email = ["patrick.marsceill@gmail.com"] - spec.summary = %q{A nice looking, high customizable, responsive Jekyll theme for documention with built-in search.} + spec.summary = %q{A nice looking, highly customizable, responsive Jekyll theme for documentation with built-in search.} spec.homepage = "https://github.com/pmarsceill/just-the-docs" spec.license = "MIT" diff --git a/lib/tasks/search.rake b/lib/tasks/search.rake index 02d0b5e421b94..50ef275c3ec4d 100644 --- a/lib/tasks/search.rake +++ b/lib/tasks/search.rake @@ -4,7 +4,7 @@ namespace :search do puts 'Creating search data json file...' mkdir_p 'assets/js' touch 'assets/js/search-data.json' - content = %Q[{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | strip_newlines | replace: '\\', ' ' }}] + content = %Q[{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\\', ' ' | normalize_whitespace }}] puts 'Done.' puts 'Generating content...' @@ -12,13 +12,13 @@ namespace :search do f.puts '--- --- { - {% for page in site.html_pages %}"{{ forloop.index0 }}": { + {% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": { "id": "{{ forloop.index0 }}", - "title": "{{ page.title | xml_escape }}", + "title": "{{ page.title | replace: '&', '&' }}", "content": "'+content+'", - "url": "{{ page.url | absolute_url | xml_escape }}", - "relUrl": "{{ page.url | xml_escape }}" - }{% if forloop.last %}{% else %}, + "url": "{{ page.url | absolute_url }}", + "relUrl": "{{ page.url }}" + }{% unless forloop.last %},{% endunless %} {% endif %}{% endfor %} }' end