getpelican / pelican-plugins

Collection of plugins for the Pelican static site generator
Other
1.39k stars 856 forks source link

[i18n_subsites] Incorrect reference to parent theme from subsites #1372

Open anlar opened 1 year ago

anlar commented 1 year ago

Versions

Details

When using i18n_subsites with the following pelicanconf.py:

AUTHOR = 'Author'
SITENAME = 'Site name'
SITEURL = ''

PATH = 'content'

TIMEZONE = 'Europe/Rome'

DEFAULT_LANG = 'en'

PLUGINS = ['i18n_subsites']

I18N_SUBSITES = {
    'en': {
        'SITENAME': 'Eng',
        'AUTHOR': 'Author Eng',
        },
    'fr': {
        'SITENAME': 'Fr',
        'AUTHOR': 'Author Fr'
        },
    }

It generates following content:

$ tree output/ -L 2
output/
├── archives.html
├── authors.html
├── categories.html
├── en
│   ├── archives.html
│   ├── authors.html
│   ├── categories.html
│   ├── feeds
│   ├── index.html
│   └── tags.html
├── feeds
│   └── all.atom.xml
├── fr
│   ├── archives.html
│   ├── authors.html
│   ├── categories.html
│   ├── feeds
│   ├── index.html
│   └── tags.html
├── index.html
├── tags.html
└── theme
    ├── css
    ├── fonts
    └── images

Problem is that each subsite refers to incorrect path for the theme:

So http://127.0.0.1:8000/ displays correct them but http://127.0.0.1:8000/en/ and http://127.0.0.1:8000/fr/ can't find CSS.

JulienPalard commented 1 year ago

As a workaround, configuring THEME_STATIC_DIR works:

I18N_SUBSITES = {
    'fr': {
        'SITENAME': 'Fr',
        'AUTHOR': 'Author Fr'
        'THEME_STATIC_DIR': '../theme'
        },
    }