envygeeks / jekyll-assets

:art: Asset pipelines for Jekyll.
ISC License
1.11k stars 169 forks source link

asset_path is scss is never called #661

Open braindeaf opened 3 years ago

braindeaf commented 3 years ago

Hi, I'm trying to add in asset_url into our SCSS in our Jekyll project however

body {
  background-image: asset-url("dave.png"); 
  background-image: asset_url("dave.png"); 
 }

I'm wanted to add support for both asset_url and asset-url. But I can't even seem to get asset_url to get called. Is there something I am missing.

We are using...

 # A sample Gemfile
source "https://rubygems.org"

# Github Pages Gems
gem 'github-pages', '~> 204'
gem 'jekyll', '~> 3.8.5'
gem 'github-pages-health-check', '~> 1.16.1'
gem 'html-pipeline', '~> 2.12.3'
gem 'jekyll-avatar', '~> 0.7.0'
gem 'jekyll-assets', group: :jekyll_plugins
gem 'jekyll-coffeescript', '~> 1.1.1'
gem 'jekyll-commonmark-ghpages', '~> 0.1.6'
gem 'jekyll-default-layout', '~> 0.1.4'
gem 'jekyll-feed', '~> 0.13.0'
gem 'jekyll-gist', '~> 1.5.0'
gem 'jekyll-github-metadata', '~> 2.13.0'
gem 'jekyll-mentions', '~> 1.5.1'
gem 'jekyll-optional-front-matter', '~> 0.3.2'
gem 'jekyll-paginate', '~> 1.1.0'
gem 'jekyll-readme-index', '~> 0.3.0'
gem 'jekyll-redirect-from', '~> 0.15.0'
gem 'jekyll-relative-links', '~> 0.6.1'
gem 'jekyll-remote-theme', '~> 0.4.1'
gem 'jekyll-sass-converter', '~> 1.5.2'
gem 'jekyll-seo-tag', '~> 2.6.1'
gem 'jekyll-sitemap', '~> 1.4.0'
gem 'jekyll-swiss', '~> 1.0.0'
gem 'jekyll-theme-architect', '~> 0.1.1'
gem 'jekyll-theme-cayman', '~> 0.1.1'
gem 'jekyll-theme-dinky', '~> 0.1.1'
gem 'jekyll-theme-hacker', '~> 0.1.1'
gem 'jekyll-theme-leap-day', '~> 0.1.1'
gem 'jekyll-theme-merlot', '~> 0.1.1'
gem 'jekyll-theme-midnight', '~> 0.1.1'
gem 'jekyll-theme-minimal', '~> 0.1.1'
gem 'jekyll-theme-modernist', '~> 0.1.1'
gem 'jekyll-theme-primer', '~> 0.5.4'
gem 'jekyll-theme-slate', '~> 0.1.1'
gem 'jekyll-theme-tactile', '~> 0.1.1'
gem 'jekyll-theme-time-machine', '~> 0.1.1'
gem 'jekyll-titles-from-headings', '~> 0.5.3'
gem 'jemoji', '~> 0.11.1'
gem 'kramdown', '~> 1.17.0'
gem 'liquid', '~> 4.0.3'
gem 'minima', '~> 2.5.1'
gem 'nokogiri', '~> 1.10.7'
gem 'rouge', '~> 3.13.0'
gem 'safe_yaml', '~> 1.0.5'
gem 'sass', '~> 3.7.4'

Thank you in advance :)

annapoorna-r commented 2 years ago

@braindeaf I am facing similar issue, What was the solution you found?

braindeaf commented 2 years ago

Wow, this was a year ago now :S The commit on our application that I'm looking at. Happy to glance over what you have to help because this drove me crazy for a few days at the time.

gem "jekyll-assets"
# became
gem "jekyll-assets", git: "https://github.com/envygeeks/jekyll-assets", group: :jekyll_plugins

and adding

plugins:
  - jekyll-assets

then using

{% asset screen.css media='screen' %}
{% asset print.css media='print' %}
annapoorna-r commented 2 years ago

@braindeaf Thank you for your time to look into an year old commit :-) . I will try your solution