diff --git a/algolia/config.php b/algolia/config.php index 5f8f9254..d9d64717 100644 --- a/algolia/config.php +++ b/algolia/config.php @@ -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') + ] + ] + ] ] ] ]; diff --git a/modules/search-hit/search-hit-mixin.pug b/modules/search-hit/search-hit-mixin.pug index 011c8560..82b86099 100644 --- a/modules/search-hit/search-hit-mixin.pug +++ b/modules/search-hit/search-hit-mixin.pug @@ -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 diff --git a/modules/search-hit/style.scss b/modules/search-hit/style.scss index 956662dc..c8a564f8 100644 --- a/modules/search-hit/style.scss +++ b/modules/search-hit/style.scss @@ -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; }