Skip to content

delegate StaticFile#to_json to StaticFile#to_liquid#6273

Merged
jekyllbot merged 1 commit into
jekyll:masterfrom
xrav3nz:static-file-to-json
Aug 5, 2017
Merged

delegate StaticFile#to_json to StaticFile#to_liquid#6273
jekyllbot merged 1 commit into
jekyll:masterfrom
xrav3nz:static-file-to-json

Conversation

@xrav3nz

@xrav3nz xrav3nz commented Aug 4, 2017

Copy link
Copy Markdown
Contributor

fixes #6259.

In order to make the output prettier and more expressive, it seems better to jsonify StaticFileDrop instead of StaticFile for the additional information. Delegation feels more natural to me in this situation.

Open to suggestions and feedbacks is welcome, especially on ways to improve the test. Cheers!


site | jsonify

Before:

...
"static_files": [
  "#Jekyll::StaticFile:0x005570s01cd1d0"
],
...

After:

...
"static_files": [
  {
    "name": "base.js",
    "path": "/assets/base.js",
    "basename": "base",
    "extname": ".js",
    ...
  }
],
...

@parkr parkr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful! Thank you!

@parkr

parkr commented Aug 5, 2017

Copy link
Copy Markdown
Member

/cc @jekyll/stability

@jekyllbot jekyllbot assigned parkr and ghost Aug 5, 2017
@ashmaroli

Copy link
Copy Markdown
Member

Awesome!! 👍

@ghost

ghost commented Aug 5, 2017

Copy link
Copy Markdown

@jekyllbot: merge +fix

@jekyllbot jekyllbot merged commit a99186f into jekyll:master Aug 5, 2017
jekyllbot added a commit that referenced this pull request Aug 5, 2017
@parkr parkr mentioned this pull request Aug 12, 2017
6 tasks
parkr pushed a commit that referenced this pull request Aug 12, 2017
parkr added a commit that referenced this pull request Aug 12, 2017
Backport #6273 for v3.5.x: delegate `StaticFile#to_json` to `StaticFile#to_liquid`
@jekyll jekyll locked and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StaticFile should alias to_json to to_liquid

4 participants