-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
custom css for single post #227
Comments
Seems like most of your issue is getting the paths sorted out. Basically, in Jekyll-land anything that is in a This is why all of the What you want is to change that to is the destination folder of the CSS files. That's easy to check if you look in your The other part that might be causing you confusion is The exception would be if you're referencing variables in a If you had I think once you sort out how Jekyll reads files and where it outputs them you'll have a better handle on how to pull in pieces across your posts and pages. When in doubt view source of the compiled HTML pages to see what paths are being rendered. It'll give you a clue as to where Jekyll is looking. Could be relative URL issues too. I almost always opt for absolute because depending on how you're using I'd suggest asking for further help on talk.jekyll.com forum since this seems like Jekyll 101 stuff vs. anything to directly do with the theme. |
Thank you very much for the detailed response! I'll follow your suggestions. |
Hi, I apologise if this is a silly question, I use R for data analysis, and I am definitely not an expert on css and html.
I'm trying to include a custom css file for a specific blog post (it has a certain background that I'd like to use, a different font for the title and some different highlighting colours) and I cannot get this to appear on the post when I serve the draft, or the _posts version.
I tried the following:
1: include this in
_layouts/post.html
: (where_source
is my folder that I'm putting the R markdown files into, that I later convert to .md)as well as changing
page.
topost.
in the above code. Then in the .md draft I havecustom_css:
as a YAML field with the css file I'm trying to use.2: Include the same thing in
_layouts/page.html
.I know that here you show some ways we can modify the theme, but it seems to be for the theme as a whole, whereas I only want to do this for a specific post (and again with different .css files for different posts in the future).
When I run
bundle exec jekyll serve --drafts
, it not only does not render the css I'm looking for, but gives me this error:So jekyll is looking in a folder that doesn't exist.
3: I then tried changing
_config.yml
so that the permalink is not/:categories/:title/
, but that just seems to make a whole mess ("communism" is the name of the .Rmd file, the images are results of R code and would ideally be in the_source
folder too).Is there any way to do this? I have a feeling it's related to
baseurl:
in the config file, but I'm not sure how to set it correctly.Thanks.
The text was updated successfully, but these errors were encountered: