-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add support for building on production. #3
base: master
Are you sure you want to change the base?
Conversation
17352ca
to
f04ddf9
Compare
def manipulate_resource_list(resources) | ||
@compile.call(@options) | ||
resources + [ | ||
File.join(@options[:css_dir], "_" + @options[:font_name] + ".scss"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs cleanup to work with other types of outputs.
/ping @uetchy this is ready now and actually works. |
d12ab79
to
1104118
Compare
Since middleman is actually retarded, we hijack `manipulate_resource_list` to do the actual font compilation; every SASS file _needs_ to have all its dependants generated by the time this step passes, so this is the only viable entry point. Since the font depends on a directory of files, and not any individual file, we must also monkey patch `.template?` and `.binary?` since they only work on regular (non-directory) files. Finally we output the generated fonts as resources in order to keep the Sitemap system happy. `no_hash` is enabled permanently since it is now the job of `:asset_hash`.
1104118
to
4f59cf6
Compare
Conflicts: lib/middleman-fontcustom/extension.rb
Thanks 😃 |
Since they are generated files, Setup middleman: sprockets.append_path File.join root, "build", "stylesheets"
sprockets.append_path File.join root, "build", "fonts"
activate :fontcustom do |fc|
fc.font_name = 'icons'
fc.source_dir = 'source/icons'
fc.fonts_dir = 'fonts'
fc.css_dir = 'stylesheets/components'
fc.templates = 'scss'
fc.font_design_size = 62 # picas not pixels
fc.font_ascent = 850
fc.font_descent = 150
end Import icons: @import "components/icons" |
This looks like more rational way. |
Since middleman is actually retarded, we hijack
manipulate_resource_list
to do the actual font compilation; every SASS file needs to have all its dependants generated by the time this step passes, so this is the only viable entry point. Since the font depends on a directory of files, and not any individual file, we must also monkey patch.template?
and.binary?
since they only work on regular (non-directory) files. Finally we output the generated fonts as resources in order to keep the Sitemap system happy.no_hash
is enabled permanently since it is now the job of:asset_hash
.