@@ -103,7 +103,6 @@ def entry_attributes_from_document(identifier, file_path)
103103 if identifier == "stylesheets/application.css.scss"
104104 # TODO: should this also be a "template"? doesn't super matter.
105105 entry_kind = :manifest
106- entry_body = File . read ( file_path )
107106 elsif identifier =~ /\. erb$/
108107 # idea is that templates are rendered from within context of a
109108 # controller, which is too painful to setup here
@@ -140,29 +139,15 @@ def process_templates(notebook)
140139 # if there is a stylesheets/application.css.scss we want to render the
141140 # Sass and convert it to a stylesheets/application.css
142141 if stylesheet = notebook . entries . manifests . find_by ( identifier : "stylesheets/application.css.scss" )
143- load_path = File . join ( notebook . import_path , "stylesheets" )
144-
145- rendered_css = SassC ::Engine . new ( stylesheet . body , {
146- filename : "application.css.scss" ,
147- syntax : :scss ,
148- load_paths : [ load_path ] ,
149- } ) . render
150-
151142 # there can only be ONE application.css
152143 if to_delete = notebook . entries . find_by ( identifier : "stylesheets/application.css" )
153144 puts "Destroying extraneous stylesheets/application.css, so it can be replaced."
154145 to_delete . destroy
155146 end
156147
157- rendered_stylesheet = notebook . entries . new ( stylesheet . export_attributes )
158- rendered_stylesheet . identifier = "stylesheets/application.css"
159- rendered_stylesheet . kind = :document
160- rendered_stylesheet . save!
161-
162- blob = ActiveStorage ::Blob . create_and_upload! ( io : StringIO . new ( rendered_css ) ,
163- filename : "application.css" )
164- blob . analyze
165- rendered_stylesheet . files . create ( blob_id : blob . id , created_at : blob . created_at )
148+ stylesheet . identifier = "stylesheets/application.css"
149+ stylesheet . render_stylesheet!
150+ stylesheet . save
166151 end
167152 end
168153
0 commit comments