posativ / acrylamid

(unmaintained) static blog generator in python with incremental rendering ⛺
http://posativ.org/acrylamid/
Other
277 stars 40 forks source link

Wrong URL in sitemap.xml #216

Closed mdosch closed 10 years ago

mdosch commented 10 years ago

It seems, like there is a bug in sitemap.xml generation.

If you have a look at this sitemap you'll see that there is a slash missing:

http://blog.mdosch.de2014/09/07/syntax-highlightning-in-acrylamid/

Although the slash is written in conf.py:

WWW_ROOT = 'http://blog.mdosch.de/'

posativ commented 10 years ago

What routes do you use (the VIEWS configuration)?

mdosch commented 10 years ago

AFAIR I only changed the rss feed from .../rss to .../feed for compatibility with my old permlinks from wordpress and added the search view (although I don't use it atm).

VIEWS = {
    '/': {'filters': 'summarize', 'view': 'index',
          'pagination': '/page/:num/'},

    '/:year/:month/:day/:slug/': {'views': ['entry', 'draft']},

    '/tag/:name/': {'filters': 'summarize', 'view':'tag',
                    'pagination': '/tag/:name/:num/'},

    '/atom/': {'filters': ['h2', 'nohyphenate'], 'view': 'atom'},
    '/feed/': {'filters': ['h2', 'nohyphenate'], 'view': 'rss'},

    # # per tag Atom or RSS feed. Just uncomment to generate them.
    # '/tag/:name/atom/': {'filters': ['h2', 'nohyphenate'], 'view': 'atompertag'},
     '/tag/:name/rss/': {'filters': ['h2', 'nohyphenate'], 'view': 'rsspertag'},

    '/archiv/': {'view': 'archive', 'template': 'articles.html'},

    '/sitemap.xml': {'view': 'sitemap'},

    # # Here are some more examples

    # # '/:slug/' is a slugified url of your static page's title
    # '/:slug/': {'view': 'page'},

    # # '/atom/full/' will give you a _complete_ feed of all your entries
    # '/atom/full/': {'filters': 'h2', 'view': 'atom', 'num_entries': 1000},

    # # a feed containing all entries tagges with 'python'
    # '/rss/python/': {'filters': 'h2', 'view': 'rss',
    #                  'if': lambda e: 'python' in e.tags},

    # # a full typography features entry including MathML and Footnotes
    # '/:year/:slug': {'filters': ['typography', 'Markdown+Footnotes+MathML'],
    #                  'view': 'entry'},

    # # translations!
    # '/:year/:slug/:lang/': {'view': 'translation'},
    '/search/': {'view': 'search', 'filters': 'strip+pre'}

}
posativ commented 10 years ago

I am not able to reproduce this behavior. Does it also happen if you force recompilation via acrylamid co -f?

It does not matter if the website root has a trailing slash, it gets normalized internally.

mdosch commented 10 years ago

That doesn't change the output of sitemap.xml. Maybe I should add sed to my deployment. :D

http://blog.mdosch.de2014/02/19/explainshell-und-tuxsucht/ 2014-09-07 never 1.0
posativ commented 10 years ago

Ok, it has been fixed in the master branch over a year ago and more recently here https://github.com/posativ/acrylamid/pull/205. I've pushed a new version to PyPi which fixes the missing slash. Sorry for the inconvenience.

mdosch commented 10 years ago

Changed /usr/local/lib/python2.7/dist-packages/acrylamid-0.7.8-py2.7.egg/acrylamid/views/sitemap.py to url = conf['www_root'] +'/' + fname.replace(conf['output_dir'], '').

Seems to work.

posativ commented 10 years ago

Exactly. I just forgot to push out a new version.