Finishing search engine.
This commit is contained in:
parent
5d63629264
commit
37b26db84b
@ -80,7 +80,7 @@ function onSearchChange() {
|
||||
}
|
||||
|
||||
function showResults(searchResults, searchObjects) {
|
||||
searchObjects.innerHTML = "";
|
||||
searchResults.innerHTML = "";
|
||||
for (let searchObject of searchObjects) {
|
||||
const searchResultContainer = document.createElement('div')
|
||||
searchResultContainer.classList.add('search-result')
|
||||
|
@ -42,7 +42,7 @@ sub _index_categories ( $self, $index, $categories ) {
|
||||
my $slug = $category->{slug};
|
||||
my $url = "/$slug";
|
||||
my $content =
|
||||
Mojo::DOM->new( '<html>' . $category->{description} . '</html>' )->all_text;
|
||||
Mojo::DOM->new( '<html>' . $category->{description} =~ s/\s+/ /gr . '</html>' )->all_text;
|
||||
my $title = $category->{title};
|
||||
my $attributes = $category->{attributes};
|
||||
$self->_index_attributes($index, $slug, $attributes);
|
||||
@ -65,7 +65,7 @@ sub _index_attributes($self, $index, $category_slug, $attributes) {
|
||||
my $content = Mojo::DOM->new( '<html>' . $attribute->{description} . '</html>' )->all_text;
|
||||
push @$index, {
|
||||
title => $title,
|
||||
content => $content,
|
||||
content => $content =~ s/\s+/ /gr,
|
||||
url => $url,
|
||||
};
|
||||
}
|
||||
@ -86,7 +86,7 @@ sub _index_posts ( $self, $index, $posts ) {
|
||||
{
|
||||
title => $title,
|
||||
author => $author,
|
||||
content => $content,
|
||||
content => $content =~ s/\s+/ /gr,
|
||||
url => $url,
|
||||
urlImage => $urlImage,
|
||||
};
|
||||
|
@ -9,6 +9,7 @@ body {
|
||||
width: 100%;
|
||||
height: 100%; }
|
||||
body div.search-overlay {
|
||||
overflow-y: scroll;
|
||||
display: none;
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
|
@ -15,6 +15,7 @@ html {
|
||||
|
||||
body {
|
||||
div.search-overlay {
|
||||
overflow-y: scroll;
|
||||
display: none;
|
||||
position: fixed;
|
||||
height: 100%;
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user