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

Add exclude option for css files #37

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jay3ss
Copy link

@jay3ss jay3ss commented May 27, 2023

I have a somewhat unusual use case in that I have CSS files that I don't want all CSS files included everywhere in the site which is the current behavior of bulrush. This PR allows the exclusion of CSS files that were added to the EXTRA_PATH_METADATA dict to be ignored if an 'exclude': True key-value pair is added. If that key-value pair isn't added then the theme operates as before.

@textbook
Copy link
Owner

I'm not sure I understand the use case - if you want to have a CSS file included in the output but not injected into the HTML, couldn't you just not add it to EXTRA_PATH_METADATA? I.e. for your example:

# Static files
STATIC_PATHS = [
    'extra',
    # ...
]
EXTRA_PATH_METADATA = {
    # ...
}

then content/extra/custom.css just ends up in output/extra/custom.css.

@jay3ss
Copy link
Author

jay3ss commented May 28, 2023

Maybe this has to do with my limited understanding how Pelican works. I had a situation in which I wanted to include a JavaScript app in the output that I had written. That app has CSS files that were meant to be used only on that one page. The only way that I could get the app to be included in the output was to include it in EXTRA_PATH_METADATA (including the CSS files). The styling in those files overrode my site's styling which was undesirable. This was the only way that I could figure out how to include the app and its CSS files without it affecting the rest of the site

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

Successfully merging this pull request may close these issues.

2 participants