Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

BUG: What is the matter with add-on.js and add-on.css? #87

Closed
twatzl opened this issue Aug 25, 2019 · 9 comments
Closed

BUG: What is the matter with add-on.js and add-on.css? #87

twatzl opened this issue Aug 25, 2019 · 9 comments

Comments

@twatzl
Copy link
Contributor

twatzl commented Aug 25, 2019

Hello,

I was looking for the source of the issues why my browser was complaining that add-on.css and add-on.js have a MIME type mismatch. I read that this occurs when the file does not exist. And indeed those two files do not exist. However the documentation still lists them and they are also referred to in partials/scripts.html and partials/head.html.

So what is the matter with those files. Are the references forgotten references and should be removed or am I missing something?

I get the errors on the hugo live server as well as on my production system.

@VincentTam VincentTam self-assigned this Aug 25, 2019
@VincentTam VincentTam changed the title Possible Bug: What is the matter with add-on.js and add-on.css? BUG: What is the matter with add-on.js and add-on.css? Aug 25, 2019
@twatzl
Copy link
Contributor Author

twatzl commented Aug 25, 2019

#88

@VincentTam
Copy link
Collaborator

@twatzl Nice catch! We're working out these two files in #66.

@twatzl
Copy link
Contributor Author

twatzl commented Aug 25, 2019

I just noticed the files exist in the exampleSite and quickly put a PR together. I was not expecting you to answer so quickly :D

@twatzl
Copy link
Contributor Author

twatzl commented Aug 25, 2019

If you are already working on it you can just dump my PR.

@pacollins
Copy link
Owner

If I remember correct from the last time I looked at it, the browser really doesn't like that the files are empty with a comment at the top.

@VincentTam
Copy link
Collaborator

VincentTam commented Aug 26, 2019

If you are already working on it you can just dump my PR.

@twatzl In fact, this section in the site config has existed for long.

# Loads CSS and JavaScript files. The variable is an array so that you can load
# multiple/additional files if necessary. The standard theme files can be loaded
# by adding the value, "default". Default includes the add-on.css and and-on.js.
# Example: ["default", "/path/to/file"]
cssFiles = ["default"]
jsFiles = ["default"]

I've altered greatly the structures of both partial templates at commits 72629f7, 09155a6 and b055367, in response to @pacollins' request to get our Staticman JS script bundled with other JS scripts.

I appreciate your effort in making #88. Even though your static/*/add-on.* has to be dumped, it seems good to add a section in the README to give a brief mention of cssFiles and jsFiles in the site config. Since #84 is in progress, perhaps your edit might cause a merge conflict in the README file from a technical point of view, but most of its content is good.

You can adapt this theme according to your preferences using your own JS or CSS code. To do this your can [edit the ... params in the site config].

Before I clicked "Commnt", @pacollins had commented, so would you mind editing the Wiki with the above quoted sentence? In this way, you'll get proper credit for the text that you've written.

Remarks: Looking back, I'm sorry for having complicated the commit history by 6449077, which would have been avoided if I had merged recent changes on the upstream master branch before actually working on the head of the remove-cdn branch. I'll try my best to keep Git history down.

@twatzl
Copy link
Contributor Author

twatzl commented Oct 6, 2019

Hey. Sorry for not responding for such a long time. I was quite busy at work and only had time this weekend to work on my blog again. What is the status? what needs to be done? Just the wiki entry?

@VincentTam
Copy link
Collaborator

Hey. Sorry for not responding for such a long time. I was quite busy at work and only had time this weekend to work on my blog again.

Nvm. We too.

What is the status?

#66, which deals with the add-on stuff, turns out to be more complicated than I've expected—I didn't know that the CSS load order matters. It seems that I've to take some courses about web development—some recommended Udemy, I'm thinking about 3W Academy.

what needs to be done? Just the wiki entry?

The content of https://github.com/pacollins/hugo-future-imperfect-slim/pull/88/files#diff-04c6e90faac2675aa89e2176d2eec7d8 can go to the Wiki's config.toml page section .Site.Params.

@pacollins
Copy link
Owner

Fixed with #66

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants