comfy_middle_seat 4.4.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 654bed46bea3e8580f57ce3b9ba688ceb7b592d83f76c6762b771ee21c11266c
4
- data.tar.gz: 6164127c75dd90045b376a401887ab95976a6722f9b084bc3e7b937056d7570e
3
+ metadata.gz: 5f6717192c25596be740e0176e1ae1f6e4b0bd5dd07a71a5f7a8271ad047fc10
4
+ data.tar.gz: 7c18f5c772a0ee0a8bab66870066d515b6977a5a962484479eccf5a7c2d9525b
5
5
  SHA512:
6
- metadata.gz: 1c2c3126c49194876cb5794df8d986f524ed93fc159337d08651f54dcd88fbcd9a2f9ccfb3ee80ea8eb6046217a0a82b94f73dcf442aa4c33877c196b61bad01
7
- data.tar.gz: 235b0a6ecc612706f168d2daf513f1935addbd9083afea5a2f80726dffb65e80fc74021dae0cd3de1284d26f4df19ab084f336907489b409324f071c0e49171b
6
+ metadata.gz: b940efa50666b34b7963839d60fa6265ce5f84566c959388e981cf9e29c02757d9e37a330c59150cebe1c09a27e8c6d2bd72f040922664e7ef39cc37aadd7195
7
+ data.tar.gz: '088311053691f043a38462dd1f9b84d57c6a8fff0ae88afe97803d339dc1feceacefff99c99d6b3c52ab0627fe50d324634680e22e8878d0565df78e13be0142'
data/CHANGELOG.md CHANGED
@@ -14,6 +14,16 @@ This changelog follows the project's lineage: **Comfortable Mexican Sofa → Com
14
14
 
15
15
  ### Added
16
16
 
17
+ - Add `layout_asset`, `render_partial`, and `render_template` aliases; existing tags remain supported.
18
+
19
+ ### Changed
20
+
21
+ - Generate layout asset links through Rails routes and HTML helpers.
22
+
23
+ ## [v4.4.0] - 2026-10-25
24
+
25
+ ### Added
26
+
17
27
  - Resize, crop, and pad images with ImageMagick or Vips.
18
28
  - Validate image dimensions with a configurable size limit.
19
29
 
@@ -22,6 +32,8 @@ This changelog follows the project's lineage: **Comfortable Mexican Sofa → Com
22
32
  - Restore supported legacy image resizing and modernize admin thumbnails.
23
33
  - Keep original file links for images that cannot be resized.
24
34
 
35
+ **Upgrading:** Clear rendered page and translation caches. Review legacy sizing options and the new 4096-pixel limit; see [image resizing](README.md#image-resizing). No database migration is required.
36
+
25
37
  ## [v4.3.0] - 2026-10-17
26
38
 
27
39
  ### Added
@@ -274,7 +286,8 @@ First release of `comfortable_media_surfer`. This new gem is a revival of [Comfo
274
286
 
275
287
  - Rebranded **ComfortableMexicanSofa** as **ComfortableMediaSurfer** in order to publish new gem (database table names and schema have not changed).
276
288
 
277
- [Unreleased]: https://github.com/avonderluft/comfy-middle-seat/compare/v4.3.0...master
289
+ [Unreleased]: https://github.com/avonderluft/comfy-middle-seat/compare/v4.4.0...master
290
+ [v4.4.0]: https://github.com/avonderluft/comfy-middle-seat/compare/v4.3.0...v4.4.0
278
291
  [v4.3.0]: https://github.com/avonderluft/comfy-middle-seat/compare/v4.2.0...v4.3.0
279
292
  [v4.2.0]: https://github.com/avonderluft/comfy-middle-seat/compare/v4.1.0...v4.2.0
280
293
  [v4.1.0]: https://github.com/avonderluft/comfy-middle-seat/compare/v4.0.4...v4.1.0
data/README.md CHANGED
@@ -114,6 +114,24 @@ A Site defines a hostname, path, and language. Layouts define page structure and
114
114
 
115
115
  When an editor creates a Page using this Layout, the admin automatically presents fields for `title` and `content`. Content tags can also provide Markdown, files, images, dates, numbers, checkboxes, snippets, partials, helpers, navigation, and other reusable content.
116
116
 
117
+ ### Descriptive tag aliases
118
+
119
+ These names are interchangeable; existing tags remain supported:
120
+
121
+ | Existing tag | Alias |
122
+ | --- | --- |
123
+ | `asset` | `layout_asset` |
124
+ | `partial` | `render_partial` |
125
+ | `template` | `render_template` |
126
+
127
+ ```liquid
128
+ {{ cms:layout_asset main, type: css, as: tag }}
129
+ {{ cms:render_partial "layouts/embed_video", id: MYpbvXgpIzc }}
130
+ {{ cms:render_template "marketing/landing" }}
131
+ ```
132
+
133
+ Aliases preserve all parameters, defaults, and existing allowlist behavior. No new allowlist requirement or content migration is introduced. Asset tags still require `type: css` or `type: js`; omitting the type does not default to CSS. Their URLs follow the configured Rails routes, not an independent manual override of `public_cms_path`. HTML attributes are preserved, though formatting may differ. Check for conflicts if your application already registers custom tags with these alias names.
134
+
117
135
  ### Editor shortcuts
118
136
 
119
137
  In HTML and Markdown code editors, type a shortcut and press **Tab** to insert a CMS tag. The parameter placeholder is selected so you can replace it immediately. For example, `;md` inserts `{{ cms:markdown content }}` with `content` selected.
@@ -152,7 +170,7 @@ Use the arrow keys and **Enter** or **Tab** to choose. The tag replaces the enti
152
170
  | `;ec` | `endcomment` | — |
153
171
  | `;end` | `end` | — |
154
172
 
155
- Placeholders are examples: replace them with your field names, identifiers, paths, or IDs. `;asset` inserts the CSS version; `;comment` inserts a full comment block.
173
+ Placeholders are examples: replace them with your field names, identifiers, paths, or IDs. `;asset` inserts the CSS version; `;comment` inserts a full comment block. The descriptive aliases (`;layout_asset`, `;render_partial`, `;render_template`) also work for expansion and search, inserting the existing tag spellings.
156
174
 
157
175
  Shortcuts work at the start of a line, after whitespace, or after `>`, outside an existing CMS tag. Unrecognized shortcuts retain normal Tab behavior. CSS, JavaScript, ordinary text fields, and visual editors are unchanged. Saved content uses the standard `{{ cms:... }}` syntax.
158
176
 
@@ -25,12 +25,12 @@ const completions = [
25
25
  tag("fl", "file_link", "file_id, as: link", "file_id"),
26
26
  tag("pfl", "page_file_link", "attachment, as: link", "attachment"),
27
27
  tag("sn", "snippet", "identifier", "identifier"),
28
- tag("as", "asset", "layout_identifier, type: css, as: tag", "layout_identifier"),
28
+ tag("as", "asset", "layout_identifier, type: css, as: tag", "layout_identifier", ["layout_asset"]),
29
29
  tag("css", "asset", "layout_identifier, type: css, as: tag", "layout_identifier"),
30
30
  tag("js", "asset", "layout_identifier, type: js, as: tag", "layout_identifier"),
31
31
  tag("hlp", "helper", "method_name", "method_name"),
32
- tag("par", "partial", '"path/to/partial"', "path/to/partial"),
33
- tag("tpl", "template", '"path/to/template"', "path/to/template"),
32
+ tag("par", "partial", '"path/to/partial"', "path/to/partial", ["render_partial"]),
33
+ tag("tpl", "template", '"path/to/template"', "path/to/template", ["render_template"]),
34
34
  tag("cr", "breadcrumbs"),
35
35
  tag("ch", "children"),
36
36
  tag("si", "siblings"),
@@ -30,28 +30,23 @@ class ComfyMiddleSeat::Content::Tags::Asset < ComfyMiddleSeat::Content::Tag
30
30
  def content
31
31
  return '' unless layout
32
32
 
33
- base = ComfyMiddleSeat.config.public_cms_path || ''
34
- unless base.ends_with?('/')
35
- base += '/'
36
- end
33
+ url_helpers = Rails.application.routes.url_helpers
34
+ options = { site_id: context.site.id, identifier: layout.identifier, cache_buster: layout.cache_buster, format: @type }
35
+ helpers = ActionController::Base.helpers
37
36
 
37
+ # These are CMS endpoints, not pipeline assets. Use HTML builders to avoid
38
+ # adding asset-host prefixes or applying asset-pipeline settings to the URL.
38
39
  case @type
39
40
  when 'css'
40
- out = "#{base}cms-css/#{context.site.id}/#{@identifier}/#{layout.cache_buster}.css"
41
- if @as == 'tag'
42
- out = "<link href='#{out}' media='screen' rel='stylesheet' type='text/css' />"
43
- end
44
- out
41
+ path = url_helpers.comfy_cms_render_css_path(**options)
42
+ @as == 'tag' ? helpers.tag.link(href: path, media: 'screen', rel: 'stylesheet', type: 'text/css') : path
45
43
  when 'js'
46
- out = "#{base}cms-js/#{context.site.id}/#{@identifier}/#{layout.cache_buster}.js"
47
- if @as == 'tag'
48
- out = "<script src='#{out}' type='text/javascript'></script>"
49
- end
50
- out
44
+ path = url_helpers.comfy_cms_render_js_path(**options)
45
+ @as == 'tag' ? helpers.content_tag(:script, '', src: path, type: 'text/javascript') : path
51
46
  end
52
47
  end
53
48
  end
54
49
 
55
- ComfyMiddleSeat::Content::Renderer.register_tag(
56
- :asset, ComfyMiddleSeat::Content::Tags::Asset
57
- )
50
+ %i[asset layout_asset].each do |name|
51
+ ComfyMiddleSeat::Content::Renderer.register_tag(name, ComfyMiddleSeat::Content::Tags::Asset)
52
+ end
@@ -42,6 +42,6 @@ class ComfyMiddleSeat::Content::Tags::Partial < ComfyMiddleSeat::Content::Tag
42
42
  end
43
43
  end
44
44
 
45
- ComfyMiddleSeat::Content::Renderer.register_tag(
46
- :partial, ComfyMiddleSeat::Content::Tags::Partial
47
- )
45
+ %i[partial render_partial].each do |name|
46
+ ComfyMiddleSeat::Content::Renderer.register_tag(name, ComfyMiddleSeat::Content::Tags::Partial)
47
+ end
@@ -37,6 +37,6 @@ class ComfyMiddleSeat::Content::Tags::Template < ComfyMiddleSeat::Content::Tag
37
37
  end
38
38
  end
39
39
 
40
- ComfyMiddleSeat::Content::Renderer.register_tag(
41
- :template, ComfyMiddleSeat::Content::Tags::Template
42
- )
40
+ %i[template render_template].each do |name|
41
+ ComfyMiddleSeat::Content::Renderer.register_tag(name, ComfyMiddleSeat::Content::Tags::Template)
42
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ComfyMiddleSeat
4
- VERSION = '4.4.0'
4
+ VERSION = '4.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfy_middle_seat
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Khabarov