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

Script and style registration. #85

Closed

Conversation

sustained
Copy link

@sustained sustained commented Jul 5, 2019

See discussion in #84 for rationale.

This allows us to register styles and scripts per page/layout by simply specifying them in the YAML front matter.

This means we can only include expensive UIKit files as and where needed. Currently this isn't being used anywhere but I plan to make use of it in my big upcoming docs PR.

Example

---
scripts:
  - /assets/css/uikit/components/autocomplete.min.js
styles:
  - /assets/css/uikit/components/autocomplete.min.css
---

There are two arguably unrelated commits in here but I don't feel that it's an issue personally.

Excluding vendor.

I was basically unable to run the site locally until I fixed this issue.

Ignoring vendor.

Shouldn't it be ignored anyway? Without it there's several thousand files in my sidebar and any PR I made would mean that the entire vendor directory would be included... I honestly don't understand why it's not ignored as is.

@Tonius
Copy link
Member

Tonius commented Jul 6, 2019

Where does vendor come from? I don't think I ever saw that before.

@sustained
Copy link
Author

Perhaps it has to do with how I installed things. It just contains the dependencies. Think of it like node_modules if you've used Node/JS.

Perhaps you installed things globally/system-wide? I had problems doing that and had to do this instead.

bild

Additionally, my install of the site contains a .bundle/config file which says that the BUNDLE_PATH is vendor/bundle.

@sustained
Copy link
Author

sustained commented Jul 7, 2019

Basically bundle install failed no matter what I tried so in the end I succeeded with bundle install --path vendor/bundle. I wasn't really sure what the problem was since it's been many years since I worked with Ruby/gems and such, actually I recall now - the error messages I were getting recommended trying it with --path vendor/bundle.

@sustained
Copy link
Author

I am going to close this since at this point I am now working on adding code highlighting (without embedding Gists) to the docs examples on my other big up and coming PR and I need this functionality there (I don't want to include the stylesheets globally), so I will just do it there instead.

@sustained sustained closed this Jul 8, 2019
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.

invalid date '0000-00-00' from template
2 participants