Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display search for "pages" results #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions algolia/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,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