Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,21 @@ EXTRA_PATH_METADATA = {
}
```

CSS files can also be prevented from being included in the base template by
adding and an `exclude` key-value pair. For example, in your `pelicanconf.py`:

```python
# Static files
STATIC_PATHS = [
'extra',
...
]
EXTRA_PATH_METADATA = {
'extra/custom.css': {'path': 'custom.css', 'exclude': True},
...
}
```

In use
------

Expand Down
2 changes: 1 addition & 1 deletion bulrush/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% endassets %}
<style media="print">.is-hidden-print{display:none !important}</style>
{% for extra_path in EXTRA_PATH_METADATA.values() %}
{% if extra_path.get('path', '').endswith('.css') %}
{% if extra_path.get('path', '').endswith('.css') and not extra_path.get('exclude', False) %}
<link rel="stylesheet" href="{{ SITEURL }}/{{ extra_path['path'] }}">
{% endif %}
{% endfor %}
Expand Down