mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #970 from russkel/themestaticdir
added THEME_STATIC_DIR setting
This commit is contained in:
commit
1cebd345aa
4 changed files with 7 additions and 2 deletions
|
|
@ -547,6 +547,9 @@ Setting name (default value) What does it do?
|
||||||
or absolute path to a theme folder, or the name of a
|
or absolute path to a theme folder, or the name of a
|
||||||
default theme or a theme installed via
|
default theme or a theme installed via
|
||||||
``pelican-themes`` (see below).
|
``pelican-themes`` (see below).
|
||||||
|
`THEME_STATIC_DIR` (``'theme'``) Destination directory in the output path where
|
||||||
|
Pelican will place the files collected from
|
||||||
|
`THEME_STATIC_PATHS`. Default is `theme`.
|
||||||
`THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default
|
`THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default
|
||||||
value is `static`, but if your theme has
|
value is `static`, but if your theme has
|
||||||
other static paths, you can put them here.
|
other static paths, you can put them here.
|
||||||
|
|
|
||||||
|
|
@ -564,7 +564,8 @@ class StaticGenerator(Generator):
|
||||||
|
|
||||||
def generate_output(self, writer):
|
def generate_output(self, writer):
|
||||||
self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme,
|
self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme,
|
||||||
'theme', self.output_path, os.curdir)
|
self.settings['THEME_STATIC_DIR'], self.output_path,
|
||||||
|
os.curdir)
|
||||||
# copy all Static files
|
# copy all Static files
|
||||||
for sc in self.staticfiles:
|
for sc in self.staticfiles:
|
||||||
source_path = os.path.join(self.path, sc.source_path)
|
source_path = os.path.join(self.path, sc.source_path)
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ DEFAULT_CONFIG = {
|
||||||
'OUTPUT_PATH': 'output',
|
'OUTPUT_PATH': 'output',
|
||||||
'MARKUP': ('rst', 'md'),
|
'MARKUP': ('rst', 'md'),
|
||||||
'STATIC_PATHS': ['images', ],
|
'STATIC_PATHS': ['images', ],
|
||||||
|
'THEME_STATIC_DIR': 'theme',
|
||||||
'THEME_STATIC_PATHS': ['static', ],
|
'THEME_STATIC_PATHS': ['static', ],
|
||||||
'FEED_ALL_ATOM': os.path.join('feeds', 'all.atom.xml'),
|
'FEED_ALL_ATOM': os.path.join('feeds', 'all.atom.xml'),
|
||||||
'CATEGORY_FEED_ATOM': os.path.join('feeds', '%s.atom.xml'),
|
'CATEGORY_FEED_ATOM': os.path.join('feeds', '%s.atom.xml'),
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>{% block title %}{{ SITENAME }}{%endblock%}</title>
|
<title>{% block title %}{{ SITENAME }}{%endblock%}</title>
|
||||||
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/{{ CSS_FILE }}">
|
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/{{ CSS_FILE }}">
|
||||||
{% if FEED_ALL_ATOM %}
|
{% if FEED_ALL_ATOM %}
|
||||||
<link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
|
<link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue