scheirle / pelican_comment_system Goto Github PK
View Code? Open in Web Editor NEWAllows you to add static comments to your articles on your Pelican blog.
License: Other
Allows you to add static comments to your articles on your Pelican blog.
License: Other
Allow to disable comments on a per article basis.
Disable:
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'
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'
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:
pelican_comment_system/pelican_comment_system/__init__.py
Lines 182 to 195 in 0ac19ef
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.
Refs:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.