The asset_url needs to use also theme_static_dir
Sorry for this mistake, I was using harcoded paths in my template. If the destination changes in the output folder (`THEME_STATIC_DIR`) also the URL used for the assets should change.
This commit is contained in:
@@ -38,10 +38,10 @@ def add_jinja2_ext(pelican):
|
|||||||
def create_assets_env(generator):
|
def create_assets_env(generator):
|
||||||
"""Define the assets environment and pass it to the generator."""
|
"""Define the assets environment and pass it to the generator."""
|
||||||
|
|
||||||
assets_url = 'theme/'
|
|
||||||
theme_static_dir = generator.settings['THEME_STATIC_DIR']
|
theme_static_dir = generator.settings['THEME_STATIC_DIR']
|
||||||
assets_src = os.path.join(generator.output_path, theme_static_dir)
|
assets_src = os.path.join(generator.output_path, theme_static_dir)
|
||||||
generator.env.assets_environment = Environment(assets_src, assets_url)
|
generator.env.assets_environment = Environment(
|
||||||
|
assets_src, theme_static_dir)
|
||||||
|
|
||||||
if 'ASSET_CONFIG' in generator.settings:
|
if 'ASSET_CONFIG' in generator.settings:
|
||||||
for item in generator.settings['ASSET_CONFIG']:
|
for item in generator.settings['ASSET_CONFIG']:
|
||||||
|
|||||||
Reference in New Issue
Block a user