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 styles not loading #124

Closed
hacdias opened this issue Jul 18, 2017 · 26 comments
Closed

Custom styles not loading #124

hacdias opened this issue Jul 18, 2017 · 26 comments

Comments

@hacdias
Copy link
Member

hacdias commented Jul 18, 2017

From @bronzehedwick on August 1, 2016 21:33

Hello, thanks for the great plugin!

I am using filemanager in conjunction with the hugo plugin, and wanted to extend the CSS via the styles directive. However, my custom styles are not loaded when I restart Caddy.

Any help would be greatly appreciated!

I'm on OS X 10.10.5 using Caddy 0.9.0.

My Caddyfile looks like this:

localhost:2020
gzip
log log/caddy-access.log
root public
hugo
basicauth /admin "admin" "password"
filemanager  {
  show content
  on admin
  styles ./assets/css/filemanager.css
  frontmatter yaml
}

Note: Caddy does complain if I give a filepath to a non-existing css resource, so it does seem to be working on some level.

Thanks!

Copied from original issue: hacdias/filemanager-old#13

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

Hello! Thanks for using the plugin and reporting this. I'll check it out tomorrow morning. :)

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

Hello! Is that path relative to Caddyfile? Or to root?

If it is relative to root, try changing it to ./public/assets/css/filemanager.css.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 2, 2016 13:25

Thanks for the reply!

The path was relative to the Caddyfile, but the assets directory is used for SASS, and other things to compile from, so not directly available from the webserver.

I moved the file into static, so it would sync to public on a Hugo build; the file path is public/css/filemanager.css with the corresponding url at localhost:2020/css/filemanager.css.

I thought that might fix it, but sadly no dice.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

Hey!

What is the error you get?

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 2, 2016 18:28

I actually don't get an error; my custom styles just aren't loaded when I view the page.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

Can you check a thing? Open any page of file manager and view its source. Check if there is a <styles></styles> tag in the head.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 3, 2016 13:39

No <link> tag matching my file, I'm afraid. Here's a screenshot.

screen shot 2016-08-03 at 9 37 53 am

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

Hello!

Look at lines 11 to 13. I already know what the problem is :D Thanks.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

I just pushed a fix. If you can run this from source, please try it to check if it works now please. :D

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 3, 2016 14:53

Will do, thanks!

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 3, 2016 15:41

New to go, so perhaps I have a different problem with my environment, but after cloning this repo, and doing go get github.com/mholt/caddy/caddy and go get github.com/hacdias/caddy-filemanager then run go build inside the repo, I get this error:

# github.com/hacdias/caddy-filemanager/assets
../../gowork/src/github.com/hacdias/caddy-filemanager/assets/assets.go:19: undefined: Asset

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

Before go build execute go generate please.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 3, 2016 17:20

Still get the same error. Should I not have done go get github.com/hacdias/caddy-filemanager?

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

Oops.. I forgot to mention one thing. You have to run go generate in the folder where caddy-filemanager is located! Sorry :/

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

I added the file to the repository to avoid this problem in the future. But it is always recommended to execute go generate before building the package.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 4, 2016 19:13

I apologize, I can't seem to figure out how to compile a custom binary of caddy with the updated caddy-filemanager code... does go build output a binary somewhere in my go path?

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

Hey @bronzehedwick! To build a custom caddy, you can use caddydev.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 4, 2016 20:26

Ah ha, thank you! Appreciate the n00b help.

I used the new code (I know I'm using the new filemanager code, because I can see titles from my recent PR), but I'm still seeing that same string in the <style> tag:

screen shot 2016-08-04 at 4 23 45 pm

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

:( I'll check it again Sorry

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 4, 2016 20:44

No problem! Thanks for looking into it.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

I promise you it will work now :D

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 5, 2016 15:9

Thanks! This works.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 5, 2016 15:51

@hacdias What's the process / timeline for these updates to be able to be included in a regular caddy build from https://caddyserver.com/download?

Thanks again!

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

I don't really know. We've to wait for @mholt.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @mholt on August 5, 2016 16:34

Waiting for Go 1.7 to be released before I update the build server. Clearing the cache imposes a significant load on the lil' 1-CPU machine. So I do the updates in bulk now.

@hacdias
Copy link
Member Author

hacdias commented Jul 18, 2017

From @bronzehedwick on August 5, 2016 16:59

OK thanks

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

1 participant