Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 5c4ce94c
authored
Jun 29, 2017
by
Felix Becker
Committed by
GitHub
Jun 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(search): use Algolia for search (#7864)
1 parent
ca683c04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
22 deletions
docs/css/style.css
docs/plugins/esdoc-sequelize.js
docs/css/style.css
View file @
5c4ce94
@import
url(https://fonts.googleapis.com/css?family=Titillium+Web)
;
.algolia-autocomplete
.algolia-docsearch-suggestion--category-header
,
.algolia-autocomplete
.algolia-docsearch-suggestion--title
,
.algolia-autocomplete
.algolia-docsearch-suggestion--subcategory-column
,
#docs-search-input
{
font-size
:
16px
!important
;
line-height
:
normal
;
}
.algolia-autocomplete
.algolia-docsearch-suggestion--wrapper
{
padding
:
0
!important
;
}
.docs-search-container
{
float
:
right
;
margin-right
:
30px
;
}
#docs-search-input
{
border
:
none
;
background
:
transparent
;
padding
:
10px
;
}
#docs-search-input
,
.docs-search-container
{
height
:
40px
;
width
:
300px
;
}
/* ESDoc search */
.search-box
{
display
:
none
;
}
div
.logo
img
{
width
:
200px
;
height
:
200px
;
...
...
@@ -60,25 +93,6 @@ a[href^="file/lib/"] {
display
:
none
;
}
.search-box
{
display
:
none
;
}
.search-container
{
position
:
absolute
;
width
:
500px
;
top
:
0
;
right
:
50px
;
padding-right
:
8px
;
padding-bottom
:
10px
;
line-height
:
normal
;
font-size
:
12px
;
}
.search-container
.gsc-control-cse
{
padding
:
2px
0
0
0
!important
;
}
.manual-color
:after
{
content
:
''
!important
;
}
...
...
docs/plugins/esdoc-sequelize.js
View file @
5c4ce94
...
...
@@ -13,9 +13,6 @@ exports.onHandleHTML = function(ev) {
const
$header
=
$
(
'header'
);
$header
.
prepend
(
'<a href="/"><img src="manual/asset/logo-small.png" class="header-logo" /></a>'
);
$header
.
append
(
'<div class="search-container"><div class="gcse-search"></div></div>'
);
$
(
'head'
).
append
(
'<script type="text/javascript" async=true src="https://cse.google.com/cse.js?cx=015434599481993553871:zku_jjbxubw" />'
);
$
(
'.repo-url-github'
).
after
(
'<a href="http://sequelize-slack.herokuapp.com/" class="slack-link"><img class="slack-logo" src="manual/asset/slack.svg"/>Join us on Slack</a>'
);
// remove unnecessary scripts
...
...
@@ -24,5 +21,25 @@ exports.onHandleHTML = function(ev) {
$
(
`script[src="
${
script
}
"]`
).
remove
();
}
// Algolia search
if
(
process
.
env
.
ALGOLIA_API_KEY
)
{
$
(
'head'
).
append
(
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />'
);
$header
.
append
(
'<div class="docs-search-container"><input type="search" id="docs-search-input" placeholder="Search..."></div>'
);
$
(
'body'
).
append
(
`
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
<script type="text/javascript">
docsearch({
apiKey: '
${
process
.
env
.
ALGOLIA_API_KEY
}
',
indexName: 'sequelizejs',
inputSelector: '#docs-search-input',
debug: false // Set debug to true if you want to inspect the dropdown
});
document.getElementById('docs-search-input').focus();
</script>
`
);
}
else
{
console
.
log
(
'Set ALGOLIA_API_KEY environment variable to enable Algolia search field'
);
}
ev
.
data
.
html
=
$
.
html
();
};
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment