Giter Site home page Giter Site logo

pelican_comment_system's People

Contributors

adeverteuil avatar almet avatar clokep avatar jml avatar justinmayer avatar konrad avatar minchinweb avatar moini avatar scheirle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

minchinweb

pelican_comment_system's Issues

Disable comments

Allow to disable comments on a per article basis.

Disable:

  • no new comments, but display old ones
  • no new comments and hide old ones

Error with new version of pelican: 'Pelican' object has no attribute 'get_writer'

I'm not sure if bug reports should go here or https://github.com/getpelican/pelican-plugins/issues . The "pelican_comment_system" seems to no longer work for me with the latest version of pelican. Instead I get a "'Pelican' object has no attribute 'get_writer'" error:

pelican -o output -s pelicanconf.py content --debug
DEBUG: Pelican version: 4.5.4
DEBUG: Python version: 3.8.5
DEBUG: Adding current directory to system path
DEBUG: Finding namespace plugins
DEBUG: Loading plugin `pelican_comment_system`
DEBUG: Registering plugin `pelican_comment_system`
DEBUG: Found generator: ArticlesGenerator (internal)
DEBUG: Found generator: PagesGenerator (internal)
DEBUG: Found generator: StaticGenerator (internal)
DEBUG: Template list: ['!simple/archives.html', '!simple/article.html', '!simple/author.html', '!simple/authors.html', '!simple/base.html', '!simple/categories.html', '!simple/category.html', '!simple/gosquared.html', '!simple/index.html', '!simple/page.html', '!simple/pagination.html', '!simple/period_archives.html', '!simple/tag.html', '!simple/tags.html', '!simple/translations.html', '!theme/analytics.html', '!theme/archives.html', '!theme/article.html', '!theme/article_infos.html', '!theme/author.html', '!theme/authors.html', '!theme/base.html', '!theme/category.html', '!theme/comments.html', '!theme/disqus_script.html', '!theme/github.html', '!theme/index.html', '!theme/page.html', '!theme/pcs/comments.html', '!theme/period_archives.html', '!theme/tag.html', '!theme/taglist.html', '!theme/tags.html', '!theme/translations.html', '!theme/twitter.html', 'analytics.html', 'archives.html', 'article.html', 'article_infos.html', 'author.html', 'authors.html', 'base.html', 'categories.html', 'category.html', 'comments.html', 'disqus_script.html', 'github.html', 'gosquared.html', 'index.html', 'page.html', 'pagination.html', 'pcs/comments.html', 'period_archives.html', 'tag.html', 'taglist.html', 'tags.html', 'translations.html', 'twitter.html']
CRITICAL: 'Pelican' object has no attribute 'get_writer'
Traceback (most recent call last):
  File "/home/trevor/.local/bin/pelican", line 8, in <module>
    sys.exit(main())
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican/__init__.py", line 527, in main
    pelican.run()
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican/__init__.py", line 93, in run
    generators = [
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican/__init__.py", line 94, in <listcomp>
    cls(
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican/generators.py", line 298, in __init__
    signals.article_generator_init.send(self)
  File "/usr/lib/python3/dist-packages/blinker/base.py", line 266, in send
    return [(receiver, receiver(sender, **kwargs))
  File "/usr/lib/python3/dist-packages/blinker/base.py", line 266, in <listcomp>
    return [(receiver, receiver(sender, **kwargs))
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican_comment_system/__init__.py", line 89, in initialize
    _pelican_writer = _pelican_obj.get_writer()
AttributeError: 'Pelican' object has no attribute 'get_writer'

Plugin breaks pelican (NoneType object has no attribute 'lower' )

Heyo

I've been trying to get this system to work for me. Every time I try to run pelican I get as far as generating the comment XML feeds and then the program breaks down and nothing else gets rendered.

At this point I am not using any of the comments in any templates. I'm simply trying to run pelican with the plugin, I keep getting NoneType object has no attribute 'lower'

Screenshot_2019-05-21_17-44-20

I've tried both versions 1.3.0 and 1.4.0 of pelican_comment_system. I'm using Pelican 4.0.1 with pelican_comment_system and pelican installed in a Pipenv.

Here's my settings:

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

AUTHOR = 'Trevor'
SITENAME = 'trevDev'
SITEURL = 'http://localhost:8000'
HOT_RELOAD = False

PATH = 'src/content'
OUTPUT_PATH = 'build'

STATIC_PATHS = ['images']

THEME = 'src/themes/trevdev'
THEME_STATIC_PATHS = ['static']
BLOG_TITLE = 'The Devblog'
BLOG_DESCRIPTION = "A devblog filled with tips, tricks, ideas and "\
    "ramblings regarding all things web development, security and programming."
META_DESCRIPTION = "A full stack web developer "\
    "from Vancouver Island who builds fantastic websites and cloud"\
    " based applications."

JS_VENDORS = ['vue.js', 'axios.min.js']

TIMEZONE = 'America/Vancouver'

DEFAULT_LANG = 'en'

# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = 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', '#'),)

SOCIALS = {
    'twitter': '@realTrevDev'
}

DEFAULT_PAGINATION = 10

DELETE_OUTPUT_DIRECTORY = True

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

# RELATIVE_URLS = True

# URLS

PAGE_URL = '{slug}/'
PAGE_SAVE_AS = '{slug}/index.html'
AUTHOR_URL = 'author/{slug}/'
AUTHOR_SAVE_AS = 'author/{slug}/index.html'
CATEGORY_URL = '{slug}/'
CATEGORY_SAVE_AS = '{slug}/index.html'
TAG_URL = 'tag/{slug}/'
TAG_SAVE_AS = 'tag/{slug}/index.html'
ARTICLE_URL = '{category}/{slug}/'
ARTICLE_SAVE_AS = '{category}/{slug}/index.html'
# YEAR_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/index.html'
# MONTH_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/index.html'

# Plugins

PLUGIN_PATHS = ['pelican-plugins', 'plugins']
PLUGINS = ['md_inline_extension', 'pelican-yaml', 'readtime', 'tipue_search', 'pelican_comment_system']

MD_INLINE = {
    '~~': ('text-decoration: line-through;',)
}

PELICAN_COMMENT_SYSTEM = True
PELICAN_COMMENT_SYSTEM_IDENTICON_DATA = ('author',)

My file paths

src
├── content
│   ├── comments
│   │   └── this-is-just-a-test
│   │       └── 0.md
│   ├── images
│   │   ├── 2019
│   │   │   └── freya.jpeg
│   │   ├── dicebag.png
│   │   ├── dodds.png
│   │   ├── gs.png
│   │   ├── test.jpeg
│   │   └── trooper.jpg
│   ├── pages
│   │   ├── hello.md
│   │   └── home.md
│   └── posts
│       ├── Blog
│       │   ├── 01-test-post.md <--- slug: this-is-just-a-test
│       │   └── 02-why-pelican.md
│       └── Portfolio
│           ├── dbg.md
│           ├── dodds.md
│           └── gs.md

The only reference to the str.lower() method I can find is in the init file:

for file in os.listdir(folder):
name, extension = os.path.splitext(file)
if extension[1:].lower() in reader.extensions:
com = reader.read_file(
base_path=folder, path=file,
content_class=Comment, context=context)
com.article = content
_all_comments.append(com)
if hasattr(com, 'replyto'):
replies.append(com)
else:
comments.append(com)

I tried wrapping the inside of the if block in a try/catch, if I do this, the script finishes, all of my site gets generated and 0 comments get generated, so the problem is definitely here. Perhaps it's in the reader_read_file() method.

Optional server side component

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.