Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Community Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bio-IT
Community Documentation
Commits
793ea356
Commit
793ea356
authored
6 years ago
by
EricFromCanada
Browse files
Options
Downloads
Patches
Plain Diff
Use `unless` loop for comma
and mention `search_exclude`
parent
71ba32e1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
assets/js/search-data.json
+1
-1
1 addition, 1 deletion
assets/js/search-data.json
docs/search.md
+2
-2
2 additions, 2 deletions
docs/search.md
lib/tasks/search.rake
+2
-2
2 additions, 2 deletions
lib/tasks/search.rake
with
5 additions
and
5 deletions
assets/js/search-data.json
+
1
−
1
View file @
793ea356
...
...
@@ -7,6 +7,6 @@
"content"
:
"{{ page.content | newline_to_br | replace: '<br />', ' ' | replace: '</h1>', ' ' | 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
%
},{
%
end
if
%
}
}{
%
unless
forloop.last
%
},{
%
end
unless
%
}
{
%
endif
%
}{
%
endfor
%
}
}
This diff is collapsed.
Click to expand it.
docs/search.md
+
2
−
2
View file @
793ea356
...
...
@@ -37,13 +37,13 @@ This command creates the `search-data.json` file that Jekyll uses to create your
{%
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 %}{% e
lse
%}
,
}{%
unless
forloop.last %}
,
{% e
ndunless
%}
{% endif %}{% endfor %}
}
{%
endraw
%}
```
...
...
This diff is collapsed.
Click to expand it.
lib/tasks/search.rake
+
2
−
2
View file @
793ea356
...
...
@@ -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 }}",
"content": "'
+
content
+
'",
"url": "{{ page.url | absolute_url | xml_escape }}",
"relUrl": "{{ page.url | xml_escape }}"
}{%
if
forloop.last %}{% e
lse
%}
,
}{%
unless
forloop.last %}
,
{% e
ndunless
%}
{% endif %}{% endfor %}
}'
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment