Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Open WIN Community
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
open-science
community
Open WIN Community
Commits
d476ce57
Commit
d476ce57
authored
4 years ago
by
Silvio Giebl
Browse files
Options
Downloads
Patches
Plain Diff
Updated search.rake
parent
93f93f48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/tasks/search.rake
+14
-4
14 additions, 4 deletions
lib/tasks/search.rake
with
14 additions
and
4 deletions
lib/tasks/search.rake
+
14
−
4
View file @
d476ce57
...
@@ -12,8 +12,17 @@ namespace :search do
...
@@ -12,8 +12,17 @@ namespace :search do
permalink: /assets/js/search-data.json
permalink: /assets/js/search-data.json
---
---
{
{
{%- assign i = 0 -%}
{% assign i = 0 -%}
{% for page in site.html_pages %}
{%- assign pages_array = \'\' | split: \'\' -%}
{%- assign pages_array = pages_array | push: site.html_pages -%}
{%- if site.doc_collections -%}
{%- for doc_collection in site.doc_collections -%}
{%- assign collection = site[doc_collection.collection] -%}
{%- assign pages_array = pages_array | push: collection -%}
{%- endfor -%}
{%- endif -%}
{%- for pages in pages_array -%}
{%- for page in pages -%}
{%- if page.title and page.search_exclude != true -%}
{%- if page.title and page.search_exclude != true -%}
{%- assign page_content = page.content -%}
{%- assign page_content = page.content -%}
{%- assign heading_level = site.search.heading_level | default: 2 -%}
{%- assign heading_level = site.search.heading_level | default: 2 -%}
...
@@ -24,7 +33,7 @@ permalink: /assets/js/search-data.json
...
@@ -24,7 +33,7 @@ permalink: /assets/js/search-data.json
{%- endfor -%}
{%- endfor -%}
{%- assign parts = page_content | split: \'<h1\' -%}
{%- assign parts = page_content | split: \'<h1\' -%}
{%- assign title_found = false -%}
{%- assign title_found = false -%}
{% for part in parts offset: 1 %}
{%
-
for part in parts offset: 1
-
%}
{%- assign titleAndContent = part | split: \'</h1>\' -%}
{%- assign titleAndContent = part | split: \'</h1>\' -%}
{%- assign title = titleAndContent[0] | replace_first: \'>\', \'<h1>\' | split: \'<h1>\' -%}
{%- assign title = titleAndContent[0] | replace_first: \'>\', \'<h1>\' | split: \'<h1>\' -%}
{%- assign title = title[1] | strip_html -%}
{%- assign title = title[1] | strip_html -%}
...
@@ -64,7 +73,8 @@ permalink: /assets/js/search-data.json
...
@@ -64,7 +73,8 @@ permalink: /assets/js/search-data.json
{%- assign i = i | plus: 1 -%}
{%- assign i = i | plus: 1 -%}
{%- endunless -%}
{%- endunless -%}
{%- endif -%}
{%- endif -%}
{% endfor %}
{%- endfor -%}
{%- endfor %}
}'
}'
end
end
puts
'Done.'
puts
'Done.'
...
...
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