Open Nagasaki45 opened 8 years ago
I found a possible fix, which is quite ugly in my opinion. I created a pelican_youtube.py
module in the pelican-plugins
dir with the following content:
import sys
import os
PLUGINS_DIR = os.path.dirname(__file__)
sys.path.append(os.path.join(PLUGINS_DIR, 'pelican_youtube', 'pelican_youtube'))
from youtube import register
@Nagasaki45 / @lincolnfrias: Would you consider submitting a PR to address the issue(s) discussed here?
@justinmayer, do you have an idea that is less hacky than the one I suggested above? If not I will send a PR with the hack.
The issue is that pelican_youtube
follows the structure of python package. I think it should be considered to search in <plugin_name>/<plugin_name>
if there is not init in the first level, for now, it can be used with:
PLUGIN_PATHS = ['<path/to/pelican-plugins>/pelican_youtube']
PLUGINS = ['pelican_youtube']
or with installing it via pip install pelican-youtube
PLUGINS = ['pelican_youtube']
I am facing a similar issue and therefore haven't pushed my plugin to the pelican-plugins
repo.
I'm unable to add the
pelican_youtube
plugin topelicanconf.py
. I'm getting the following traceback when trying to build the site:Steps to reproduce:
pelican-quickstart
.pelican-plugins
repo (recursively) to./pelican-plugins
.pelicanconf.py
:pelican content -o output -s pelicanconf.py
.The issue is caused by the
pelican_youtube
folder not being a valid python module (/package) withregister
attribute.