|
@@ -82,7 +82,7 @@ class Tipue_Search_JSON_Generator(object):
|
|
|
|
|
|
|
|
|
|
def generate_output(self, writer):
|
|
def generate_output(self, writer):
|
|
- path = os.path.join(self.output_path, 'tipuesearch_content.json')
|
|
|
|
|
|
+ path = os.path.join(self.output_path, 'tipuesearch_content.js')
|
|
|
|
|
|
pages = self.context['pages'] + self.context['articles']
|
|
pages = self.context['pages'] + self.context['articles']
|
|
|
|
|
|
@@ -97,7 +97,9 @@ class Tipue_Search_JSON_Generator(object):
|
|
root_node = {'pages': self.json_nodes}
|
|
root_node = {'pages': self.json_nodes}
|
|
|
|
|
|
with open(path, 'w', encoding='utf-8') as fd:
|
|
with open(path, 'w', encoding='utf-8') as fd:
|
|
|
|
+ fd.write('var tipuesearch = ')
|
|
json.dump(root_node, fd, separators=(',', ':'), ensure_ascii=False)
|
|
json.dump(root_node, fd, separators=(',', ':'), ensure_ascii=False)
|
|
|
|
+ fd.write(';')
|
|
|
|
|
|
|
|
|
|
def get_generators(generators):
|
|
def get_generators(generators):
|