Skip to content

Commit

Permalink
Include the search language in site config
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Jan 12, 2024
1 parent d73e7c6 commit b39a5a7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
13 changes: 8 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ url: "https://quarkus.io" # the base hostname & protocol for your site, e.g. htt
twitter_username: quarkusio
github_username: quarkusio
github_fork_url: "https://github.com/quarkusio/quarkus"
# The language code for this website, used in particular for search.quarkus.io.
# See https://github.com/quarkusio/search.quarkus.io/blob/main/src/main/java/io/quarkus/search/app/entity/Language.java
language: en
search:
# The minimum number of characters before we run a full search.
# Below this:
# - if another filter is selected (e.g. categories), we run Javascript search
# - otherwise, we don't run search and just display all guides
min-chars: 2
# The URL of the remote search service
url: "https://search.quarkus.io/"
# The amount of time before we give up on a pending remote search and fall back to Javascript search.
Expand All @@ -44,6 +42,11 @@ search:
# while the user is reading through it!
# This we set a higher timeout value, to make timeouts less likely.
more-timeout: 2500
# The minimum number of characters before we run a full search.
# Below this:
# - if another filter is selected (e.g. categories), we run Javascript search
# - otherwise, we don't run search and just display all guides
min-chars: 2

# Build settings
error_mode: strict
Expand Down
5 changes: 3 additions & 2 deletions _includes/index-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

<div id="guides-app"
data-search-api-server="{{ site.search.url }}"
data-quarkus-version="{{ docversion }}"
data-language="{{ site.language }}"
data-initial-timeout="{{ site.search.initial-timeout }}"
data-more-timeout="{{ site.search.more-timeout }}"
data-min-chars="{{ site.search.min-chars }}"
data-quarkus-version="{{ docversion }}">
data-min-chars="{{ site.search.min-chars }}">
<section class="full-width-version-bg flexfilterbar">
<div class="flexcontainer">
<div class="flexlabel">
Expand Down
5 changes: 3 additions & 2 deletions _includes/index-guides.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

<div id="guides-app"
data-search-api-server="{{ site.search.url }}"
data-quarkus-version="{{ docversion }}"
data-language="{{ site.language }}"
data-initial-timeout="{{ site.search.initial-timeout }}"
data-more-timeout="{{ site.search.more-timeout }}"
data-min-chars="{{ site.search.min-chars }}"
data-quarkus-version="{{ docversion }}">
data-min-chars="{{ site.search.min-chars }}">
<section class="full-width-version-bg flexfilterbar">
<div class="flexcontainer">
<div class="search">
Expand Down
6 changes: 4 additions & 2 deletions assets/javascript/guides-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ const appElement = document.querySelector(appSelector);
const app = createApp({
props: {
searchApiServer: String,
quarkusVersion: String,
language: String,
initialTimeout: Number,
moreTimeout: Number,
minChars: Number,
quarkusVersion: String
minChars: Number
},
data() {
return {
Expand Down Expand Up @@ -188,6 +189,7 @@ const app = createApp({
const queryParams = {
page: this.search.page,
version: this.quarkusVersion,
language: this.language,
contentSnippets: 2,
contentSnippetsLength: 120,
highlightCssClass: 'highlighted'
Expand Down

0 comments on commit b39a5a7

Please sign in to comment.