Code Monkey home page Code Monkey logo

Comments (5)

23maverick23 avatar 23maverick23 commented on August 18, 2024

Hey @Sukhdeepsingh - thanks!

You should be able to get the desired format using another dictionary as a key value for your image section like this:

"default_post_extras": {
    "excerpt": "", "comments": "True", "image": {
        "feature": "", "credit": "", "creditlink":"", "link":""
    }
}

When you create your post, it should translate to this:
screen shot 2015-07-31 at 8 43 33 am

from sublime-jekyll.

uksurd88 avatar uksurd88 commented on August 18, 2024

Thanks, that worked great. Just on this point, why the order is not maintained. For eg. look at the excerpt tag, we added it as the top key, but it became second last in the post file. How can I maintain the order.

from sublime-jekyll.

23maverick23 avatar 23maverick23 commented on August 18, 2024

Curious - why does your YAML front matter key order matter? Aesthetics?

Python sets (dictionaries) are unordered by definition, so there is never a guarantee that the order you insert the values are the order they come out (more here: http://stackoverflow.com/a/15479974).

The implementation I am using is a simple dictionary walk - you can have a look here if you have suggestions on improvements: https://github.com/23maverick23/sublime-jekyll/blob/master/jekyll.py#L212-L242 . I could maybe look at using OrderedDict in conjunction, but I haven't seen a need for that.

from sublime-jekyll.

uksurd88 avatar uksurd88 commented on August 18, 2024

Thanks for your time Ryan, no pressing issues just the aesthetics as you said :)

from sublime-jekyll.

23maverick23 avatar 23maverick23 commented on August 18, 2024

Np. I'll put it on the backlog and see if I can get to it on my next major release. Thanks for the feedback!

from sublime-jekyll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.