Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
anlar opened this issue Nov 24, 2022 · 1 comment
Open

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

anlar opened this issue Nov 24, 2022 · 1 comment

Comments

@anlar
Copy link

anlar commented Nov 24, 2022

Versions

  • Pelican 4.8.0
  • pelican-i18n-subsites 0.9.0

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:

  • en: <link rel="stylesheet" href="/en/./theme/css/main.css" />
  • fr: <link rel="stylesheet" href="/fr/../en/theme/css/main.css" />

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
Copy link

As a workaround, configuring THEME_STATIC_DIR works:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants