Giter VIP home page Giter VIP logo

ink's Introduction

Octopress

Octopress is an obsessively designed toolkit for writing and deploying Jekyll blogs. Pretty sweet, huh?

Gem Version Build Status

Installation

Install Octopress manually:

$ gem install octopress

Or if you use Bundler, add this line to your Gemfile:

gem 'octopress', '~> 3.0'

And then run:

$ bundle

New to bundler? Run gem install bundler then create a file named Gemfile in your site's root directory with the following content:

source 'https://rubygems.org'

gem 'octopress', '~> 3.0'

Run bundle to install the gems specified in your Gemfile.

Configuration

Octopress reads its configurations from _config.yml. Here's what the configuration looks like by default.

# Default extension for new posts and pages
post_ext: markdown
page_ext: html

# Default templates for posts and pages
# Found in _templates/
post_layout: post
page_layout: page

# Format titles with titlecase?
titlecase: true

# Change default template file (in _templates/)
post_template: post
page_template: page
draft_template: draft

Octopress CLI Commands

Here are the subcommands for Octopress.

init <PATH>         # Adds Octopress scaffolding to your site
new <PATH>          # Like `jekyll new` + `octopress init`
new post <TITLE>    # Add a new post to your site
new page <PATH>     # Add a new page to your site
new draft <TITLE>   # Add a new draft post to your site
publish <POST>      # Publish a draft from _drafts to _posts
unpublish <POST>    # Search for a post and convert it into a draft
isolate [POST]      # Stash all posts but the one you're working on for a faster build
integrate           # Restores all posts, doing the opposite of the isolate command
deploy              # deploy your site via S3, Rsync, or to GitHub pages.

Run octopress --help to list sub commands and octopress <subcommand> --help to learn more about any subcommand and see its options.

Init

$ octopress init <PATH> [options]

This will copy Octopress's scaffolding into the specified directory. Use the --force option to overwrite existing files. The scaffolding is pretty simple:

_templates/
  draft
  post
  page

New Post

This automates the creation of a new post.

$ octopress new post "My Title"

This will create a new file at _posts/YYYY-MM-DD-my-title.markdown with the following YAML front-matter already added.

layout: post
title: "My Title"
date: YYYY-MM-DDTHH:MM:SS-00:00

Command options

Option Description
--template PATH Use a template from
--date DATE The date for the post. Should be parseable by Time#parse
--slug SLUG Slug for the new post.
--dir DIR Create post at _posts/DIR/.
--force Overwrite existing file.

New Page

Creating a new page is easy, you can use the default file name extension (.html), pass a specific extension, or end with a / to create an index.html document.

$ octopress new page some-page           # ./some-page.html
$ octopress new page about.md            # ./about.md
$ octopress new page docs/               # ./docs/index.html

If you are working with collections, you might add a page like this:

$ octopress new page _legal/terms        # ./_legal/terms.html

After the page is created, Octopress will tell you how to configure this new collection.

Command options

Option Description
--template PATH Use a template from
--title TITLE The title of the new page
--date DATE The date for the page. Should be parseable by Time#parse
--force Overwrite existing file.

Note: The default page template doesn't expect a date. If you want to add dates to your pages, consider adding date: {{ date }} to the default template _templates/page, or create a new template to use for dated pages. Otherwise, you will have the --date option to add a date to a page.

New Draft

This will create a new post in your _drafts directory.

$ octopress new draft "My Title"
Option Description
--template PATH Use a template from
--date DATE The date for the draft. Should be parseable by Time#parse (defaults to Time.now)
--slug SLUG The slug for the new post.
--force Overwrite existing file.

Publish a draft

Use the publish command to publish a draft to the _posts folder. This will also rename the file with the proper date format.

$ octopress publish _drafts/some-cool-post.md
$ octopress publish cool

In the first example, a draft is published using the path. The publish command can also search for a post by filename. The second command would work the same as the first. If other drafts match your search, you will be prompted to select them from a menu. This is often much faster than typing out the full path.

Option Description
--date DATE The date for the post. Should be parseable by Time#parse
--slug SLUG Change the slug for the new post.
--dir DIR Create post at _posts/DIR/.
--force Overwrite existing file.

When publishing a draft, the new post will use the draft's date. Pass the option --date now to the publish command to set the new post date from your system clock. As usual, you can pass any compatible date string as well.

Unpublish a post

Use the unpublish command to move a post to the _drafts directory, renaming the file according to the drafts convention.

$ octopress unpublish _posts/2015-01-10-some-post.md
$ octopress unpublish some post

Just like the publish command, you can either pass a path or a search string to match the file name. If more than one match is found, you will be prompted to select from a menu of posts.

Templates for Posts and pages

Octopress post and page templates look like this.

---
layout: {{ layout }}
title: {{ title }}
---

Dates get automatically added to a template for posts, and for pages if a --date option is set.

You can add to the YAML front matter, add content below and even use liquid tags and filters from your site's plugins. There are a handful of local variables you can use when working with templates.

Variable Description
date The date (if set) or Time.now.iso8601
title The title of the page (if set)
slug The title in slug form
ymd The date string, YYYY-MM-DD format
year The date's year
month The date's month, MM
day The date's day, DD

By default Octopress has templates for pages, posts and drafts. You can change them or create new ones for different types of content. To create linkposts template, add a file at _templates/linkpost, such as:

---
title: {{ title }}
external-url: {{ url }}
---

Then you can use it with a new post like this:

$ octopress new post "Some title" --template linkpost
$ octopress new post "Some title" -tm _templates/linkpost

In the second example, I'm passing the full template file path. This way I can use my shell's tab to auto-complete feature.

When creating templates, file name extensions are unnecessary since the files are just plain text anyway.

Isolate

The isolate command will allow you to stash posts in _posts/_exile where they will be ignored by Jekyll during the build process. Run octopress integrate to restore all exiled posts. This can be helpful if you have a very large site and you want to quickly preview a build for a single post or page.

$ octopress isolate                                # Move all posts
$ octopress isolate _posts/2014-10-11-kittens.md   # Move post at path
$ octopress isolate kittens                        # Move post matching search

In the third example, if multiple posts match the search a prompt will ask you to select a post from a menu.

Deploying your site

The Octopress gem comes with octopress-deploy which allows you to easily deploy your site with Rsync, on S3 or Cloudfront, to GitHub pages, or other Git based deployment hosting platforms.

Once you've built your site (with jekyll build) you can deploy it like this:

$ octopress deploy

This reads a _deploy.yml configuration and deploys your site. Read below to learn how Octopress can generate a deployment configuration file for you.

Note: The _deploy.yml is processed through ERB, which makes it easy to load configurations from environment variables.

Deploy has a few commands you should know.

Commands Description
octopress deploy Deploy your site (based on the _deploy.yml configuration)
octopress deploy init <METHOD> [options] Generate a config file for the deployment method. (git, s3, rsync)
octopress deploy pull [DIR] Pull down your site into a local directory.
octopress deploy add-bucket <NAME> (S3 only) Add a bucket using your configured S3 credentials.

Generate Deployment configuration

Remember to add your configuration to .gitignore to be sure you never commit sensitive information to your repository.

Octopress can generate a deployment configuration file for you using the octopress deploy init command.

$ octopress deploy init s3
$ octopress deploy init rsync
$ octopress deploy init git [email protected]:user/project

This will generate a _deploy.yml file in your current directory which you can edit to add any necessary configuration.

If you like, you can pass configurations as command line options. To see specific options for any method, add the --help flag. For example to see the options for configuring S3:

$ octopress deploy init s3 --help

If you want to publish your site to a staging server, you can create a second configuration. For example, to setup rsync for a staging site, you'd do this.

$ octopress deploy init rsync --config _staging.yml

After modifying the configuration file, you can deploy your site to it like this:

$ octopress deploy --config _staging.yml

Git Deployment Configuration

Only git_url is required. Other options will default as shown below.

Config Description Default
method Deployment method, in this case use 'git'
site_dir Path to static site files _site
git_url Url for remote git repository
git_branch Deployment branch for git repository master
deploy_dir Directory where deployment files are staged .deploy
remote Name of git remote deploy

Rsync Deployment Configuration

Config Description Default
method Deployment method, in this case use 'rsync'
site_dir Path to static site files _site
user ssh user, e.g [email protected]
port ssh port 22
remote_path Remote destination's document root
exclude_from Path to a file containing rsync exclusions
exclude Inline list of rsync exclusions
include_from Path to a file containing rsync inclusions
include Inline list of inclusions to override exclusions
delete Delete files in destination not found in source false

You can rsync to a local directory by configuring remote_path and leaving off user and port.

Amazon S3 Deployment Configuration

To deploy with Amazon S3 you will need to install the aws-sdk-v1 gem.

Important: when using S3, you must add your _deploy.yml to your .gitignore to prevent accidentally sharing account access information.

Config Description Default
method Deployment method, in this case use 's3'
site_dir Path to static site files _site
bucket_name S3 bucket name
access_key_id AWS access key
secret_access_key AWS secret key
distribution_id [optional] AWS CloudFront distribution id
remote_path Directory files should be synced to. /
verbose [optional] Display all file actions during deploy. false
incremental [optional] Incremental deploy (only updated files) false
region [optional] Region for your AWS bucket us-east-1
delete Delete files in remote_path not found in site_dir false
headers Set headers for matched files []

If you choose a bucket which doesn't yet exist, Octopress Deploy will offer to create it for you, and offer to configure it as a static website.

If you configure Octopress to delete files, all files found in the remote_path on S3 bucket will be removed unless they match local site files. If remote_path is a subdirectory, only files in that subdirectory will be evaluated for deletion.

You can also set up your configuration to read your AWS credentials from your environment variables using ERB like this:

access_key_id: <%= ENV['AWS_ACCESS_KEY'] %>
secret_access_key: <%= ENV['AWS_SECRET_KEY'] %>
S3 Headers

You can create an array of header configs to set expiration, content and cache settings for any paths matching the filename.

Header Config Description Default
filename A regex or a substring of the file to match
site_dir An http date or a number of years or days from now
content_type A string which is passed through to the headers
content_encoding A string which is passed through to the headers
cache_control A string which is passed through to the headers

Here is how you might set expiration and cache controls for CSS and Javascript files.

headers:
  - filename: '^assets.*\.js$'
    expires: '+3 years'
    cache_control: 'max-age=94608000'
    content_type: 'application/javascript'
  - filename: '^assets.*\.css$'
    expires: '+3 years'
    cache_control: 'max-age=94608000'
    content_type: 'text/css'
AWS config via ENV

If you prefer, you can store AWS access credentials in environment variables instead of a configuration file.

Config ENV var
access_key_id AWS_ACCESS_KEY_ID
secret_access_key AWS_SECRET_ACCESS_KEY

Note: configurations in _deploy.yml will override environment variables so be sure to remove those if you decide to use environment variables.

Pull down your site

With the pull command, you can pull your site down into a local directory.

$ octopress deploy pull [DIR]

Mainly you'd do this if you're troubleshooting deployment and you want to see if it's working how you expected.

Contributing

  1. Fork it ( https://github.com/octopress/octopress/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

ink's People

Contributors

chauncey-garrett avatar fehwalker avatar imathis avatar maiertech avatar parkr avatar tra 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ink's Issues

CLI: ink copy

I'm not sure if copy is the right name for the command, so if you have a different opinion, chime in. :) Here's what it will do though.

Plugins and themes ship with assets, configurations, layouts and includes. This command would allow users to copy assets directly into their sites and customize them. These assets would override the assets in the gem.

# syntax
octopress ink copy PLUGIN_NAME [options]
# description
"Copy plugin assets, includes, layouts, and configuration into your site for easy modification."
# options:
--fonts
--files
--includes
--images
--javascripts
--layouts
--stylesheets
--all

Example

octopress ink copy steve --layouts

This would copy the layouts to from the "steve" plugin to _plugins/steve/layouts/, creating that directory if it does not exist.

Output

From the example above the output might be this:

Octopress has copied the following layouts from the steve plugin:
- default.html
- post.html
- page.html
You can find them in [source_dir]/_plugins/steve/layouts/.

A block like this would be printed for each asset type which was copied.

Using Sass framework like Bourbon or Neat in ink plugin

I would like to use Sass frameworks Bourbon and Neat in an Octopress Ink plugin. I copied Sass files to

  • assets/stylesheets/bourbon
  • assets/styelsheets/neat

I have a styles.scss in assets/stylesheets in which I do @import 'bourbon/bourbon. When I do a jekyll build I get an error that files from within the bourbon or neat directories are note found.

Do I have to add subdirectories to the load path and if yes how?

Jekyll won't parse frontmatter from outside the source directory

Not sure if this is a recent change (I just started poking around the new octopress recently), but Jekyll refuses to load yaml frontmatter from anything outside the site source directory. So if a layout exists in a plugin, it won't be processed (and throws an error) such as:

Error reading file /home/skroll/src/theme-test/assets/layouts/post.html: No such file or directory @ rb_sysopen - /home/skroll/src/octopress-site-test/home/skroll/src/theme-test/assets/layouts/post.html

You can see how it just appended the absolute path to the end of the site's path. Currently it seems Jekyll's layouts use Jekyll::Site#in_source_dir to generate the path sent to the yaml parser, which in turn ensures that a path exists within the site path, and won't take absolute paths.

Compress javascripts independently and cache compiled js

  • Javascripts should be compressed and cached individually; then combined.
  • By default, plugins should sort their own javascripts with .min.js at the top, and then sort by path. Nah, I'd rather make ordering explicit.
  • Allow explicit ordering of JS and CSS asset files in plugin configurations.

Configuration: disable 'automatic' assets

By default each plugin or theme registers assets, pages, includes and layouts with Jekyll. Currently you can override anything by replacing a modified version it in the corresponding directory. If a plugin is called "steve" you could replace it's stylesheet 'banana.scss' by adding a file to _plugins/steve/stylesheets/banana.scss.

Ok, but what if you want to tell steve you don't want his banana? Yeah we need a way to disable automatic assets.

Disable assets of each kind

I'm thinking in _plugins/steve/config.yml you might have:

stylesheets: false
images: false

This would prevent the plugin from adding those images or stylesheets to the site.

Disabling specific assets

I can see it being useful to be able to disable one javascript and not all javascripts. I'm thinking of the best way to do that. Here's an idea.

javascripts: 
  not:
    - awesome.js
    - stuff/stupid.js.coffee

Or if you wanted to disable everything except a specific file, you might do:

javascripts:
  only:
    - beans.js
    - kittens.js.coffee

This seems to offer a nice range of options which allow people to customize just about anything short of forking a plugin.

Thoughts?

Plugin not registering; registered plugin not enabled

I'm having trouble getting Ink working. I have been trying to install a couple of plugins and it is not working out for me.

# Gemfile
...
gem 'octopress-ink'

group :octopress do
  gem 'octopress-codefence'
  gem 'octopress-solarized'
end

Then added the following lines to _config.yml (wasn't sure if they were still needed, but codefense started working when I added them)

gems:
  - octopress-codefence
  - octopress-solarized

When I run Ink, I see that it knows about solarized, but not codefence.

$ bundle exec octopress ink list
Octopress Ink - v1.0.0.rc.56
 Octopress Solarized (octopress-solarized) - v1.0.3
Style code snippets with Ethan Schoonover's Solarized theme (tweaked a bit).

However, only codefence appears to actually be enabled on the site:
Block of code with codefence but no solarized

So at this point I'm guessing that the codefense plugin doesn't work within Ink, and that somehow Ink is not being used in my site. Am I doing something foolish here?

List of thirdparty octopress 3 plugins?

Hi,

I have created a plugin for creating captioned images under octopress 3. It was mostly done as a learning experience, but on the off chance its useful to anyone else, is there a page I can add it to?

The plugin is octopress-captioned-image.

Also, is there any objection to my publishing the gem with the octopress- prefix? Are you trying to reserve this for core octopress gems?

I'm also working on a gem for converting jekyll themes to octopress ink themes, but that is proving rather more complex. Will likely end up being more of a helper, requiring dev to tweak the output, especially where theme config files are concerned.

Thanks for all the great work on octopress 2 and looking forward to the release of v3.

Ink does not see plugins

I've put all the plugins in the Gemfile like this:

group :jekyll_plugins do
    gem 'octopress-feeds'
end

However octopress ink list does not recognize them:

Octopress Ink - v1.0.0.rc.30
You have no plugins installed.

undefined method `[]' for nil:NilClass

I'm running into

 undefined method `[]' for nil:NilClass

when trying to run any ink command (even list). The full stack trace is

/Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-date-format-3.0.2/lib/octopress-date-format.rb:78:in `format_date': undefined method `[]' for nil:NilClass (NoMethodError)
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-date-format-3.0.2/lib/octopress-date-format.rb:42:in `hack_date'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-date-format-3.0.2/lib/octopress-date-format.rb:27:in `post_init'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:374:in `block in post_init'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:373:in `each'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:373:in `post_init'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:325:in `initialize'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:220:in `new'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:220:in `block in read_content'        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:219:in `map'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:219:in `read_content'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:195:in `read_posts'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-2.5.3/lib/jekyll/site.rb:167:in `read_directories'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-asset-pipeline-2.0.4/lib/octopress-asset-pipeline.rb:30:in `add_files'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-asset-pipeline-2.0.4/lib/octopress-asset-pipeline.rb:24:in `register'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-ink-1.1.4/lib/octopress-ink/plugins.rb:59:in `each'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-ink-1.1.4/lib/octopress-ink/plugins.rb:59:in `register'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-ink-1.1.4/lib/octopress-ink.rb:134:in `list'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-ink-1.1.4/lib/octopress-ink/commands/list.rb:14:in `block (2 levels) in process_command'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/gems/octopress-3.0.5/bin/octopress:8:in `<top (required)>'
        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/bin/octopress:23:in `load'        from /Users/fredrik/.rvm/gems/ruby-2.0.0-p247/bin/octopress:23:in `<main>'

I assume this has something to do with date formatting, and as far as I can see the config object seems to be missing in octopress-date-format. This used to work until a recent gem upgrade.

Relevant gem versions:

  * octopress (3.0.5)
  * octopress-asset-pipeline (2.0.4)
  * octopress-assign-tag (1.0.3)
  * octopress-autoprefixer (1.0.1)
  * octopress-categories (0.0.1)
  * octopress-code-highlighter (4.2.4)
  * octopress-codeblock (1.0.5)
  * octopress-codefence (1.6.1)
  * octopress-comment-tag (1.0.1)
  * octopress-content-for (1.0.4)
  * octopress-date-format (3.0.2)
  * octopress-deploy (1.2.4)
  * octopress-escape-code (2.0.6)
  * octopress-feeds (2.0.4)
  * octopress-filter-tag (1.0.2)
  * octopress-filters (1.3.3)
  * octopress-genesis-theme (0.0.10)
  * octopress-hooks (2.6.1)
  * octopress-image-tag (1.1.0)
  * octopress-include-tag (1.1.3)
  * octopress-ink (1.1.4)
  * octopress-linkblog (2.0.2)
  * octopress-littlefoot (1.0.1)
  * octopress-paginate (1.1.2)
  * octopress-pullquote-tag (1.0.1)
  * octopress-quote-tag (1.0.4)
  * octopress-render-tag (1.0.7)
  * octopress-return-tag (1.0.1)
  * octopress-social (1.4.5)
  * octopress-solarized (1.1.2)
  * octopress-tag-helpers (1.0.7)
  * octopress-wrap-tag (1.1.1)

Gem must be in both :jekyll_plugins and :octopress to work

When using an ink plugin via a gem in a site, if it's not in both the :octopress and :jekyll_plugins then it cannot be used in both jekyll and ink.

For example:

group :jekyll_plugins do
  gem 'my-ink-plugin'
end

will cause the plugin to work in jekyll, but you cannot access it with octopress ink list.

In

group :octopress do
  gem 'my-ink-plugin'
end

then the plugin will show up in octopress ink list but it won't be used when the site is built with jekyll build. Of course you can always do:

group :jekyll_plugins, :octopress do
  gem 'my-ink-plugin'
end

but that seems to be a bit janky.

Define order in the javascript files

Is there are any supported (or planned to support) method to define requirements for js plugins. (like // = require in sprockets)?

I am trying to port one theme from octopress 2.0 to ink and need more flexibility in defining js concatenating order.

Write tests for Sass

Test the following:

  • Plugin/Theme sass files are generated with site
  • Overrides on sass files
    • Overrides allow either syntax
    • Overrides work for main files or partials
  • Default Sass plugin:
    • globs and installs from source/stylesheets
    • Override glob by setting _config.yml octopress: sass: files: [array of sass]
    • Set media for a sass file with tuples in sass: files: config [file.sass, print]
  • Compression settings
  • Line number setting

Jekyll 3 changed site.posts from an Array to a Collection which causes deprecation warning in Ink

Starting a new blog and testing generating after just init-ing things (i.e only have the automatic first post and default index.html, etc.) trying to use Jekyll 3.0.1 and Octopress 3.0.11.

Here are the gems in my _config.yml:

gems:
  - octopress-codefence
  - octopress-code-highlighter
  - octopress-minify-html
  - octopress-social
  - octopress-solarized

Running jekyll b yields:

Deprecation: Collection#empty? should be called on the #docs array directly.
                    Called by /usr/local/lib/ruby/gems/2.3.0/gems/octopress-ink-1.2.1/lib/octopress-ink/plugin/bootstrap.rb:163:in `posts?'.
Deprecation: Collection#select should be called on the #docs array directly.
                    Called by /usr/local/lib/ruby/gems/2.3.0/gems/octopress-ink-1.2.1/lib/octopress-ink/plugin/bootstrap.rb:171:in `linkposts?'.
Liquid Exception: no implicit conversion of nil into String in _posts/2015-12-27-welcome-to-jekyll.markdown

As far as I can tell, the deprecation warnings are because of jekyll/jekyll#4055
The final line seems to be the same octopress/hooks issue as octopress/linkblog#6 (My stack trace comes down to the same ``expand_path': no implicit conversion of nil into String (TypeError)`)

Error after updating to Ink 1.0.0.rc.13

After updating octopress-ink I get

octopress 3.0.0.rc.14 | Error:  undefined method `site' for Octopress::Ink:Module

when trying to build my website, which uses octopress-asset-pipeline 1.0.1 to minify and combine css files.

Missing Dependency - pry-byebug

I updated the version of the ink gem to 1.0.0.rc.52 tonight and jekyll would no longer build. The output is reproduced below.

I was able to get my site to build by adding gem 'pry-byebug' to my Gemfile, so I'm assuming the dependency on pry-byebug probably just needs to be added.

$ bundle exec jekyll build
Configuration file: /Users/david/Repositories/davidized/_config.yml
            Source: /Users/david/Repositories/davidized
       Destination: _site
      Generating...
/Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-ink-1.0.0.rc.52/lib/octopress-ink/plugin/bootstrap.rb:226:in `require': cannot load such file -- pry-byebug (LoadError)
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-ink-1.0.0.rc.52/lib/octopress-ink/plugin/bootstrap.rb:226:in `add_meta_indexes'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-ink-1.0.0.rc.52/lib/octopress-ink/plugin/bootstrap.rb:149:in `inject_pages'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-ink-1.0.0.rc.52/lib/octopress-ink/plugin/bootstrap.rb:67:in `bootstrap_plugin'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-ink-1.0.0.rc.52/lib/octopress-ink/plugin.rb:73:in `register'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-ink-1.0.0.rc.52/lib/octopress-ink/plugins.rb:56:in `each'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-ink-1.0.0.rc.52/lib/octopress-ink/plugins.rb:56:in `register'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-ink-1.0.0.rc.52/lib/octopress-ink/jekyll/hooks.rb:13:in `post_read'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-hooks-2.6.0/lib/octopress-hooks.rb:184:in `block in read'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-hooks-2.6.0/lib/octopress-hooks.rb:183:in `each'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/octopress-hooks-2.6.0/lib/octopress-hooks.rb:183:in `read'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:49:in `process'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
    from /Users/david/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
    from /Users/david/Repositories/davidized/.bundle/bin/jekyll:16:in `load'
    from /Users/david/Repositories/davidized/.bundle/bin/jekyll:16:in `<main>'

Copy creates doubled full paths under octopress home folder

I have my octopress working folder under /export/storage/dev/blog. I've defined octopress-genesis in my _config.yml using:

gems:

  • octopress-genesis

When I run 'octopress ink copy theme' the theme is copied, but the path it's copied to is /export/storage/dev/blog/export/storage/dev/blog/_plugins (the octopress home path is doubled).

Fonts copied to _site/plugin-slug/fonts/

Not sure if this was intended or not. I'm not familiar enough with clash to write a test for this, but font's are currently being copied into _site/plugin-slug/fonts instead of _site/fonts/plugin-slug/ as referenced in the docs. I can whip up a PR for either changing it to import to _site/fonts/plugin-slug/ or a PR on the docs.

Ink undefined method error with feeds enabled

Trying to get the RSS feeds to work, at this point I think I've enabled every repo within the Octopress github (as there were some hidden dependancies).

I'm trying to enable feeds but I'm getting this error:

Generating... 
Liquid Exception: undefined method `site' for Octopress::Ink:Module in main-feed.xml
jekyll 2.5.3 | Error:  undefined method `site' for Octopress::Ink:Module

If I disable - octopress-feeds within my _config.yml, I don't get an error.

I'm not sure where a method is being defined (under Ink or feeds) to generate this error. Here is my bundle show:

Gems included by the bundle:
  * autoprefixer-rails (2.2.0.20140804)
  * blankslate (2.1.2.4)
  * bundler (1.7.7)
  * celluloid (0.16.0)
  * classifier-reborn (2.0.3)
  * coffee-script (2.3.0)
  * coffee-script-source (1.8.0)
  * colorator (0.1)
  * execjs (2.2.2)
  * fast-stemmer (1.0.2)
  * ffi (1.9.6)
  * hitimes (1.2.2)
  * jekyll (2.5.3)
  * jekyll-coffeescript (1.0.1)
  * jekyll-gist (1.1.0)
  * jekyll-paginate (1.1.0)
  * jekyll-sass-converter (1.3.0)
  * jekyll-watch (1.2.0)
  * json (1.8.1)
  * kramdown (1.5.0)
  * liquid (2.6.1)
  * listen (2.8.4)
  * mercenary (0.3.5)
  * octopress (3.0.0.rc.25)
  * octopress-abort-tag (1.0.2)
  * octopress-asset-pipeline (1.1.4)
  * octopress-assign-tag (1.0.0)
  * octopress-autoprefixer (1.0.0)
  * octopress-capture-tag (1.0.0)
  * octopress-code-highlighter (4.2.3)
  * octopress-codeblock (1.0.5)
  * octopress-codefence (1.5.1)
  * octopress-comment-tag (1.0.0)
  * octopress-content-for (1.0.1)
  * octopress-date-format (2.0.2)
  * octopress-deploy (1.0.3)
  * octopress-escape-code (2.0.6)
  * octopress-feeds (1.0.0)
  * octopress-filter-tag (1.0.0)
  * octopress-filters (1.2.0)
  * octopress-genesis-theme (0.0.3)
  * octopress-gist (1.3.5)
  * octopress-hooks (2.2.3)
  * octopress-include-tag (1.0.1)
  * octopress-ink (1.0.0.rc.24)
  * octopress-linkblog (1.2.0)
  * octopress-quote-tag (1.0.0 f00d9b5)
  * octopress-render-code (1.0.4)
  * octopress-render-tag (1.0.5)
  * octopress-return-tag (1.0.1)
  * octopress-solarized (1.0.3)
  * octopress-tag-helpers (1.0.2)
  * octopress-wrap-tag (1.0.0)
  * parslet (1.5.0)
  * posix-spawn (0.3.9)
  * pygments.rb (0.6.0)
  * rb-fsevent (0.9.4)
  * rb-inotify (0.9.5)
  * redcarpet (3.2.2)
  * rubypants-unicode (0.2.5)
  * safe_yaml (1.0.4)
  * sass (3.4.9)
  * timers (4.0.1)
  * titlecase (0.1.1)
  * toml (0.1.2)
  * uglifier (2.6.1)
  * yajl-ruby (1.1.0)

CLI: ink info

Syntax:

octopress ink info [plugin_name] [options]

This would output information about Octopress ink and list all plugins and their versions.

For example octopress ink info would return:

Octopress Ink - v1.0.3
website: http://octopress.org/ink/
Plugins:
- octopress-pygments v1.5.1
- some-plugin v0.0.5

If a plugin name is passed, octopress ink some-plugin this will list the plugin name, version and website and then it would list out all of the assets used by the plugin. Here's an example.

awesome-plugin (theme) - v1.0.0
Site: https://github.com/some-guy/plugin-name
Layouts:
  - default.html
  - page.html
  - post.html (from: _plugins/theme/layouts/)
Files:
  - favicon.ico
  - robots.txt
Stylesheets:
  - site.scss (from: _plugins/theme/stylesheets/)

If you just wanted to know about one type of asset you could pass the asset type as a flag. For example:

octopress ink info steve --layouts --includes

Here would be the output.

Steve (plugin) - v1.5.2
Site: https://github.com/mrsteve/octopress-steve
Layouts:
  - default.html
  - page.html
  - post.html (from: _plugins/theme/layouts/)
Includes: none

Ink pulling in backup .scss~ files

I'm porting a bootstrap theme to Ink, so I have the gem set to a local path. This resulted in Ink picking up an Emacs backup of a .scss file.
[29] pry(Octopress::Ink::PluginAssetPipeline)> stylesheets['all'].map {|f| f.file }
=> ["grayscale-sass-ink.scss", "theme.scss~"]

Documentation asset type

To encourage plugin documentation I want to add a doc asset type which will let plugins register pages as documentation. These will be just like pages except they won't respect user overrides, and won't be installed with the octopress copy command. They will integrate into the Octopress CLI so that when a user runs octopress docs these pages will be copied to _site/plugins/[plugin_name]/[file]. This way if theme and plugin authors document their projects, users will be able to view their documentation alongside the octopress docs and other plugin docs offline with the octopress docs command.

Plugin authors won't have to maintain many versions of their documentation on a website and users will always have access to the most accurate documentation for each of their plugin version.

For authors who create a simple plugin where the documentation easily fits in their project readme, they should be able to use the {% render %} tag to include their readme file so they don't have to maintain two separate documentation files.

The upcoming octopress docs site will have a layout theme:docs which is what these doc pages will use to ensure they fit in the docs site properly.

Can't get path of layout from plugin

Not sure whether I'm doing something wrong (and I probably do).
I'm working on a ink based plugin right now and I'm having issue getting the path of a layout file.
It's loading just fine, but when I try to get the path, I only get:
undefined method 'path' for #<Octopress::Ink::Layout:0x007fcf970200a8> (NoMethodError).

I'm trying to create a (dynamic) set of pages from a template.

Suggestions?

CLI: Ink <plugins or theme>

  • octopress ink plugins - list all plugins and their version numbers.
  • octopress ink theme - list the theme and it's version number.

Pagination with theme gem

I'm working on a theme gem for Octopress 3 and I'm having trouble getting Jekyll to generate paginated pages from the index.html inside the gem. Has anyone else had issues with this?

Things I've noticed:

  • If no pagination is required (i.e. no page2 gets created), it doesn't show it's head
  • If pagination is required, it throws the following error, once for every paginated page it's trying to create (excluding the first):
    • Error reading file /path/to/gem/test/index.html: No such file or directory @ rb_sysopen - /path/to/myGem/test/index.html
  • If I move the index.html from ../myGem/assets/pages/ to ../myGem/test/ it paginates everything correctly.
    • I'm trying to avoid making someone copy code from my repo to get the gem working correctly, so I don't really see this as a solution.

I'm looking at the Genesis Theme and I can't find anything egregiously wrong with what I'm doing. Does anyone have any insights?
Link to my code.

error while updating gems

Hey guys,

While I was trying to update all gems in local, I got error below.

❯ gem update 
Updating octopress-ink
ERROR:  While executing gem ... (Gem::UnsatisfiableDependencyError)
    Unable to resolve dependency: 'octopress-ink (= 1.0.0.rc.16)' requires 'octopress (>= 0)'

Wonder the reason why?

Deprecations when calling methods on 'posts' in Jekyll 3.4.3

Deprecation: posts.empty? should be changed to posts.docs.empty?.
                    Called by /usr/local/var/rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/octopress-ink-1.2.1/lib/octopress-ink/plugin/bootstrap.rb:163:in `posts?'.

https://github.com/octopress/ink/blob/master/lib/octopress-ink/plugin/bootstrap.rb#L163

Deprecation: posts.select should be changed to posts.docs.select.
                    Called by /usr/local/var/rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/octopress-ink-1.2.1/lib/octopress-ink/plugin/bootstrap.rb:171:in `linkposts?'.

https://github.com/octopress/ink/blob/master/lib/octopress-ink/plugin/bootstrap.rb#L171

I don't super understand the Jekyll code, but this deprecation was introduced when moving from 2.x to 3.x. It seems like there will be a breaking change at some point such that these (enumerable-ish? collection-ish?) methods will no longer be defined on whatever pages returns, but instead on pages.docs.

Should be a straightforward fix - I'll have a look.

No such file or directory when looking for cache dir

$ bundle exec jekyll serve -t
[...]
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/find.rb:40:in `block in find': No such file or directory (Errno::ENOENT)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/find.rb:40:in `collect!'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/find.rb:40:in `find'
    from /Library/Ruby/Gems/2.0.0/gems/octopress-ink-1.0.0.rc.33/lib/octopress-ink/cache.rb:33:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/octopress-ink-1.0.0.rc.33/lib/octopress-ink/cache.rb:33:in `to_a'
    from /Library/Ruby/Gems/2.0.0/gems/octopress-ink-1.0.0.rc.33/lib/octopress-ink/cache.rb:33:in `clean'
[...]

ink v1.0.0.rc.34 is broken

Something is broken in RC 34. It does not find includes in subfolders, I guess. This worked fine in RC 32 and 33.

Running Jekyll...
Configuration file: c:/Users/Thilo.Maier/Repositories/UNStats-theme/test/source/_config.yml
            Source: c:/Users/Thilo.Maier/Repositories/UNStats-theme/test/source
       Destination: c:/Users/Thilo.Maier/Repositories/UNStats-theme/test/source/_site
      Generating...
  Liquid Exception: Include failed: {% include theme:structures/snippetList.html count="2" %}. The plugin 'theme' does not have an include named 'structures/sni
ppetList.html'. in _layouts/post.html
rake aborted!
IOError: Include failed: {% include theme:structures/snippetList.html count="2" %}.
The plugin 'theme' does not have an include named 'structures/snippetList.html'.
c:/Users/Thilo.Maier/Repositories/UNStats-theme/Rakefile:25:in `block (2 levels) in <top (required)>'
NoMethodError: undefined method `read' for #<String:0x0000000750b4a8>
c:/Users/Thilo.Maier/Repositories/UNStats-theme/Rakefile:25:in `block (2 levels) in <top (required)>'

Octopress ink crashes

I'm trying to use your littlefoot plugin -- but I need to make some modifications to support the way that Pandoc labels footnotes in html. I was hoping to be able to do this with octopress ink copy, but when I run octopress ink list littlefoot I get the following errors:

octopress ink list littlefoot
/Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:29:in `require': cannot load such file -- octopress-littlefoot (LoadError)
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:29:in `block in require_gems'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `each'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `require_gems'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:19:in `conscientious_require'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:79:in `setup'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:41:in `initialize'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/octopress-3.0.7/lib/octopress.rb:68:in `new'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/octopress-3.0.7/lib/octopress.rb:68:in `read_site'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/octopress-3.0.7/lib/octopress.rb:61:in `site'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/octopress-ink-1.1.4/lib/octopress-ink.rb:150:in `plugin_list'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/octopress-ink-1.1.4/lib/octopress-ink/commands/list.rb:17:in `block (2 levels) in process_command'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
    from /Users/davidsmith/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/octopress-3.0.7/bin/octopress:8:in `<top (required)>'
    from /Users/davidsmith/.rbenv/versions/2.2.2/bin/octopress:23:in `load'
    from /Users/davidsmith/.rbenv/versions/2.2.2/bin/octopress:23:in `<main>'

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.