Skip to content

Commit 1ccae88

Browse files
Add missing stylesheet extension for webpacker
1 parent 6e5ec78 commit 1ccae88

5 files changed

Lines changed: 16 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
1414
### Fixed
1515
-
1616

17-
## v0.1.2 - 2021-03-16
17+
## v0.1.3 - 2021-03-16
1818

1919
### Added
2020
- Initial release

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
block_editor (0.1.2)
4+
block_editor (0.1.3)
55
rails (~> 6.0)
66
webpacker (~> 5.1)
77

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Block Editor for Ruby on Rails
22
This editor uses packages from the [Wordpress Gutenberg project](https://github.com/WordPress/gutenberg) to build a standalone block editor for Rails. This editor has been extracted from [Integral CMS](https://github.com/yamasolutions/integral) where it was built following the [Wordpress custom block editor tutorial](https://developer.wordpress.org/block-editor/how-to-guides/platform/custom-block-editor/).
33

4+
Looking for a demo? Checkout this [simple host application example.](https://block-editor-rails.herokuapp.com/)
5+
46
More information;
57

6-
* [Gutenberg Demo](https://wordpress.org/gutenberg/)
8+
* [Simple host application example source repository](https://github.com/yamasolutions/block-editor-sample)
9+
* [Current Wordpress Editor Demo](https://wordpress.org/gutenberg/)
710
* [Gutenberg Block Editor Developer Documentation](https://developer.wordpress.org/block-editor/)
811

912
## Installation

config/initializers/webpacker_extension.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ def javascript_pack_tag(*names, **options)
77
end
88
new_helper.javascript_pack_tag(*names, **options.except(:webpacker))
99
end
10+
11+
def stylesheet_pack_tag(*names, **options)
12+
return super unless options[:webpacker]
13+
new_helper = self.dup
14+
new_helper.define_singleton_method(:current_webpacker_instance) do
15+
options[:webpacker].constantize.webpacker
16+
end
17+
new_helper.stylesheet_pack_tag(*names, **options.except(:webpacker))
18+
end
1019
end
1120

1221
Webpacker::Helper.prepend Webpacker::DynamicTag

lib/block_editor/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module BlockEditor
2-
VERSION = '0.1.2'
2+
VERSION = '0.1.3'
33
end

0 commit comments

Comments
 (0)