Code Monkey home page Code Monkey logo

sublime-jekyll's Introduction

sublime-jekyll

GitHub license GitHub tag Package Control Maintenance

sublime-jekyll is a Sublime Text package for Jekyll static sites.

This package is aimed at streamlining the process of managing and creating new Jekyll posts. It does this by providing quick and easy access to new post and draft commands, snippets and completions for Liquid template tags and filters, as well as some handy commands for adding dates and upload links to your posts.

If you use Jekyll as your static site generator, and Sublime Text as your text editor, you should absolutely install and use this package!

Installation

The recommended way to install and update this package is using Package Control. Search for Jekyll and install the latest version. If you prefer to install this package manually, you can git clone this repo or extract the ZIP archive into your Sublime Text Packages folder.

Documentation

Installation instructions, available commands and features, detailed documentation, and FAQs can be found at sublime-jekyll.rtfd.org.

License

sublime-jekyll is licensed under the MIT license. LICENSE

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

sublime-jekyll's People

Contributors

23maverick23 avatar aklef avatar calledt avatar fk128 avatar nicholasbuse avatar nsfmc avatar pugong avatar rholak avatar svendroid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sublime-jekyll's Issues

Insert Date key binding conflicts with built-in Sublime Text command

In Sublime Text, ⌘K, ⌘D by default is bound to the find_under_expand_skip command, which expands a multiple selection to include the next instance of the currently-selected text, and removes the current instance from the selection. This is also known as the “Quick Skip Next” command. You can read an example of how it is used here: http://www.sublimetext.com/docs/3/multiple_selection_with_the_keyboard.html

Personally I’m able to remap this key combination back to the default command, which I use frequently, but I wonder if it’s wise to override default key bindings like these?

Create migrateJekyllSettings command

Create migrateJekyllSettings command in preparation for v3.0 release.

Will automatically migrate old User Settings key names to new naming structure.

Add multi-level dictionary support to front-matter extras

This is for tracking the enhancement suggested by @atomi in issue #22 .

This will allow for a truly custom front-matter experience.

Jekyll.sublime-settings

"default_post_extras": { 
    "description": "default-description",  
    "image": {
        "feature": "imagename.jpg", 
        "credit": "author"
        }
}

Jekyll front-matter output

---
layout: post
title: here is a title
published: True
image:
    credit: author
    feature: imagename.jpg
description: default-description

---

Where to place per project settings?

The documentation mentions per project settings and the format for them, but completely ommits where these settings should be saved?

Some filename in the project root?

Manage drafts better

Currently, the New draft command uses the same method as the New post command, which auto-adds the date to the title. This is very non-Jekyll, since drafts aren't yet posts.

Ideas for Draft Enhancement:

  • Remove date from draft file name
  • Add date into draft using the Promote draft to post command
  • Look at altering the way the Published YAML key is handled

Hyphens in HTML (Jekyll) are breaking syntax highlighting

First off, I love this plugin. it's just what I was looking for—for jekyll and for liquid syntax highlighting in general. Thank you! But I've run into a problem with hyphenated words breaking syntax highlighting:

screen shot 2015-07-14 at 11 46 59 am

Any ideas on how I can prevent this from happening?

Multi line front matter in default_post_extras

Hi, Thanks for the nice package, I have just started using it.
How can I configure the "default_post_extras" variable to have a multiline indented tag eg
I want this to be injected in my each blog posts front matter and in the same order (as the order also gets jumbled up in the new post when I create)

image:
  feature: image.jpg
  credit: @singh
  creditlink: 

I tried

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

and then I tried

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

Please help.
Thanks

Snippet fixes

  • Update front-matter snippet
  • Modify unless snippet

Jekyll: Unable to find path information in Jekyll.sublime-settings

Need to replace MissingPathException path here in function catch_errors with the path as seen in the Main.sublime-menu file here: ${packages}/User/Jekyll.sublime-settings

Traceback from Sublime console:

error: Jekyll: Unable to find path information in Jekyll.sublime-settings.
Traceback (most recent call last):
  File "jekyll in /Users/rmorrissey/Library/Application Support/Sublime Text 3/Installed Packages/Jekyll.sublime-package", line 29, in _fn
  File "jekyll in /Users/rmorrissey/Library/Application Support/Sublime Text 3/Installed Packages/Jekyll.sublime-package", line 91, in posts_path_string
Jekyll.jekyll.MissingPathException

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "jekyll in /Users/rmorrissey/Library/Application Support/Sublime Text 3/Installed Packages/Jekyll.sublime-package", line 144, in title_input
  File "jekyll in /Users/rmorrissey/Library/Application Support/Sublime Text 3/Installed Packages/Jekyll.sublime-package", line 36, in _fn
  File "X/shutil.py", line 221, in copy
  File "X/shutil.py", line 109, in copyfile
FileNotFoundError: [Errno 2] No such file or directory: '/Users/rmorrissey/Library/Application Support/Sublime Text 3/Packages/Jekyll/Jekyll.sublime-settings'

Where's the 'HTML (Jekyll)' language package?

Before the new update, the package used to add an HTML (Jekyll) package. Was it removed? If so, do bring it back!

image

Now it shows only HTML, so no syntax highlighting for Jekyll and Liquid tags!

Publish Draft command?

It would be great to have a publish draft command that allowed you to select from the drafts and move to the posts (perhaps adding the published flag at that point?) I'd be happy to write up a first shot if that sounds like a feature you'd like to add.

Error loading syntax file

This looks to be an "order of operations" error caused by sourcing project settings before user/default settings (rather than sourcing project settings and falling back on user/default settings).

There is some lazy code at line 56 that needs to be changed. It assumes that the key will always be present so long as the "Jekyll" setting is found, which is causing a None value to be thrown when looking for the file syntax.

Exception information:

Error loading syntax file "Packages/Jekyll/Syntaxes/None (Jekyll).tmLanguage": Unable to open Packages/Jekyll/Syntaxes/None (Jekyll).tmLanguage

Error loading syntax file

After the 3.0 update, this error shows up every time I open Sublime. I use Sublime Text 3 on Mac Pro OSX 10.11.3

screen shot 2016-02-04 at 02 26 28

Unable to install - ST3 on Ubuntu 14.04

I attempted to install Jekyll from the package control menu and it doesn't complete the install (although Sublime tells me the install was completed successfully). None of the Jekyll commands come up in the palette, even after a full system restart.

ignored packages updated to: [Vintage, SublimeLinter-phplint, SublimeLinter-cppcheck, Jekyll]
found 1 files for base name Default.sublime-theme
theme loaded
reloading Packages/User/Preferences.sublime-settings
found 1 files for base name Default.sublime-theme
theme loaded
Exception in thread Thread-23:
Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "package_control.package_installer in /home/jfagan/.config/sublime-text-3/Installed Packages/Package Control.sublime-package", line 244, in run
  File "package_control.package_manager in /home/jfagan/.config/sublime-text-3/Installed Packages/Package Control.sublime-package", line 680, in install_package
  File "package_control.package_manager in /home/jfagan/.config/sublime-text-3/Installed Packages/Package Control.sublime-package", line 851, in print_messages
  File "package_control.open_compat in /home/jfagan/.config/sublime-text-3/Installed Packages/Package Control.sublime-package", line 9, in open_compat
Package Control.package_control.file_not_found_error.FileNotFoundError: The file "/tmp/tmpiuj56d/working/messages/install.txt" could not be found

ignored packages updated to: [Vintage, SublimeLinter-phplint, SublimeLinter-cppcheck]
found 1 files for base name Default.sublime-theme
theme loaded
reloading Packages/User/Preferences.sublime-settings
found 1 files for base name Default.sublime-theme
theme loaded

Add option to hide Jekyll Utility

If you prefer to hide these commands or remove them from the Command Palatte, you can set the settings key jekyll_utility_disable to true and restart Sublime Text.

error: Jekyll: Unable to find path information for Jekyll! [Windows]

Hi, I keep getting this error message: error: Jekyll: Unable to find path information for Jekyll!
I'm pretty sure my paths are correct, what could I be doing wrong?

This is my jekyll.sublime-settings file:

{
    // This string value should represent the default layout for new posts.
    "default_post_layout": "",

    // This value should represent the default categories for new posts.
    // Each category should be entered as a list item in string format
    // with commas separating values ["cat1", "cat2"]. To remove this key
    // from your front-matter completely, pass a value of `null`.
    "default_post_categories": [],

    // This value should represent the default tags for new posts.
    // Each tag should be entered as a list item in string format
    // with commas separating values ["tag1", "tag2"]. To remove this key
    // from your front-matter completely, pass a value of `null`.
    "default_post_tags": [],

    // A boolean specifying if you want new posts to be marked as published.
    // To remove this key from your front-matter completely, pass a value of `null`.
    "default_post_published": true,

    // If you need to add additional front-matter `key: value` information to
    // your posts, you can store them in a dictionary object using a format
    // like {"foo": "bar", "baz": "qux"}. This dictionary will be appended to
    // any of the enabled default keys above (Reminder: the `title` and `layout`
    // keys will always be included, so **DO NOT** include them in the extras dictionary).
    "default_post_extras": {},

    // A valid Python strftime string
    "insert_date_format": "%Y-%m-%d",

    // A valid Python strftime string
    "insert_datetime_format": "%Y-%m-%d %H:%M:%S",
    "folders":
      [
          {
              "follow_symlinks": true,
              "path": "G:\\aneu"
          }
      ],
      "settings":
      {
          "Jekyll":
          {
              "posts_path": "G:\\aneu\\_posts",
              "drafts_path": "G:\\aneu\\_drafts",
              "automatically_find_paths": false,
              "default_post_syntax": "Markdown",
          }
      }
}

On Ctrl+~ , this only shows up: error: Jekyll: Unable to find path information for Jekyll!

Help would be appreciated

Syntax highlighting inside highlight block? Kramdown?

Could the code inside {% highlight lang options %} be possible syntax highlighted? (sort of like javascript code is highlighted in html files)

For Kramdown, you can write

{:.myclass} {% highlight python %}
print 'foo'
{% endhighlight %}

-- however this completely breaks syntax highlighting for the {% highlight %} section.

Add YAML list styling

YAML front matter styling for multi-value lists. This should support dashed newline lists, bracket inline lists, and space separated strings.

categories:
- foo
- bat
- bar
tags: [foo, bat, bar]
tags: foo bat bar

Creation of posts fails

When i create a new jekyll post only the file is created in the posts folder, but the file is blank and following error is thrown in the console:

Traceback (most recent call last):
  File "./jekyll.py", line 177, in title_input
  File "./jekyll.py", line 316, in create_and_open_file
Boost.Python.ArgumentError: Python argument types in
    View.run_command(View, str)
did not match C++ signature:
    run_command(SP, std::basic_string, std::allocator >, boost::python::api::object)
    run_command(SP, std::basic_string, std::allocator >)`

Any clues why this is happening? Could it be a problem with my configuration?

ST2 2.0.2 - 2221
python 2.7.5

Can't Remove Key from Front-Matter

Assigning null values to "default_post_categories", "default_post_tags", and "default_post_published" in sublime project setting does not remove the key from YAML front-matter as described in the documentation.

// To remove this key from your front-matter completely, pass a value of null.
"default_post_categories": null,

Is there a trick to removing the key from post template?

Adding file support

Hi, could be nice to have something like Jekyll plugin for ATOM.
CMD + P => Add Jekyll Post (or Page/Draft), then ask the title and add the file into the right folder with the base front-matter.

Does it make sense?

Add support for Yaml front matter templates

  • Add ability to generate posts from Yaml templates
  • Allow for multiple template types
  • Add title attribute to template automatically
  • Add new commands for creating posts from templates
  • Add new default template settings parameter

Relative project paths?

#28 mentions that using relative paths in sublime project files (essential for using the repo in more than one place) was supposed to be in 2.2, but I just installed the plugin and it still hasn't been fixed.

Do you have an updated idea when this will happen, or why the default isn't just "one site per project"?

Folder configuration

Hi,
looking here I understood that I've to specify into the configuration my jekyll folder.
Am I correct?
In this case how can I manage more than one instance of jekyll? (I've several blog so I should specify more than one path).

Why not use the folders in the current path like Atom?

Small typos in completions

  • fix the space at the end after double quote
    { "trigger": "date\tJekyll", "contents": "date:'$1'"},
  • fix key to content, and page.content to title
    { "trigger": "page.title\tJekyll", "titles": "page.content" },
  • add content as an available item
  • remove .$1 from global variables

Jekyll: Unable to find path information in Jekyll.sublime-settings

Hey-

I'm trying to set up the sublime text package and need some assistance. I'm getting an error (Jekyll: Unable to find path information in Jekyll.sublime-settings). I thought I configured the paths correctly, but obviously not. Can you help? I'm new and not sure where to start troubleshooting beyond what I've already looked at.

Here is what is included in my Jekyll.sublime-settings file:

{

// This should point to your "_posts" directory.
// NOTE: This should be an absolute path. Also, the path should
// match your system convention. For example, Windows machines should
// have a path similar to "C:\\Users\\username\\site\\_posts".
// *nix systems should have a path similar to "/Users/username/site/_posts".
"posts_path": "/Users/dmabee/testProj/_posts",

// This should point to your "_drafts" directory.
// NOTE: This should be an absolute path. Also, the path should
// match your system convention. For example, Windows machines should
// have a path similar to "C:\\Users\\username\\site\\_drafts".
// *nix systems should have a path similar to "/Users/username/site/_drafts".
"drafts_path": "/Users/dmabee/testProj/_drafts",

// This string value should represent the default syntax for a new post.
// Valid options are: "Markdown", "Textile"
"default_post_syntax": "Markdown",

/** *****************************************************************************
 * Post Front-matter Defaults
 *
 * Set these values to make your life easier when composing new posts. This is
 * similar to setting your defaults as part of the `_config.yml` file:
 *
 * http://jekyllrb.com/docs/configuration/#front-matter-defaults
 * ******************************************************************************
 */

// This string value should represent the default layout for new posts.
"default_post_layout": "page",

// This value should represent the default categories for new posts.
// Each category should be entered as a list item in string format
// with commas separating values ["cat1", "cat2"]. To remove this key
// from your front-matter completely, pass a value of `null`.
"default_post_categories": [],

// This value should represent the default tags for new posts.
// Each tag should be entered as a list item in string format
// with commas separating values ["tag1", "tag2"]. To remove this key
// from your front-matter completely, pass a value of `null`.
"default_post_tags": [],

// A boolean specifying if you want new posts to be marked as published.
// To remove this key from your front-matter completely, pass a value of `null`.
"default_post_published": true,

// If you need to add additional front-matter `key: value` information to
// your posts, you can store them in a dictionary object using a format
// like {"foo": "bar", "baz": "qux"}. This dictionary will be appended to
// any of the enabled default keys above (Reminder: the `title` and `layout`
// keys will always be included, so **DO NOT** include them in the extras dictionary).
"default_post_extras": {},

/** ***********************************************************************************
 * If for some reason you want to change the way either the date
 * or the datetime string is formatted, you can override those formats
 * here using valid Python datetime.strftime() format codes.
 *
 * If you need a refresher on these codes, have a look at the Python
 * documentation found here:
 *
 * http://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior
 * ******************************************************************************
 */

// A valid Python strftime string
"insert_date_format": "%Y-%m-%d",

// A valid Python strftime string
"insert_datetime_format": "%Y-%m-%d %H:%M:%S",

"folders":
[
    {
        "follow_symlinks": true,
        "path": "/Users/dmabee/testProj"
    }
],

"settings":
{
    "Jekyll":
    {
        "posts_path": "/Users/dmabee/testProj/_posts",
        "drafts_path": "/Users/dmabee/testProj/_drafts",
    }
},

"ignored_packages":
[
    "Vintage"
]

}

Haml support

Hi there,
I wished to have haml syntax support for this extension. Is this already in planing?

New Post fails when using "default_post_extras"

Adding key: value pairs to default_post_extras causing Post builds to fail in ST2.

Line 55 of Jekyll.sublime-settings

"default_post_extras": {"key": "value"},

Console log.

reloading /Users/jc/Library/Application Support/Sublime Text 2/Packages/User/Jekyll.sublime-settings
Traceback (most recent call last):
  File "./jekyll.py", line 231, in title_input
  File "./jekyll.py", line 189, in create_post_frontmatter
  File "./jekyll.py", line 186, in pretty_walk
  File "./jekyll.py", line 183, in walk
ValueError: zero length field name in format

Per Project Settings

In the README, it says that I can have per-project settings since I'm maintaining multiple Jekyll sites but how do I do that? The README says to "make sure you add your Jekyll settings correctly" but I'm not sure how that works. Do I add a separate file to my Jekyll site where it'll have the settings for this plug-in or does it read the _config.yml?

No option for syntax higlighting after installation

I've been using this plugin for quite some time but at one point syntax highlighting option disappeared. I tried uninstalling and installing it again both via Package Manager and manually but the outcome is the same – the tools are there but there is no option for syntax highlighting anymore. Any ideas?

screen shot 2016-02-02 at 12 09 02 pm

Subfolders break the draft and post actions

I have my posts organized in subdirectories within the _posts and _drafts directories, and running the open commands or the promote command raises an IndexError and does nothing.

Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 526, in run_
    return self.run()
  File "jekyll in /home/felix/.config/sublime-text-3/Installed Packages/Jekyll.sublime-package", line 422, in run
  File "jekyll in /home/felix/.config/sublime-text-3/Installed Packages/Jekyll.sublime-package", line 422, in <lambda>
IndexError: list index out of range

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.