Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search generating 301 error #115

Closed
bnice5000 opened this issue Mar 25, 2014 · 3 comments
Closed

Search generating 301 error #115

bnice5000 opened this issue Mar 25, 2014 · 3 comments

Comments

@bnice5000
Copy link

Let me start by saying your theme is awesome. I would like to use it for my blog. I have it mostly implemented. However, I am running into an issue where, when I use search it generates a GET http://stirabout.com/tipuesearch_content.json - 301 Moved Permanently. However, the json file is there and has not moved. http://www.stirabout.com/tipuesearch_content.json

My pelicanconf.py is as follows:

#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals

AUTHOR = u'Brian'
SITENAME = u'Stir About Software'
SITEURL = u'http://stirabout.com'

TIMEZONE = 'America/New_York'

DEFAULT_LANG = u'en'

# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None

# Blogroll
LINKS = (('Pelican', 'http://getpelican.com/'),
         ('Python.org', 'http://python.org/'),
         ('Jinja2', 'http://jinja.pocoo.org/'),
         ('You can modify those links in your config file', '#'),)

# Social widget
SOCIAL = (('You can add links in your config file', '#'),
          ('Another social link', '#'),)

DEFAULT_PAGINATION = 10

# Uncomment following line if you want document-relative URLs when developing
RELATIVE_URLS = False

# Added by blevin
PAGE_DIR = ('pages')
DISPLAY_PAGES_ON_MENU = True

THEME = "pelican-themes/elegant"

PLUGIN_PATH = 'pelican-plugins'

PLUGINS = ['sitemap', 'extract_toc', 'tipue_search']
MD_EXTENSIONS = ['codehilite(css_class=highlight)', 'extra', 'headerid', 'toc']
DIRECT_TEMPLATES = (('index', 'tags', 'categories','archives', 'search', '404'))
STATIC_PATHS = ['theme/images', 'images']
TAG_SAVE_AS = ''
CATEGORY_SAVE_AS = ''
AUTHOR_SAVE_AS = ''
PATH = 'content' # needed to fix https://github.com/getpelican/pelican/issues/1116

SITEMAP = {
    'format': 'xml'
}
@bnice5000
Copy link
Author

I was able to figure out the issue. I had to make the following change to the template.

elegant/templates/search.html 2014-04-08 07:06:53.000000000 -0400
@@ -30,7 +30,7 @@
          'newWindow': true,
          {# I cannot place following statements in the conditionals above because then Tipue Search fails to work. Possibly a bug in Tipue Search. #}
          {% if 'tipue_search' in PLUGINS %}
-             'contentLocation': '{{ SITEURL }}/tipuesearch_content.json'
+             'contentLocation': 'tipuesearch_content.json'
          {% else %}
              'liveDescription': '.article-content'
          {% endif %}

@talha131
Copy link
Member

@bnice5000 Thank you! I will look into it this weekend.

@talha131
Copy link
Member

@bnice5000 Thank you for your contribution. I am deeply sorry for getting back to you so late.

Please change SITEURL to

SITEURL = u'http://www.stirabout.com'

Let me know how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants