
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
Custom Search Worker setting is ignored Β· Issue #2973 Β· squidfunk/mkdocs-material
Description:
Contribution guidelines I've read the contribution guidelines and wholeheartedly agree I've found a bug and checked that ... ... the problem doesn't occur with the mkdocs or readthedocs...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Mobile Technology & AI
- Video & Online Content
- Politics
Content Management System {π}
What CMS is github.com built with?
Github.com utilizes WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,000,019 visitors per month in the current month.
However, some sources were not loaded, we suggest to reload the page to get complete results.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 4,989,889 paying customers.
The estimated monthly recurring revenue (MRR) is $20,957,532.
The estimated annual recurring revenues (ARR) are $251,490,385.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
search, worker, custom, squidfunk, issue, block, overrides, config, set, plugin, mkdocs, documentation, script, open, bug, file, index, sign, xvandish, ive, problem, customdir, endblock, add, searchindexjson, resolved, projects, setting, closed, override, super, var, implementation, directory, theme, loaded, material, docs, commented, added, searchindex, lines, navigation, code, issues, pull, requests, discussions, actions, security,
Topics {βοΈ}
mkdocs-material/src/assets/javascripts/bundle mkdocs-material/src/partials/header assets/javascripts/workers/search md-header__button md-icon mkdocs-material/src/base squidfunk edits owner closed issues bug resolved issue custom search worker open projects xvandish edits author code set icons/material/magnify custom search index moment custom search contribution guidelines called/passed messages package versions python mac os catalina comment metadata assignees setting custom_dir barebones mkdocs repo client-side search search worker override squidfunk closed worker option back projects milestone config block global __search override discussions path overrides/awesomeworker custom worker custom search theme block search input partials/search docs theme search worker problem description custom implementation search form search plugin search index worker mentioned implement search party search search box block overrides directory await handler
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:Custom Search Worker setting is ignored
articleBody:### Contribution guidelines
- [X] I've read the [contribution guidelines](https://github.com/squidfunk/mkdocs-material/blob/master/CONTRIBUTING.md) and wholeheartedly agree
### I've found a bug and checked that ...
- [X] ... the problem doesn't occur with the `mkdocs` or `readthedocs` themes
- [ ] ... the problem persists when all overrides are removed, i.e. `custom_dir`, `extra_javascript` and `extra_css`
- [X] ... the documentation does not mention anything about my problem
- [X] ... there are no open or closed issues that are related to my problem
### Description
As discussed in #2972, at the moment custom search does not work the way it's described in the documentation [here](https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=searc#custom-search).
The `worker` used to implement search is not configurable in the way thats described by the documentation, which is to override the `config` block like so:
```
{% block config %}
{{ super() }}
<script>
var __search = {
worker: "<url>"
}
</script>
{% endblock %}
```
At the moment, however, this doesn't actually configure the `worker` thats used, the default/built-in implementation [here](https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/workers/search.ts) is always used.
### Expected behaviour
I would expect the following block of code set in `overrides/main.html`
```
{% block config %}
{{ super() }}
<script>
var __search = {
worker: "./awesomeWorker.js"
}
</script>
{% endblock %}
```
to load a worker at the path `overrides/awesomeWorker.js` and have the search html input pass messages to it for consumption and and processing.
### Actual behaviour
The worker mentioned in the `config` block is not called/passed messages by the search input, so effectively nothing happens.
### Steps to reproduce
1. setup a barebones mkdocs repo however you want (`mkdocs new`)
2. add the `search` plugin in `mkdocs.yaml`. How-to is described [here](https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=searc#configuration)
3. create a directory `overrides`
4. set `overrides` as the `custom_dir` by setting `custom_dir: overrides` in `mkdocs.yml` under the `theme` block. How-to described here [here](https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=searc#configuration)
5. Add a `main.html` file in the `overrides` directory. Set it's file contents to:
```
{% extends "base.html" %}
{% block htmltitle %}
<title>Lorem ipsum dolor sit amet</title>
{% endblock %}
{% block config %}
{{ super() }}
<script>
var __search = {
worker: "./worker.js"
}
</script>
{% endblock %}
```
6. Add a `worker.js` file in the `overrides` directory. Set its file contents to:
```
console.log('whats going on')
export async function handler(message) {
console.log({ message })
}
addEventListener("message", async ev => {
postMessage(await handler(ev.data))
})
```
Now type something in the search. You should see the default `search.*.js` worker still loaded and working in the background, instead of our custom worker.
### Package versions
- Python: `3.9`
- MkDocs: `1.2.2`
- Material: `7.2.4`
### Configuration
```yaml
site_name: My Docs
theme:
name: material
custom_dir: overrides
plugins:
- search
```
### System information
- Operating system: Mac OS Catalina (10.15.7)
- Browser: Google Chrome (92.0.4515.131)
author:
url:https://github.com/xvandish
type:Person
name:xvandish
datePublished:2021-08-25T15:42:22.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:3
url:https://github.com/2973/mkdocs-material/issues/2973
context:https://schema.org
headline:Custom Search Worker setting is ignored
articleBody:### Contribution guidelines
- [X] I've read the [contribution guidelines](https://github.com/squidfunk/mkdocs-material/blob/master/CONTRIBUTING.md) and wholeheartedly agree
### I've found a bug and checked that ...
- [X] ... the problem doesn't occur with the `mkdocs` or `readthedocs` themes
- [ ] ... the problem persists when all overrides are removed, i.e. `custom_dir`, `extra_javascript` and `extra_css`
- [X] ... the documentation does not mention anything about my problem
- [X] ... there are no open or closed issues that are related to my problem
### Description
As discussed in #2972, at the moment custom search does not work the way it's described in the documentation [here](https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=searc#custom-search).
The `worker` used to implement search is not configurable in the way thats described by the documentation, which is to override the `config` block like so:
```
{% block config %}
{{ super() }}
<script>
var __search = {
worker: "<url>"
}
</script>
{% endblock %}
```
At the moment, however, this doesn't actually configure the `worker` thats used, the default/built-in implementation [here](https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/workers/search.ts) is always used.
### Expected behaviour
I would expect the following block of code set in `overrides/main.html`
```
{% block config %}
{{ super() }}
<script>
var __search = {
worker: "./awesomeWorker.js"
}
</script>
{% endblock %}
```
to load a worker at the path `overrides/awesomeWorker.js` and have the search html input pass messages to it for consumption and and processing.
### Actual behaviour
The worker mentioned in the `config` block is not called/passed messages by the search input, so effectively nothing happens.
### Steps to reproduce
1. setup a barebones mkdocs repo however you want (`mkdocs new`)
2. add the `search` plugin in `mkdocs.yaml`. How-to is described [here](https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=searc#configuration)
3. create a directory `overrides`
4. set `overrides` as the `custom_dir` by setting `custom_dir: overrides` in `mkdocs.yml` under the `theme` block. How-to described here [here](https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=searc#configuration)
5. Add a `main.html` file in the `overrides` directory. Set it's file contents to:
```
{% extends "base.html" %}
{% block htmltitle %}
<title>Lorem ipsum dolor sit amet</title>
{% endblock %}
{% block config %}
{{ super() }}
<script>
var __search = {
worker: "./worker.js"
}
</script>
{% endblock %}
```
6. Add a `worker.js` file in the `overrides` directory. Set its file contents to:
```
console.log('whats going on')
export async function handler(message) {
console.log({ message })
}
addEventListener("message", async ev => {
postMessage(await handler(ev.data))
})
```
Now type something in the search. You should see the default `search.*.js` worker still loaded and working in the background, instead of our custom worker.
### Package versions
- Python: `3.9`
- MkDocs: `1.2.2`
- Material: `7.2.4`
### Configuration
```yaml
site_name: My Docs
theme:
name: material
custom_dir: overrides
plugins:
- search
```
### System information
- Operating system: Mac OS Catalina (10.15.7)
- Browser: Google Chrome (92.0.4515.131)
author:
url:https://github.com/xvandish
type:Person
name:xvandish
datePublished:2021-08-25T15:42:22.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:3
url:https://github.com/2973/mkdocs-material/issues/2973
Person:
url:https://github.com/xvandish
name:xvandish
url:https://github.com/xvandish
name:xvandish
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:3
interactionType:https://schema.org/CommentAction
userInteractionCount:3
External Links {π}(4)
- What's the total monthly financial gain of https://github.blog?
- How much profit does https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=searc#custom-search make?
- How profitable is https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=searc#configuration?
- How much profit does https://www.githubstatus.com/ make?
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net