Exemplo n.º 1
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('STATIC_COMMENTS', False)
    DEFAULT_CONFIG.setdefault('STATIC_COMMENTS_DIR' 'comments')
    if pelican:
        pelican.settings.setdefault('STATIC_COMMENTS', False)
        pelican.settings.setdefault('STATIC_COMMENTS_DIR', 'comments')
Exemplo n.º 2
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('DISQUS_SECRET_KEY', '')
    DEFAULT_CONFIG.setdefault('DISQUS_PUBLIC_KEY', '')
    if pelican:
        pelican.settings.setdefault('DISQUS_SECRET_KEY', '')
        pelican.settings.setdefault('DISQUS_PUBLIC_KEY', '')
Exemplo n.º 3
0
def initialized(pelican):

    p = os.path.expanduser('~/Pictures')

    DEFAULT_CONFIG.setdefault('PHOTO_LIBRARY', p)
    #     DEFAULT_CONFIG.setdefault('PHOTO_GALLERY', (1024, 768, 80))
    #     DEFAULT_CONFIG.setdefault('PHOTO_ARTICLE', (760, 506, 80))
    #     DEFAULT_CONFIG.setdefault('PHOTO_THUMB', (192, 144, 60))
    #     DEFAULT_CONFIG.setdefault('PHOTO_GALLERY_TITLE', '')
    #     DEFAULT_CONFIG.setdefault('PHOTO_ALPHA_BACKGROUND_COLOR', (255, 255, 255))
    #     DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK', False)
    #     DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_THUMB', False)
    #     DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_TEXT', DEFAULT_CONFIG['SITENAME'])
    #     DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_TEXT_COLOR', (255, 255, 255))
    #     DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_IMG', '')
    #     DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_IMG_SIZE', False)
    #     DEFAULT_CONFIG.setdefault('PHOTO_RESIZE_JOBS', 1)
    #     DEFAULT_CONFIG.setdefault('PHOTO_EXIF_KEEP', False)
    #     DEFAULT_CONFIG.setdefault('PHOTO_EXIF_REMOVE_GPS', False)
    #     DEFAULT_CONFIG.setdefault('PHOTO_EXIF_AUTOROTATE', True)
    #     DEFAULT_CONFIG.setdefault('PHOTO_EXIF_COPYRIGHT', False)
    #     DEFAULT_CONFIG.setdefault('PHOTO_EXIF_COPYRIGHT_AUTHOR', DEFAULT_CONFIG['SITENAME'])
    #     DEFAULT_CONFIG.setdefault('PHOTO_LIGHTBOX_GALLERY_ATTR', 'data-lightbox')
    #     DEFAULT_CONFIG.setdefault('PHOTO_LIGHTBOX_CAPTION_ATTR', 'data-title')
    #
    #     DEFAULT_CONFIG['queue_resize'] = {}
    #     DEFAULT_CONFIG['created_galleries'] = {}
    #     DEFAULT_CONFIG['plugin_dir'] = os.path.dirname(os.path.realpath(__file__))
    #
    if pelican:
        pelican.settings.setdefault('PHOTO_LIBRARY', p)
Exemplo n.º 4
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('DISQUS_SECRET_KEY', '')
    DEFAULT_CONFIG.setdefault('DISQUS_PUBLIC_KEY', '')
    if pelican:
        pelican.settings.setdefault('DISQUS_SECRET_KEY', '')
        pelican.settings.setdefault('DISQUS_PUBLIC_KEY', '')
def initialized(pelican):
	from pelican.settings import DEFAULT_CONFIG
	DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM', False)
	DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_DIR' 'comments')
	if pelican:
		pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM', False)
		pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_DIR', 'comments')
Exemplo n.º 6
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('STATIC_COMMENTS', False)
    DEFAULT_CONFIG.setdefault('STATIC_COMMENTS_DIR' 'comments')
    if pelican:
        pelican.settings.setdefault('STATIC_COMMENTS', False)
        pelican.settings.setdefault('STATIC_COMMENTS_DIR', 'comments')
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM', False)
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_DIR' 'comments')
    if pelican:
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM', False)
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_DIR', 'comments')
Exemplo n.º 8
0
def initialized(pelican):
	global fancybox_settings
	from pelican.settings import DEFAULT_CONFIG
	DEFAULT_CONFIG.setdefault('FANCYBOX_SETTINGS', {})
	if pelican:
		pelican.settings.setdefault('FANCYBOX_SETTINGS', {})
		fancybox_settings = supercopy(pelican.settings['FANCYBOX_SETTINGS'])
Exemplo n.º 9
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG

    DEFAULT_CONFIG.setdefault("STATIC_COMMENTS", False)
    DEFAULT_CONFIG.setdefault("STATIC_COMMENTS_DIR" "comments")
    if pelican:
        pelican.settings.setdefault("STATIC_COMMENTS", False)
        pelican.settings.setdefault("STATIC_COMMENTS_DIR", "comments")
Exemplo n.º 10
0
def init_default_config(pelican):
    from pelican.settings import DEFAULT_CONFIG

    TOC_DEFAULT = {'TOC_HEADERS': '^h[1-6]', 'TOC_RUN': 'true'}

    DEFAULT_CONFIG.setdefault('TOC', TOC_DEFAULT)
    if (pelican):
        pelican.settings.setdefault('TOC', TOC_DEFAULT)
Exemplo n.º 11
0
def initialized(pelican):

    p = os.path.expanduser('~/Pictures')

    DEFAULT_CONFIG.setdefault('PHOTO_LIBRARY', p)

    if pelican:
        pelican.settings.setdefault('PHOTO_LIBRARY', p)
Exemplo n.º 12
0
def initialize(instance):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('CATEGORYNAMES_ATTRIBUTES',
                              ('name', 'name_long'))
    DEFAULT_CONFIG.setdefault('CATEGORYNAMES_ALTERNATIVES', dict())
    instance.settings.setdefault('CATEGORYNAMES_ATTRIBUTES',
                                 ('name', 'name_long'))
    instance.settings.setdefault('CATEGORYNAMES_ALTERNATIVES', dict())
Exemplo n.º 13
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG

    DEFAULT_CONFIG.setdefault("SUMMARY_BEGIN_MARKER", "<!-- PELICAN_BEGIN_SUMMARY -->")
    DEFAULT_CONFIG.setdefault("SUMMARY_END_MARKER", "<!-- PELICAN_END_SUMMARY -->")
    if pelican:
        pelican.settings.setdefault("SUMMARY_BEGIN_MARKER", "<!-- PELICAN_BEGIN_SUMMARY -->")
        pelican.settings.setdefault("SUMMARY_END_MARKER", "<!-- PELICAN_END_SUMMARY -->")
Exemplo n.º 14
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG

    DEFAULT_CONFIG.setdefault('SHELL_BEGIN', '<!-- SHELL_BEGIN -->')
    DEFAULT_CONFIG.setdefault('SHELL_END', '<!-- SHELL_END -->')

    if pelican:
        pelican.settings.setdefault('SHELL_BEGIN', '<!-- SHELL_BEGIN -->')
        pelican.settings.setdefault('SHELL_END', '<!-- SHELL_END -->')
Exemplo n.º 15
0
def initialized(pelican):
    """Initialize the plugin """

    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('MDF_DEFAULT_CONFIG', '')
    DEFAULT_CONFIG.setdefault('BOOTSTRAPPER_FIGURES', False)
    if pelican:
        pelican.settings.setdefault('MDF_DEFAULT_CONFIG', '')
        pelican.settings.setdefault('BOOTSTRAPPER_FIGURES', False)
Exemplo n.º 16
0
def initialize(pelicanobj):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('SKIPTAGS', [
        'h1',
    ])
    if pelicanobj:
        pelicanobj.settings.setdefault('SKIPTAGS', [
            'h1',
        ])
Exemplo n.º 17
0
def setdefault(pelican, settings):
    from pelican.settings import DEFAULT_CONFIG
    for key, value in settings:
        DEFAULT_CONFIG.setdefault(key, value)

    if not pelican:
        return

    for key, value in settings:
        pelican.settings.setdefault(key, value)
Exemplo n.º 18
0
def initialized(pelican):
    p = os.path.expanduser('~/Music')

    DEFAULT_CONFIG.setdefault('MUSIC_LIBRARY', p)
    DEFAULT_CONFIG.setdefault('MUSIC_COVER', 'cover.jpg')
    DEFAULT_CONFIG['plugin_dir'] = os.path.dirname(os.path.realpath(__file__))

    if pelican:
        pelican.settings.setdefault('MUSIC_LIBRARY', p)
        pelican.settings.setdefault('MUSIC_COVER', 'cover.jpg')
def setdefault(pelican, settings):
    from pelican.settings import DEFAULT_CONFIG
    for key, value in settings:
        DEFAULT_CONFIG.setdefault(key, value)

    if not pelican:
        return

    for key, value in settings:
        pelican.settings.setdefault(key, value)
Exemplo n.º 20
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault(WEBRING_FEED_URLS_STR, [])
    DEFAULT_CONFIG.setdefault(WEBRING_MAX_ARTICLES_STR, 3)
    DEFAULT_CONFIG.setdefault(WEBRING_ARTICLES_PER_FEED_STR, 1)
    DEFAULT_CONFIG.setdefault(WEBRING_SUMMARY_LENGTH_STR, 128)
    DEFAULT_CONFIG.setdefault(WEBRING_CLEAN_SUMMARY_HTML_STR, True)
    if pelican:
        for name, value in DEFAULT_CONFIG.items():
            if name.startswith('WEBRING'):
                pelican.settings.setdefault(name, value)
Exemplo n.º 21
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('SUMMARY_BEGIN_MARKER',
                              '<!-- PELICAN_BEGIN_SUMMARY -->')
    DEFAULT_CONFIG.setdefault('SUMMARY_END_MARKER',
                              '<!-- PELICAN_END_SUMMARY -->')
    if pelican:
        pelican.settings.setdefault('SUMMARY_BEGIN_MARKER',
                                    '<!-- PELICAN_BEGIN_SUMMARY -->')
        pelican.settings.setdefault('SUMMARY_END_MARKER',
                                    '<!-- PELICAN_END_SUMMARY -->')
Exemplo n.º 22
0
Arquivo: toc.py Projeto: sbadia/site
def init_default_config(pelican):
    from pelican.settings import DEFAULT_CONFIG

    TOC_DEFAULT = {
        'TOC_HEADERS': '^h[1-6]',
        'TOC_RUN': 'true'
    }

    DEFAULT_CONFIG.setdefault('TOC', TOC_DEFAULT)
    if(pelican):
        pelican.settings.setdefault('TOC', TOC_DEFAULT)
Exemplo n.º 23
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('ARTICLEHEAD_BEGIN_MARKER',
                              '<!-- ARTICLE_HEAD_BEGIN -->')
    DEFAULT_CONFIG.setdefault('ARTICLEHEAD_END_MARKER',
                              '<!-- ARTICLE_HEAD_END -->')
    if pelican:
        pelican.settings.setdefault('ARTICLEHEAD_BEGIN_MARKER',
                                  '<!-- ARTICLE_HEAD_BEGIN -->')
        pelican.settings.setdefault('ARTICLEHEAD_END_MARKER',
                                    '<!-- ARTICLE_HEAD_END -->')
Exemplo n.º 24
0
def initialized(pelican):
    p = os.path.expanduser('~/Pictures')
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('PHOTO_MTIME', False)
    DEFAULT_CONFIG.setdefault('PHOTO_LIBRARY', p)
    DEFAULT_CONFIG.setdefault('PHOTO_GALLERY', (1024, 768, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_ARTICLE', ( 760, 506, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_THUMB',   ( 192, 144, 60))
    if pelican:
        pelican.settings.setdefault('PHOTO_MTIME', False)
        pelican.settings.setdefault('PHOTO_LIBRARY', p)
        pelican.settings.setdefault('PHOTO_GALLERY', (1024, 768, 80))
        pelican.settings.setdefault('PHOTO_ARTICLE', ( 760, 506, 80))
        pelican.settings.setdefault('PHOTO_THUMB',   ( 192, 144, 60))
Exemplo n.º 25
0
def initialized(pelican):
    p = os.path.expanduser('~/Pictures')
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('PHOTO_MTIME', False)
    DEFAULT_CONFIG.setdefault('PHOTO_LIBRARY', p)
    DEFAULT_CONFIG.setdefault('PHOTO_GALLERY', (1024, 768, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_ARTICLE', (760, 506, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_THUMB', (192, 144, 60))
    if pelican:
        pelican.settings.setdefault('PHOTO_MTIME', False)
        pelican.settings.setdefault('PHOTO_LIBRARY', p)
        pelican.settings.setdefault('PHOTO_GALLERY', (1024, 768, 80))
        pelican.settings.setdefault('PHOTO_ARTICLE', (760, 506, 80))
        pelican.settings.setdefault('PHOTO_THUMB', (192, 144, 60))
Exemplo n.º 26
0
def twitter_card(generator):
    """
     https://dev.twitter.com/cards
     TWITTER_CARD_USE = (True) # (False)
     TWITTER_CARD_SITE = '@website' # The site's Twitter handle like @my_blog
     TWITTER_CARD_SITE_ID = 123456 # The site's Twitter ID
     TWITTER_CARD_CREATOR = '@username' # Your twitter handle like @yourtwitname
     TWITTER_CARD_CREATOR_ID = 56789 # The site creator's id
     GRAVATAR_URL = ''
    """

    DEFAULT_CONFIG.setdefault('TWITTER_CARD_SITE', '')
    DEFAULT_CONFIG.setdefault('TWITTER_CARD_SITE_ID', '')
    DEFAULT_CONFIG.setdefault('TWITTER_CARD_CREATOR', '')
    DEFAULT_CONFIG.setdefault('TWITTER_CARD_CREATOR_ID', '')
    DEFAULT_CONFIG.setdefault('GRAVATAR_URL', '')
Exemplo n.º 27
0
def twitter_card(generator):
    """
     https://dev.twitter.com/cards
     TWITTER_CARD_USE = (True) # (False)
     TWITTER_CARD_SITE = '@website' # The site's Twitter handle like @my_blog
     TWITTER_CARD_SITE_ID = 123456 # The site's Twitter ID
     TWITTER_CARD_CREATOR = '@username' # Your twitter handle like @yourtwitname
     TWITTER_CARD_CREATOR_ID = 56789 # The site creator's id
     GRAVATAR_URL = ''
    """

    DEFAULT_CONFIG.setdefault('TWITTER_CARD_SITE', '')
    DEFAULT_CONFIG.setdefault('TWITTER_CARD_SITE_ID', '')
    DEFAULT_CONFIG.setdefault('TWITTER_CARD_CREATOR', '')
    DEFAULT_CONFIG.setdefault('TWITTER_CARD_CREATOR_ID', '')
    DEFAULT_CONFIG.setdefault('GRAVATAR_URL', '')
Exemplo n.º 28
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('AUTOSUMMARY_KEEP_HTMLTAGS',
                              ('a', 'font', 's', 'strong', 'em', 'u', 'b'))
    DEFAULT_CONFIG.setdefault('AUTOSUMMARY_REPLACE_HTMLTAGS',
                              {'h[2-9]': 'strong'})
    DEFAULT_CONFIG.setdefault('AUTOSUMMARY_DELETE_HTMLTAGS', ['h1'])
    DEFAULT_CONFIG.setdefault('AUTOSUMMARY_MAX_LENGTH', 140)
    DEFAULT_CONFIG.setdefault('AUTOSUMMARY_MIN_LENGTH', 1)
    if pelican:
        pelican.settings.setdefault(
            'AUTOSUMMARY_KEEP_HTMLTAGS',
            ('a', 'font', 's', 'strong', 'em', 'u', 'b'))
        pelican.settings.setdefault('AUTOSUMMARY_REPLACE_HTMLTAGS',
                                    {'h[2-9]': 'strong'})
        pelican.settings.setdefault('AUTOSUMMARY_DELETE_HTMLTAGS', ['h1'])
        pelican.settings.setdefault('AUTOSUMMARY_MAX_LENGTH', 140)
        pelican.settings.setdefault('AUTOSUMMARY_MIN_LENGTH', 1)
Exemplo n.º 29
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault(
        'HTMLMINIFY_FILE_EXTENSIONS',
        ['html', 'htm']
    )
    DEFAULT_CONFIG.setdefault(
        'HTMLMINIFY_SETTINGS',
        {}
    )
    if pelican:
        pelican.settings.setdefault(
            'HTMLMINIFY_FILE_EXTENSIONS',
            DEFAULT_CONFIG['HTMLMINIFY_FILE_EXTENSIONS']
        )
        pelican.settings.setdefault(
            'HTMLMINIFY_SETTINGS',
            DEFAULT_CONFIG['HTMLMINIFY_SETTINGS']
        )
Exemplo n.º 30
0
def initialized(pelican):
    p = os.path.expanduser('~/github/blog/content/')
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('PHOTO_LIBRARY', p)
    DEFAULT_CONFIG.setdefault('PHOTO_GALLERY', (1024, 768, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_ARTICLE', (760, 506, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_THUMB', (192, 144, 60))
    if pelican:
        pelican.settings.setdefault('PHOTO_LIBRARY', p)
        pelican.settings.setdefault('PHOTO_GALLERY', (1024, 768, 80))
        pelican.settings.setdefault('PHOTO_ARTICLE', (760, 506, 80))
        pelican.settings.setdefault('PHOTO_THUMB', (192, 144, 60))
Exemplo n.º 31
0
def initialized(pelican):
    p = os.path.expanduser("~/Pictures")
    from pelican.settings import DEFAULT_CONFIG

    DEFAULT_CONFIG.setdefault("PHOTO_LIBRARY", p)
    DEFAULT_CONFIG.setdefault("PHOTO_GALLERY", (1024, 768, 80))
    DEFAULT_CONFIG.setdefault("PHOTO_ARTICLE", (760, 506, 80))
    DEFAULT_CONFIG.setdefault("PHOTO_THUMB", (192, 144, 60))
    if pelican:
        pelican.settings.setdefault("PHOTO_LIBRARY", p)
        pelican.settings.setdefault("PHOTO_GALLERY", (1024, 768, 80))
        pelican.settings.setdefault("PHOTO_ARTICLE", (760, 506, 80))
        pelican.settings.setdefault("PHOTO_THUMB", (192, 144, 60))
Exemplo n.º 32
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('SUMMARY_BEGIN_MARKER',
                              '<!-- PELICAN_BEGIN_SUMMARY -->')
    DEFAULT_CONFIG.setdefault('SUMMARY_END_MARKER',
                              '<!-- PELICAN_END_SUMMARY -->')
    DEFAULT_CONFIG.setdefault('SUMMARY_USE_FIRST_PARAGRAPH', False)
    DEFAULT_CONFIG.setdefault('SUMMARY_REMOVE_META', 'removeSummary')
    if pelican:
        pelican.settings.setdefault('SUMMARY_BEGIN_MARKER',
                                    '<!-- PELICAN_BEGIN_SUMMARY -->')
        pelican.settings.setdefault('SUMMARY_END_MARKER',
                                    '<!-- PELICAN_END_SUMMARY -->')
        pelican.settings.setdefault('SUMMARY_USE_FIRST_PARAGRAPH', False)
        pelican.settings.setdefault('SUMMARY_REMOVE_META', False)
Exemplo n.º 33
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG

    DEFAULT_CONFIG.setdefault(WEBRING_FEED_URLS_STR, [])
    DEFAULT_CONFIG.setdefault(WEBRING_MAX_ARTICLES_STR, 3)
    DEFAULT_CONFIG.setdefault(WEBRING_ARTICLES_PER_FEED_STR, 1)
    DEFAULT_CONFIG.setdefault(WEBRING_SUMMARY_WORDS_STR, 20)
    DEFAULT_CONFIG.setdefault(WEBRING_CLEAN_SUMMARY_HTML_STR, True)
    if pelican:
        # Check deprecated settings
        if "WEBRING_SUMMARY_LENGTH" in pelican.settings:
            warning(
                "webring plugin: '%s' has been deprecated by '%s'",
                "WEBRING_SUMMARY_LENGTH",
                "WEBRING_SUMMARY_WORDS",
            )
        # Set default values for unset settings
        for name, value in DEFAULT_CONFIG.items():
            if name.startswith("WEBRING"):
                pelican.settings.setdefault(name, value)
    # save global settings
    global settings
    settings = pelican.settings if pelican else DEFAULT_CONFIG
Exemplo n.º 34
0
def defaultsettings(pelicanobj):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('ARTICLE_EXCLUDES_DIRNAMES', [])
    DEFAULT_CONFIG.setdefault('PAGE_EXCLUDES_DIRNAMES', [])
    DEFAULT_CONFIG.setdefault('STATIC_EXCLUDES_DIRNAMES', [])
    if pelicanobj:
        pelicanobj.settings.setdefault('ARTICLE_EXCLUDES_DIRNAMES', [])
        pelicanobj.settings.setdefault('PAGE_EXCLUDES_DIRNAMES', [])
        pelicanobj.settings.setdefault('STATIC_EXCLUDES_DIRNAMES', [])
Exemplo n.º 35
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('SUMMARY_BEGIN_MARKER',
                              '<!-- PELICAN_BEGIN_SUMMARY -->')
    DEFAULT_CONFIG.setdefault('SUMMARY_END_MARKER',
                              '<!-- PELICAN_END_SUMMARY -->')
    DEFAULT_CONFIG.setdefault('SUMMARY_USE_FIRST_PARAGRAPH', False)
    if pelican:
        pelican.settings.setdefault('SUMMARY_BEGIN_MARKER',
                                    '<!-- PELICAN_BEGIN_SUMMARY -->')
        pelican.settings.setdefault('SUMMARY_END_MARKER',
                                    '<!-- PELICAN_END_SUMMARY -->')
        pelican.settings.setdefault('SUMMARY_USE_FIRST_PARAGRAPH', False)
Exemplo n.º 36
0
def initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG

    DEFAULT_CONFIG.setdefault("SUMMARY_BEGIN_MARKER",
                              "<!-- PELICAN_BEGIN_SUMMARY -->")
    DEFAULT_CONFIG.setdefault("SUMMARY_END_MARKER",
                              "<!-- PELICAN_END_SUMMARY -->")
    DEFAULT_CONFIG.setdefault("SUMMARY_USE_FIRST_PARAGRAPH", False)
    if pelican:
        pelican.settings.setdefault("SUMMARY_BEGIN_MARKER",
                                    "<!-- PELICAN_BEGIN_SUMMARY -->")
        pelican.settings.setdefault("SUMMARY_END_MARKER",
                                    "<!-- PELICAN_END_SUMMARY -->")
        pelican.settings.setdefault("SUMMARY_USE_FIRST_PARAGRAPH", False)
Exemplo n.º 37
0
def initialized(pelican):
    """Initializes default variables and then checks for changes to the default in the pelican.conf

    Args:
        pelican ([string]): [parameter takes in all the set variables in the pelican.conf]
    """

    DEFAULT_CONFIG.setdefault("UNIT_SYSTEM", "SI")
    DEFAULT_CONFIG.setdefault("UNIT_PRECISION", 2)
    DEFAULT_CONFIG.setdefault("UNIT_HTML_WRAPPER", "{unit} (<em>{converted}</em>)")

    if pelican:
        pelican.settings.setdefault("UNIT_SYSTEM", "SI")
        pelican.settings.setdefault("UNIT_PRECISION", 2)
        pelican.settings.setdefault(
            "UNIT_HTML_WRAPPER", "{unit} (<em>{converted}</em>)"
        )
def pelican_initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG

    DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM", False)
    DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_DIR" "comments")
    DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_OUTPUT_PATH" "images/identicon")
    DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_DATA", ())
    DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE", 72)
    DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_AUTHORS", {})
    DEFAULT_CONFIG.setdefault("PELICAN_COMMENT_SYSTEM_FEED", os.path.join("feeds", "comment.%s.atom.xml"))
    DEFAULT_CONFIG.setdefault("COMMENT_URL", "#comment-{path}")
    if pelican:
        pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM", False)
        pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_DIR", "comments")
        pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_OUTPUT_PATH", "images/identicon")
        pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_DATA", ())
        pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE", 72)
        pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_AUTHORS", {})
        pelican.settings.setdefault("PELICAN_COMMENT_SYSTEM_FEED", os.path.join("feeds", "comment.%s.atom.xml"))
        pelican.settings.setdefault("COMMENT_URL", "#comment-{path}")
Exemplo n.º 39
0
def initialized(pelican):

    p = os.path.expanduser('~/Pictures')

    DEFAULT_CONFIG.setdefault('PHOTO_LIBRARY', p)
    DEFAULT_CONFIG.setdefault('PHOTO_GALLERY', (1024, 768, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_ARTICLE', (760, 506, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_THUMB', (192, 144, 60))
    DEFAULT_CONFIG.setdefault('PHOTO_GALLERY_TITLE', '')
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK', 'False')
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_TEXT', DEFAULT_CONFIG['SITENAME'])
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_IMG', '')
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_IMG_SIZE', (64, 64))
    DEFAULT_CONFIG.setdefault('PHOTO_RESIZE_JOBS', 1)

    DEFAULT_CONFIG['queue_resize'] = {}
    DEFAULT_CONFIG['created_galleries'] = {}

    if pelican:
        pelican.settings.setdefault('PHOTO_LIBRARY', p)
        pelican.settings.setdefault('PHOTO_GALLERY', (1024, 768, 80))
        pelican.settings.setdefault('PHOTO_ARTICLE', (760, 506, 80))
        pelican.settings.setdefault('PHOTO_THUMB', (192, 144, 60))
        pelican.settings.setdefault('PHOTO_GALLERY_TITLE', '')
        pelican.settings.setdefault('PHOTO_WATERMARK', 'False')
        pelican.settings.setdefault('PHOTO_WATERMARK_TEXT', pelican.settings['SITENAME'])
        pelican.settings.setdefault('PHOTO_WATERMARK_IMG', '')
        pelican.settings.setdefault('PHOTO_WATERMARK_IMG_SIZE', (64, 64))
        pelican.settings.setdefault('PHOTO_RESIZE_JOBS', 1)
Exemplo n.º 40
0
 def initialize(self, pelican):
     default_path = path.join(pelican.path, "images")
     DEFAULT_CONFIG.setdefault('ORG_ASSETS_PATH',
                               default_path)
     if pelican.settings.get("ORG_ASSETS_PATH"):
         self.__org_assets_path = pelican.settings.get("ORG_ASSETS_PATH")
def pelican_initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM', False)
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_DIR', 'comments')
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_OUTPUT_PATH' 'images/identicon')
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_DATA', ())
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE', 72)
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_AUTHORS', {})
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_FEED', os.path.join('feeds', 'comment.%s.atom.xml'))
    DEFAULT_CONFIG.setdefault('COMMENT_URL', '#comment-{slug}')
    DEFAULT_CONFIG['PAGE_EXCLUDES'].append(DEFAULT_CONFIG['PELICAN_COMMENT_SYSTEM_DIR'])
    DEFAULT_CONFIG['ARTICLE_EXCLUDES'].append(DEFAULT_CONFIG['PELICAN_COMMENT_SYSTEM_DIR'])
    if pelican:
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM', False)
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_DIR', 'comments')
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_OUTPUT_PATH', 'images/identicon')
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_DATA', ())
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE', 72)
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_AUTHORS', {})
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_FEED', os.path.join('feeds', 'comment.%s.atom.xml'))
        pelican.settings.setdefault('COMMENT_URL', '#comment-{slug}')

        pelican.settings['PAGE_EXCLUDES'].append(pelican.settings['PELICAN_COMMENT_SYSTEM_DIR'])
        pelican.settings['ARTICLE_EXCLUDES'].append(pelican.settings['PELICAN_COMMENT_SYSTEM_DIR'])
Exemplo n.º 42
0
def initialized(pelican):

    p = os.path.expanduser('~/Pictures')

    DEFAULT_CONFIG.setdefault('PHOTO_LIBRARY', p)
    DEFAULT_CONFIG.setdefault('PHOTO_GALLERY', (1024, 768, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_ARTICLE', (760, 506, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_THUMB', (192, 144, 60))
    DEFAULT_CONFIG.setdefault('PHOTO_GALLERY_TITLE', '')
    DEFAULT_CONFIG.setdefault('PHOTO_ALPHA_BACKGROUND_COLOR', (255, 255, 255))
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK', False)
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_THUMB', False)
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_TEXT', DEFAULT_CONFIG['SITENAME'])
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_TEXT_COLOR', (255, 255, 255))
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_IMG', '')
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_IMG_SIZE', False)
    DEFAULT_CONFIG.setdefault('PHOTO_RESIZE_JOBS', 1)
    DEFAULT_CONFIG.setdefault('PHOTO_EXIF_KEEP', False)
    DEFAULT_CONFIG.setdefault('PHOTO_EXIF_REMOVE_GPS', False)
    DEFAULT_CONFIG.setdefault('PHOTO_EXIF_AUTOROTATE', True)
    DEFAULT_CONFIG.setdefault('PHOTO_EXIF_COPYRIGHT', False)
    DEFAULT_CONFIG.setdefault('PHOTO_EXIF_COPYRIGHT_AUTHOR', DEFAULT_CONFIG['SITENAME'])
    DEFAULT_CONFIG.setdefault('PHOTO_LIGHTBOX_GALLERY_ATTR', 'data-lightbox')
    DEFAULT_CONFIG.setdefault('PHOTO_LIGHTBOX_CAPTION_ATTR', 'data-title')

    DEFAULT_CONFIG['queue_resize'] = {}
    DEFAULT_CONFIG['created_galleries'] = {}
    DEFAULT_CONFIG['plugin_dir'] = os.path.dirname(os.path.realpath(__file__))

    if pelican:
        pelican.settings.setdefault('PHOTO_LIBRARY', p)
        pelican.settings.setdefault('PHOTO_GALLERY', (1024, 768, 80))
        pelican.settings.setdefault('PHOTO_ARTICLE', (760, 506, 80))
        pelican.settings.setdefault('PHOTO_THUMB', (192, 144, 60))
        pelican.settings.setdefault('PHOTO_GALLERY_TITLE', '')
        pelican.settings.setdefault('PHOTO_ALPHA_BACKGROUND_COLOR', (255, 255, 255))
        pelican.settings.setdefault('PHOTO_WATERMARK', False)
        pelican.settings.setdefault('PHOTO_WATERMARK_THUMB', False)
        pelican.settings.setdefault('PHOTO_WATERMARK_TEXT', pelican.settings['SITENAME'])
        pelican.settings.setdefault('PHOTO_WATERMARK_TEXT_COLOR', (255, 255, 255))
        pelican.settings.setdefault('PHOTO_WATERMARK_IMG', '')
        pelican.settings.setdefault('PHOTO_WATERMARK_IMG_SIZE', False)
        pelican.settings.setdefault('PHOTO_RESIZE_JOBS', 1)
        pelican.settings.setdefault('PHOTO_EXIF_KEEP', False)
        pelican.settings.setdefault('PHOTO_EXIF_REMOVE_GPS', False)
        pelican.settings.setdefault('PHOTO_EXIF_AUTOROTATE', True)
        pelican.settings.setdefault('PHOTO_EXIF_COPYRIGHT', False)
        pelican.settings.setdefault('PHOTO_EXIF_COPYRIGHT_AUTHOR', pelican.settings['AUTHOR'])
        pelican.settings.setdefault('PHOTO_LIGHTBOX_GALLERY_ATTR', 'data-lightbox')
        pelican.settings.setdefault('PHOTO_LIGHTBOX_CAPTION_ATTR', 'data-title')
Exemplo n.º 43
0
def initialized(pelican):
    p = os.path.expanduser("~/Pictures")

    DEFAULT_CONFIG.setdefault("PHOTO_LIBRARY", p)
    DEFAULT_CONFIG.setdefault("PHOTO_GALLERY", (1024, 768, 80))
    DEFAULT_CONFIG.setdefault("PHOTO_ARTICLE", (760, 506, 80))
    DEFAULT_CONFIG.setdefault("PHOTO_THUMB", (192, 144, 60))
    DEFAULT_CONFIG.setdefault("PHOTO_SQUARE_THUMB", False)
    DEFAULT_CONFIG.setdefault("PHOTO_GALLERY_TITLE", "")
    DEFAULT_CONFIG.setdefault("PHOTO_ALPHA_BACKGROUND_COLOR", (255, 255, 255))
    DEFAULT_CONFIG.setdefault("PHOTO_WATERMARK", False)
    DEFAULT_CONFIG.setdefault("PHOTO_WATERMARK_THUMB", False)
    DEFAULT_CONFIG.setdefault("PHOTO_WATERMARK_TEXT",
                              DEFAULT_CONFIG["SITENAME"])
    DEFAULT_CONFIG.setdefault("PHOTO_WATERMARK_TEXT_COLOR", (255, 255, 255))
    DEFAULT_CONFIG.setdefault("PHOTO_WATERMARK_IMG", "")
    DEFAULT_CONFIG.setdefault("PHOTO_WATERMARK_IMG_SIZE", False)
    DEFAULT_CONFIG.setdefault("PHOTO_RESIZE_JOBS", 1)
    DEFAULT_CONFIG.setdefault("PHOTO_EXIF_KEEP", False)
    DEFAULT_CONFIG.setdefault("PHOTO_EXIF_REMOVE_GPS", False)
    DEFAULT_CONFIG.setdefault("PHOTO_EXIF_AUTOROTATE", True)
    DEFAULT_CONFIG.setdefault("PHOTO_EXIF_COPYRIGHT", False)
    DEFAULT_CONFIG.setdefault("PHOTO_EXIF_COPYRIGHT_AUTHOR",
                              DEFAULT_CONFIG["SITENAME"])
    DEFAULT_CONFIG.setdefault("PHOTO_LIGHTBOX_GALLERY_ATTR", "data-lightbox")
    DEFAULT_CONFIG.setdefault("PHOTO_LIGHTBOX_CAPTION_ATTR", "data-title")

    DEFAULT_CONFIG["queue_resize"] = {}
    DEFAULT_CONFIG["created_galleries"] = {}
    DEFAULT_CONFIG["plugin_dir"] = os.path.dirname(os.path.realpath(__file__))

    if pelican:
        pelican.settings.setdefault("PHOTO_LIBRARY", p)
        pelican.settings.setdefault("PHOTO_GALLERY", (1024, 768, 80))
        pelican.settings.setdefault("PHOTO_ARTICLE", (760, 506, 80))
        pelican.settings.setdefault("PHOTO_THUMB", (192, 144, 60))
        pelican.settings.setdefault("PHOTO_SQUARE_THUMB", False)
        pelican.settings.setdefault("PHOTO_GALLERY_TITLE", "")
        pelican.settings.setdefault("PHOTO_ALPHA_BACKGROUND_COLOR",
                                    (255, 255, 255))
        pelican.settings.setdefault("PHOTO_WATERMARK", False)
        pelican.settings.setdefault("PHOTO_WATERMARK_THUMB", False)
        pelican.settings.setdefault("PHOTO_WATERMARK_TEXT",
                                    pelican.settings["SITENAME"])
        pelican.settings.setdefault("PHOTO_WATERMARK_TEXT_COLOR",
                                    (255, 255, 255))
        pelican.settings.setdefault("PHOTO_WATERMARK_IMG", "")
        pelican.settings.setdefault("PHOTO_WATERMARK_IMG_SIZE", False)
        pelican.settings.setdefault("PHOTO_RESIZE_JOBS", 1)
        pelican.settings.setdefault("PHOTO_EXIF_KEEP", False)
        pelican.settings.setdefault("PHOTO_EXIF_REMOVE_GPS", False)
        pelican.settings.setdefault("PHOTO_EXIF_AUTOROTATE", True)
        pelican.settings.setdefault("PHOTO_EXIF_COPYRIGHT", False)
        pelican.settings.setdefault("PHOTO_EXIF_COPYRIGHT_AUTHOR",
                                    pelican.settings["AUTHOR"])
        pelican.settings.setdefault("PHOTO_LIGHTBOX_GALLERY_ATTR",
                                    "data-lightbox")
        pelican.settings.setdefault("PHOTO_LIGHTBOX_CAPTION_ATTR",
                                    "data-title")
Exemplo n.º 44
0
def initialized(pelican):

    p = os.path.expanduser('~/Pictures')

    DEFAULT_CONFIG.setdefault('PHOTO_LIBRARY', p)
    DEFAULT_CONFIG.setdefault('PHOTO_GALLERY', (1024, 768, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_ARTICLE', (760, 506, 80))
    DEFAULT_CONFIG.setdefault('PHOTO_THUMB', (192, 144, 60))
    DEFAULT_CONFIG.setdefault('PHOTO_GALLERY_TITLE', '')
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK', 'False')
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_TEXT', DEFAULT_CONFIG['SITENAME'])
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_IMG', '')
    DEFAULT_CONFIG.setdefault('PHOTO_WATERMARK_IMG_SIZE', (64, 64))
    DEFAULT_CONFIG.setdefault('PHOTO_RESIZE_JOBS', 1)

    DEFAULT_CONFIG['queue_resize'] = {}
    DEFAULT_CONFIG['created_galleries'] = {}

    if pelican:
        pelican.settings.setdefault('PHOTO_LIBRARY', p)
        pelican.settings.setdefault('PHOTO_GALLERY', (1024, 768, 80))
        pelican.settings.setdefault('PHOTO_ARTICLE', (760, 506, 80))
        pelican.settings.setdefault('PHOTO_THUMB', (192, 144, 60))
        pelican.settings.setdefault('PHOTO_GALLERY_TITLE', '')
        pelican.settings.setdefault('PHOTO_WATERMARK', 'False')
        pelican.settings.setdefault('PHOTO_WATERMARK_TEXT', pelican.settings['SITENAME'])
        pelican.settings.setdefault('PHOTO_WATERMARK_IMG', '')
        pelican.settings.setdefault('PHOTO_WATERMARK_IMG_SIZE', (64, 64))
        pelican.settings.setdefault('PHOTO_RESIZE_JOBS', 1)
Exemplo n.º 45
0
def initialized(pelican):

    DEFAULT_CONFIG.setdefault('CASCADE_CSS', {})

    if pelican:
        pelican.settings.setdefault('CASCADE_CSS', {})
def pelican_initialized(pelican):
    from pelican.settings import DEFAULT_CONFIG
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM', False)
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_DIR', 'comments')
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_OUTPUT_PATH'
                              'images/identicon')
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_DATA', ())
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE', 72)
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_AUTHORS', {})
    DEFAULT_CONFIG.setdefault('PELICAN_COMMENT_SYSTEM_FEED',
                              os.path.join('feeds', 'comment.%s.atom.xml'))
    DEFAULT_CONFIG.setdefault('COMMENT_URL', '#comment-{slug}')
    DEFAULT_CONFIG['PAGE_EXCLUDES'].append(
        DEFAULT_CONFIG['PELICAN_COMMENT_SYSTEM_DIR'])
    DEFAULT_CONFIG['ARTICLE_EXCLUDES'].append(
        DEFAULT_CONFIG['PELICAN_COMMENT_SYSTEM_DIR'])
    if pelican:
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM', False)
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_DIR', 'comments')
        pelican.settings.setdefault(
            'PELICAN_COMMENT_SYSTEM_IDENTICON_OUTPUT_PATH', 'images/identicon')
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_DATA',
                                    ())
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_IDENTICON_SIZE',
                                    72)
        pelican.settings.setdefault('PELICAN_COMMENT_SYSTEM_AUTHORS', {})
        pelican.settings.setdefault(
            'PELICAN_COMMENT_SYSTEM_FEED',
            os.path.join('feeds', 'comment.%s.atom.xml'))
        pelican.settings.setdefault('COMMENT_URL', '#comment-{slug}')

        pelican.settings['PAGE_EXCLUDES'].append(
            pelican.settings['PELICAN_COMMENT_SYSTEM_DIR'])
        pelican.settings['ARTICLE_EXCLUDES'].append(
            pelican.settings['PELICAN_COMMENT_SYSTEM_DIR'])
Exemplo n.º 47
0
def initialized(pelican):
    DEFAULT_CONFIG.setdefault("FEED_FILTER", {})
    if pelican:
        pelican.settings.setdefault("FEED_FILTER", {})