Adding favicon to static folder
This commit is contained in:
parent
83c657ceec
commit
da809a5e53
|
@ -3,6 +3,7 @@
|
||||||
/lib
|
/lib
|
||||||
/bin
|
/bin
|
||||||
/include
|
/include
|
||||||
|
/icon
|
||||||
/node_modules
|
/node_modules
|
||||||
*.pyc
|
*.pyc
|
||||||
pip-selfcheck.json
|
pip-selfcheck.json
|
||||||
|
|
|
@ -86,6 +86,33 @@ def renumber_chapters():
|
||||||
es_update_number(chapter['id'], index + 1)
|
es_update_number(chapter['id'], index + 1)
|
||||||
return chapters
|
return chapters
|
||||||
|
|
||||||
|
def es_search_text(body):
|
||||||
|
search = es.search(
|
||||||
|
index='joyce',
|
||||||
|
# _source_exclude=['text'],
|
||||||
|
body={
|
||||||
|
'from': 0, 'size': 10,
|
||||||
|
'query': {
|
||||||
|
'match': {
|
||||||
|
'text': {
|
||||||
|
'query': body,
|
||||||
|
'analyzer': 'html_analyzer'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'highlight' : {
|
||||||
|
'fields' : {
|
||||||
|
'text': {
|
||||||
|
'matched_fields': 'text',
|
||||||
|
'type': 'unified',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return search['hits']['hits']
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Chapter API Routes
|
# Chapter API Routes
|
||||||
#
|
#
|
||||||
|
@ -152,3 +179,11 @@ def delete_note(id):
|
||||||
es_delete_document('note', id)
|
es_delete_document('note', id)
|
||||||
return jsonify(es_document_list('note'))
|
return jsonify(es_document_list('note'))
|
||||||
|
|
||||||
|
#
|
||||||
|
# Search API Routes
|
||||||
|
#
|
||||||
|
|
||||||
|
""" Basic Text Search """
|
||||||
|
@api.route('/search/', methods=['POST'])
|
||||||
|
def search_text():
|
||||||
|
return jsonify(es_search_text(request.data))
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
from flask import Blueprint, render_template, abort
|
||||||
|
from jinja2 import TemplateNotFound
|
||||||
|
|
||||||
|
search = Blueprint('search', __name__)
|
||||||
|
|
||||||
|
@search.route('/')
|
||||||
|
def show_search():
|
||||||
|
return render_template('search.html')
|
|
@ -2,8 +2,8 @@
|
||||||
<head>
|
<head>
|
||||||
<title>Joyce - Editor</title>
|
<title>Joyce - Editor</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<!-- <link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}"> -->
|
|
||||||
<link rel="manifest" href="/static/manifest.json">
|
<link rel="manifest" href="/static/manifest.json">
|
||||||
|
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- Reader Layout -->
|
<!-- Reader Layout -->
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<head>
|
<head>
|
||||||
<title>Joyce - Reader</title>
|
<title>Joyce - Reader</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<!-- <link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}"> -->
|
|
||||||
<link rel="manifest" href="static/manifest.json">
|
<link rel="manifest" href="static/manifest.json">
|
||||||
|
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
|
||||||
<link rel="icon" type="image/png" href="static/image/icon.png">
|
<link rel="icon" type="image/png" href="static/image/icon.png">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<!doctype html>
|
||||||
|
<head>
|
||||||
|
<title>Joyce - Search</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
|
||||||
|
<link rel="manifest" href="static/manifest.json">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Reader Layout -->
|
||||||
|
<div id="wrapper">
|
||||||
|
</div>
|
||||||
|
<!-- Scripts -->
|
||||||
|
<script src="{{asset_url_for('search.js')}}"></script>
|
||||||
|
</body>
|
|
@ -6,7 +6,7 @@ const path = require('path')
|
||||||
|
|
||||||
const rootAssetPath = './src/'
|
const rootAssetPath = './src/'
|
||||||
let pathsToClean = [
|
let pathsToClean = [
|
||||||
'static/'
|
'static/js'
|
||||||
]
|
]
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -18,6 +18,10 @@ module.exports = {
|
||||||
editor: [
|
editor: [
|
||||||
rootAssetPath + 'editor',
|
rootAssetPath + 'editor',
|
||||||
rootAssetPath + 'stylesheets/' + 'editor.scss'
|
rootAssetPath + 'stylesheets/' + 'editor.scss'
|
||||||
|
],
|
||||||
|
search: [
|
||||||
|
rootAssetPath + 'search',
|
||||||
|
rootAssetPath + 'stylesheets/' + 'search.scss'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
|
|
Loading…
Reference in New Issue