Adding favicon to static folder

This commit is contained in:
Alex Hunt 2017-12-16 15:01:30 -05:00
parent 83c657ceec
commit da809a5e53
7 changed files with 65 additions and 3 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
/lib
/bin
/include
/icon
/node_modules
*.pyc
pip-selfcheck.json

View File

@ -86,6 +86,33 @@ def renumber_chapters():
es_update_number(chapter['id'], index + 1)
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
#
@ -152,3 +179,11 @@ def delete_note(id):
es_delete_document('note', id)
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))

8
blueprints/search.py Normal file
View File

@ -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')

View File

@ -2,8 +2,8 @@
<head>
<title>Joyce - Editor</title>
<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="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
</head>
<body>
<!-- Reader Layout -->

View File

@ -2,8 +2,8 @@
<head>
<title>Joyce - Reader</title>
<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="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
<link rel="icon" type="image/png" href="static/image/icon.png">
</head>
<body>

14
templates/search.html Normal file
View File

@ -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>

View File

@ -6,7 +6,7 @@ const path = require('path')
const rootAssetPath = './src/'
let pathsToClean = [
'static/'
'static/js'
]
module.exports = {
@ -18,6 +18,10 @@ module.exports = {
editor: [
rootAssetPath + 'editor',
rootAssetPath + 'stylesheets/' + 'editor.scss'
],
search: [
rootAssetPath + 'search',
rootAssetPath + 'stylesheets/' + 'search.scss'
]
},
output: {