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

Custom css is not applied by example config.toml #17

Closed
jlandowner opened this issue May 19, 2020 · 2 comments
Closed

Custom css is not applied by example config.toml #17

jlandowner opened this issue May 19, 2020 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jlandowner
Copy link

I found an incorrect example in config.toml.
I set custom css option as referenced in example exampleSite/config.toml, but it was not be applied.

[params]
	# Custom CSS applied to default styles.
	customCSS = "css/custom.css"

css is here.

$ ls -lR ./static 
static/css:
total 8
-rw-r--r--  1 jlandowner  staff  203  5 19 21:06 custom.css <- not applied

I found the generated link tag href is incorrect.

<link rel="stylesheet" type="text/css" media="screen" href="http://localhost:1313/css/css/custom.css">

This is because layouts/partials/head.html already specifies "css" in fixed path.

<!-- Use customcss if you like -->
  {{- if isset .Site.Params "customcss" -}}
  <link rel="stylesheet" type="text/css" media="screen" href="{{ .Site.BaseURL }}css/{{ .Site.Params.customCSS }}" />
  {{- end -}}

I got 2 options.

  1. remove "css" from exampleSite/config.toml
  2. remove "css" from layouts/partials/head.html

I feel 2 is good but 1 is better for compatibility.
What do you think?

@dataCobra dataCobra self-assigned this May 21, 2020
@dataCobra dataCobra added bug Something isn't working good first issue Good for newcomers labels May 21, 2020
@dataCobra
Copy link
Owner

Hey @jlandowner, thank you for the detailed information. 👍

I like the first option way more than the second. This might be a bit restricted
if you want a specific path for the customcss but in my opinion the path default
is where the css files should stay.

@jlandowner
Copy link
Author

Thank you for your reply and update.

And thank you for your good theme!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants