modified:   pelicanconf.py
This commit is contained in:
Russell Ballestrini 2025-03-28 22:32:10 -04:00
parent 520bdfe1ac
commit e5038b4c67

View file

@ -5,49 +5,53 @@ from __future__ import unicode_literals
from os import environ from os import environ
DEFAULTS = { DEFAULTS = {
'AUTHOR' : u'Russell Ballestrini', "AUTHOR": "Russell Ballestrini",
'SITENAME' : u'Russell Ballestrini', "SITENAME": "Russell Ballestrini",
'SITEURL' : 'http://127.0.0.1:8000', "SITEURL": "http://127.0.0.1:8000",
#'THEME' : 'pelican-themes/svbhack', #'THEME' : 'pelican-themes/svbhack',
'THEME' : 'pelican-themes/pelican-svbhack', "THEME": "pelican-themes/pelican-svbhack",
'GOOGLE_ANALYTICS' : '', "GOOGLE_ANALYTICS": "",
'PLAUSIBLE_ANALYTICS' : '', "PLAUSIBLE_ANALYTICS": "",
'REMARKBOX' : None, "REMARKBOX": None,
'LINKPEEK_APIKEY' : None, "LINKPEEK_APIKEY": None,
'LINKPEEK_SECRET' : None, "LINKPEEK_SECRET": None,
} }
def get_environ_or_default(key): def get_environ_or_default(key):
return environ.get(key, DEFAULTS[key]) return environ.get(key, DEFAULTS[key])
AUTHOR = get_environ_or_default('AUTHOR')
SITENAME = get_environ_or_default('SITENAME')
SITEURL = get_environ_or_default('SITEURL')
THEME = get_environ_or_default('THEME') AUTHOR = get_environ_or_default("AUTHOR")
SITENAME = get_environ_or_default("SITENAME")
SITEURL = get_environ_or_default("SITEURL")
GOOGLE_ANALYTICS = get_environ_or_default('GOOGLE_ANALYTICS') THEME = get_environ_or_default("THEME")
PLAUSIBLE_ANALYTICS = get_environ_or_default('PLAUSIBLE_ANALYTICS')
REMARKBOX = get_environ_or_default('REMARKBOX') GOOGLE_ANALYTICS = get_environ_or_default("GOOGLE_ANALYTICS")
PLAUSIBLE_ANALYTICS = get_environ_or_default("PLAUSIBLE_ANALYTICS")
LINKPEEK_APIKEY = get_environ_or_default('LINKPEEK_APIKEY') REMARKBOX = get_environ_or_default("REMARKBOX")
LINKPEEK_SECRET = get_environ_or_default('LINKPEEK_SECRET')
LINKPEEK_APIKEY = get_environ_or_default("LINKPEEK_APIKEY")
LINKPEEK_SECRET = get_environ_or_default("LINKPEEK_SECRET")
# Theme specific # Theme specific
USER_LOGO_URL = 'https://russell.ballestrini.net/uploads/profile/russell-ballestrini-2020.jpg' USER_LOGO_URL = (
"https://russell.ballestrini.net/uploads/profile/russell-ballestrini-2020.jpg"
)
TAGLINE = '<a href="/about" class="tagline">Grows Products & Services</a>' TAGLINE = '<a href="/about" class="tagline">Grows Products & Services</a>'
PATH = 'content' PATH = "content"
STATIC_PATHS = ['uploads'] STATIC_PATHS = ["uploads"]
TIMEZONE = 'America/New_York' TIMEZONE = "America/New_York"
DEFAULT_LANG = u'en' DEFAULT_LANG = "en"
# Atom all feed. # Atom all feed.
FEED_ALL_ATOM = 'feeds/all.atom.xml' FEED_ALL_ATOM = "feeds/all.atom.xml"
# Feed generation is usually not desired when developing # Feed generation is usually not desired when developing
CATEGORY_FEED_ATOM = None CATEGORY_FEED_ATOM = None
@ -57,39 +61,39 @@ AUTHOR_FEED_RSS = None
# Blogroll # Blogroll
LINKS = ( LINKS = (
#('Remarkbox', 'http://remarkbox.com/'), # ('Remarkbox', 'http://remarkbox.com/'),
#('LinkPeek', 'https://linkpeek.com/'), # ('LinkPeek', 'https://linkpeek.com/'),
) )
# Social widget # Social widget
SOCIAL = ( SOCIAL = (
('@russellbal', 'https://twitter.com/russellbal'), ("@russellbal", "https://twitter.com/russellbal"),
('github', 'https://github.com/russellballestrini'), ("github", "https://github.com/russellballestrini"),
('bitbucket', 'https://bitbucket.org/russellballestrini'), ("bitbucket", "https://bitbucket.org/russellballestrini"),
) )
DEFAULT_PAGINATION = False DEFAULT_PAGINATION = False
# Uncomment following line if you want document-relative URLs when developing # Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True # RELATIVE_URLS = True
DISPLAY_PAGES_ON_MENU = False DISPLAY_PAGES_ON_MENU = False
# teach pelican to use directory/index.html files # teach pelican to use directory/index.html files
ARTICLE_URL = '{slug}/' ARTICLE_URL = "{slug}/"
PAGE_URL = '{slug}/' PAGE_URL = "{slug}/"
CATEGORY_URL = 'category/{slug}/' CATEGORY_URL = "category/{slug}/"
TAG_URL = 'tags/{slug}/' TAG_URL = "tags/{slug}/"
AUTHOR_URL = 'author/{slug}/' AUTHOR_URL = "author/{slug}/"
RANDOM = 'random.html' RANDOM = "random.html"
# Adjust save location. # Adjust save location.
ARTICLE_SAVE_AS = '{slug}/index.html' ARTICLE_SAVE_AS = "{slug}/index.html"
PAGE_SAVE_AS = '{slug}/index.html' PAGE_SAVE_AS = "{slug}/index.html"
CATEGORY_SAVE_AS = 'category/{slug}/index.html' CATEGORY_SAVE_AS = "category/{slug}/index.html"
TAG_SAVE_AS = 'tags/{slug}/index.html' TAG_SAVE_AS = "tags/{slug}/index.html"
AUTHOR_SAVE_AS = 'author/{slug}/index.html' AUTHOR_SAVE_AS = "author/{slug}/index.html"
# Enable raw source files in output directory alongside index.html # Enable raw source files in output directory alongside index.html
# This copies the raw .rst files to the output # This copies the raw .rst files to the output
@ -98,18 +102,19 @@ OUTPUT_SOURCES_EXTENSION = '.rst'
# Setup filters and plugins. # Setup filters and plugins.
PLUGIN_PATHS = ['pelican-plugins'] PLUGIN_PATHS = ["pelican-plugins"]
PLUGINS = ['random_article'] PLUGINS = ["random_article"]
# register filters. # register filters.
#JINJA_FILTERS = {'linkpeek':linkpeek} # JINJA_FILTERS = {'linkpeek':linkpeek}
# register linkpeek docutils directive. # register linkpeek docutils directive.
import sys import sys
sys.path.append('lib')
sys.path.append("lib")
import rst_linkpeek import rst_linkpeek
linkpeek = rst_linkpeek.LinkPeek linkpeek = rst_linkpeek.LinkPeek
linkpeek.apikey = LINKPEEK_APIKEY linkpeek.apikey = LINKPEEK_APIKEY
linkpeek.secret = LINKPEEK_SECRET linkpeek.secret = LINKPEEK_SECRET
linkpeek.register() linkpeek.register()