Skip to content

Commit

Permalink
Display search for "pages" results
Browse files Browse the repository at this point in the history
  • Loading branch information
ya-web committed Nov 20, 2018
1 parent 778cbb2 commit d26b4b7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 10 deletions.
24 changes: 15 additions & 9 deletions algolia/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,21 @@
]
],
// TODO: enable when ready
// [
// 'index_id' => 'pages',
// 'index_name' => ALGOLIA_PREFIX . 'pages',
// 'label' => __('Pages', 'telabotanica'),
// 'tmpl_suggestion' => 'autocomplete-post-suggestion',
// 'settings' => [
// 'hitsPerPage' => 5
// ]
// ]
[
'index_id' => 'pages',
'index_name' => ALGOLIA_PREFIX . 'pages',
'label' => __('Pages', 'telabotanica'),
'tmpl_suggestion' => 'autocomplete-post-suggestion',
'settings' => [
'hitsPerPage' => 5
],
'filters' => [
'post_type' => [
'type' => 'menu',
'label' => __('Par type de pages', 'telabotanica')
]
]
]
]
]
];
24 changes: 24 additions & 0 deletions modules/search-hit/search-hit-mixin.pug
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,27 @@ mixin search-hit-projets(data)
]
}
+card-project(itemData)

mixin search-hit-pages(data)
- var title = data._highlightResult.post_title.value
- var subtitle = data._highlightResult.post_subtitle.value
- var href = data.permalink
- var breadcrumbs = data.breadcrumb
- var part = data.part
- var text = data._snippetResult.post_content.value
.search-hit
ol.breadcrumbs-items
each link, label in breadcrumbs
li.breadcrumbs-item
a(href=link)= label
br
h3.search-hit-title
a(href=href)!= title
if subtitle
p.search-hit-text!= subtitle
else
br
if text
p.search-hit-content!= text
.search-hit-content
a(href=href)!= href
20 changes: 19 additions & 1 deletion modules/search-hit/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,26 @@
font-size: 1.2rem;
}

&-content {
font-weight:300;

a{
border-bottom: 0.1rem solid;
color: $turquoise-fonce;
font-weight: $regular;
text-decoration: none;
transition: background 0.2s ease;

&:hover,
&:focus {
background-color: transparentize($turquoise-fonce, 0.9);
}
}
}

&-text,
&-synonyms {
&-synonyms,
&-content {
line-height: 1.4;
margin-top: 0.4rem;
}
Expand Down

0 comments on commit d26b4b7

Please sign in to comment.