├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── Gemfile
├── LICENSE.txt
├── README.md
├── Rakefile
├── assets
├── docs
│ ├── _configuration.markdown
│ ├── _plugin-template.markdown
│ ├── creating-a-plugin.markdown
│ ├── index.markdown
│ ├── plugin-reference.markdown
│ └── working-with-plugins.markdown
└── js
│ └── loadCSS.js
├── lib
├── octopress-ink.rb
└── octopress-ink
│ ├── assets.rb
│ ├── assets
│ ├── asset.rb
│ ├── coffeescript.rb
│ ├── config.rb
│ ├── file.rb
│ ├── javascript.rb
│ ├── lang_config.rb
│ ├── layout.rb
│ ├── local_template.rb
│ ├── page.rb
│ ├── sass.rb
│ ├── stylesheet.rb
│ └── template.rb
│ ├── cache.rb
│ ├── commands.rb
│ ├── commands
│ ├── copy.rb
│ ├── helpers.rb
│ ├── init.rb
│ ├── list.rb
│ └── new.rb
│ ├── configuration.rb
│ ├── jekyll
│ ├── convertible.rb
│ ├── hooks.rb
│ ├── layout.rb
│ ├── page.rb
│ ├── static_file.rb
│ └── static_file_content.rb
│ ├── plugin.rb
│ ├── plugin
│ └── bootstrap.rb
│ ├── plugin_asset_pipeline.rb
│ ├── plugins.rb
│ ├── tags.rb
│ ├── tags
│ ├── category_tag.rb
│ ├── feed_updated_tag.rb
│ ├── feeds_tag.rb
│ ├── javascript.rb
│ ├── set_lang.rb
│ └── stylesheet.rb
│ ├── utils.rb
│ ├── version.rb
│ └── watch.rb
├── octopress-ink.gemspec
└── test
├── _clash.yml
├── _ink_plugins
├── awesome-sauce
│ ├── assets
│ │ ├── config.yml
│ │ ├── docs
│ │ │ └── index.html
│ │ ├── files
│ │ │ └── robots.txt
│ │ ├── fonts
│ │ │ └── foo.otf
│ │ ├── includes
│ │ │ ├── dir
│ │ │ │ └── other-include.html
│ │ │ └── some-include.html
│ │ ├── layouts
│ │ │ └── test-layout.html
│ │ ├── pages
│ │ │ ├── a.html
│ │ │ ├── b.html
│ │ │ ├── config-test.html
│ │ │ └── dir
│ │ │ │ ├── c.html
│ │ │ │ └── d.html
│ │ └── stylesheets
│ │ │ ├── plugin-media-test@print.css
│ │ │ └── plugin-test.css
│ └── plugin.rb
├── bootstrap-local
│ └── plugin.rb
├── bootstrap-theme
│ ├── assets
│ │ └── templates
│ │ │ ├── main_feed.xml
│ │ │ └── post_index.html
│ └── plugin.rb
├── bootstrap
│ ├── assets
│ │ ├── includes
│ │ │ ├── category-loop.html
│ │ │ ├── post-loop.html
│ │ │ └── tag-loop.html
│ │ └── templates
│ │ │ ├── articles_feed.xml
│ │ │ ├── category_feed.xml
│ │ │ ├── category_index.html
│ │ │ ├── links_feed.xml
│ │ │ ├── main_feed.xml
│ │ │ ├── post_archive.html
│ │ │ ├── post_index.html
│ │ │ ├── tag_feed.xml
│ │ │ └── tag_index.html
│ └── plugin.rb
├── lang-test
│ ├── assets
│ │ ├── config.yml
│ │ └── config_de.yml
│ └── plugin.rb
└── test-theme
│ ├── assets
│ ├── config.yml
│ ├── files
│ │ ├── .foo
│ │ ├── disabled-file.txt
│ │ ├── favicon.ico
│ │ ├── favicon.png
│ │ └── test.html
│ ├── fonts
│ │ ├── font-one.otf
│ │ └── font-two.ttf
│ ├── includes
│ │ ├── bar.html
│ │ └── greet.html
│ ├── javascripts
│ │ ├── bar.js
│ │ ├── blah.coffee
│ │ ├── disable-this.js
│ │ ├── foo.js
│ │ └── jq.min.js
│ ├── layouts
│ │ ├── default.html
│ │ └── test.html
│ ├── pages
│ │ ├── disable-test.html
│ │ ├── four.xml
│ │ ├── one.xml
│ │ ├── three.md
│ │ └── two.md
│ ├── stylesheets
│ │ ├── disable-this.css
│ │ ├── disable.sass
│ │ ├── main.scss
│ │ ├── partials
│ │ │ └── _colors.scss
│ │ ├── theme-media-test@print.css
│ │ ├── theme-test.css
│ │ └── theme-test2.css
│ └── templates
│ │ ├── post_index.html
│ │ ├── template-override-test.html
│ │ └── template-test.html
│ └── plugin.rb
├── _posts
├── 2014-02-01-test-post.md
├── 2014-02-02-test-post-2.md
├── 2015-02-27-link-post-de.md
└── 2015-02-27-link-post.md
├── _templates
├── page
└── post
├── bootstrap-local
├── _config.yml
├── _expected
│ └── index.html
├── _layouts
│ └── post_index.html
├── _plugins
│ └── loader.rb
└── _posts
├── bootstrap-multilingual-linkblog
├── _config.yml
├── _expected
│ ├── archive
│ │ └── index.html
│ ├── de
│ │ ├── 2015
│ │ │ └── 02
│ │ │ │ └── 27
│ │ │ │ └── link-post-de.html
│ │ ├── archivieren
│ │ │ └── index.html
│ │ ├── awesome
│ │ │ └── 2014
│ │ │ │ └── 02
│ │ │ │ └── 01
│ │ │ │ └── test-post.html
│ │ ├── categories
│ │ │ └── awesome
│ │ │ │ └── index.html
│ │ ├── feed
│ │ │ ├── articles
│ │ │ │ └── index.xml
│ │ │ ├── categories
│ │ │ │ └── awesome
│ │ │ │ │ └── index.xml
│ │ │ ├── index.xml
│ │ │ ├── links
│ │ │ │ └── index.xml
│ │ │ └── tags
│ │ │ │ ├── nice
│ │ │ │ └── index.xml
│ │ │ │ └── sweet
│ │ │ │ └── index.xml
│ │ ├── index.html
│ │ └── tags
│ │ │ ├── nice
│ │ │ └── index.html
│ │ │ └── sweet
│ │ │ └── index.html
│ ├── en
│ │ ├── categories
│ │ │ └── cool
│ │ │ │ └── index.html
│ │ ├── cool
│ │ │ ├── 2014
│ │ │ │ └── 02
│ │ │ │ │ └── 02
│ │ │ │ │ └── test-post-2.html
│ │ │ └── 2015
│ │ │ │ └── 02
│ │ │ │ └── 27
│ │ │ │ └── link-post.html
│ │ ├── feed
│ │ │ ├── articles
│ │ │ │ └── index.xml
│ │ │ ├── categories
│ │ │ │ └── cool
│ │ │ │ │ └── index.xml
│ │ │ ├── index.xml
│ │ │ ├── links
│ │ │ │ └── index.xml
│ │ │ └── tags
│ │ │ │ └── sweet
│ │ │ │ └── index.xml
│ │ └── tags
│ │ │ └── sweet
│ │ │ └── index.html
│ └── index.html
├── _plugins
│ ├── bootstrap
│ │ ├── config.yml
│ │ ├── config_de.yml
│ │ └── templates
│ │ │ └── post_archive.html
│ └── loader.rb
└── _posts
├── bootstrap-no-linkposts
├── _config.yml
├── _expected
│ ├── 2014
│ │ └── 02
│ │ │ ├── 01
│ │ │ └── test-post.html
│ │ │ └── 02
│ │ │ └── test-post-2.html
│ ├── archive
│ │ └── index.html
│ ├── feed
│ │ └── index.xml
│ └── index.html
├── _plugins
│ ├── bootstrap
│ │ ├── config.yml
│ │ ├── config_de.yml
│ │ └── templates
│ │ │ └── post_archive.html
│ └── loader.rb
└── _posts
│ ├── 2014-02-01-test-post.md
│ └── 2014-02-02-test-post-2.md
├── bootstrap-no-posts
├── _config.yml
├── _expected
│ └── index.html
├── _plugins
│ ├── bootstrap
│ │ ├── config.yml
│ │ ├── config_de.yml
│ │ └── templates
│ │ │ └── post_archive.html
│ └── loader.rb
└── index.html
├── bootstrap
├── _config.yml
├── _expected
│ ├── 2015
│ │ └── 02
│ │ │ └── 27
│ │ │ └── link-post-de.html
│ ├── archive
│ │ └── index.html
│ ├── awesome
│ │ └── 2014
│ │ │ └── 02
│ │ │ └── 01
│ │ │ └── test-post.html
│ ├── categories
│ │ ├── awesome
│ │ │ └── index.html
│ │ └── cool
│ │ │ └── index.html
│ ├── category_tag_test.html
│ ├── cool
│ │ ├── 2014
│ │ │ └── 02
│ │ │ │ └── 02
│ │ │ │ └── test-post-2.html
│ │ └── 2015
│ │ │ └── 02
│ │ │ └── 27
│ │ │ └── link-post.html
│ ├── feed
│ │ ├── categories
│ │ │ ├── awesome
│ │ │ │ └── index.xml
│ │ │ └── cool
│ │ │ │ └── index.xml
│ │ ├── index.xml
│ │ └── tags
│ │ │ ├── nice
│ │ │ └── index.xml
│ │ │ └── sweet
│ │ │ └── index.xml
│ ├── index.html
│ └── tags
│ │ ├── nice
│ │ └── index.html
│ │ └── sweet
│ │ └── index.html
├── _plugins
│ ├── bootstrap
│ │ ├── config.yml
│ │ ├── config_de.yml
│ │ └── templates
│ │ │ └── post_archive.html
│ └── loader.rb
├── _posts
└── category_tag_test.html
├── multilingual
├── _config.yml
├── _expected
│ ├── de
│ │ ├── 2015
│ │ │ └── 02
│ │ │ │ └── 27
│ │ │ │ └── link-post-de.html
│ │ └── awesome
│ │ │ └── 2014
│ │ │ └── 02
│ │ │ └── 01
│ │ │ └── test-post.html
│ ├── en
│ │ └── cool
│ │ │ ├── 2014
│ │ │ └── 02
│ │ │ │ └── 02
│ │ │ │ └── test-post-2.html
│ │ │ └── 2015
│ │ │ └── 02
│ │ │ └── 27
│ │ │ └── link-post.html
│ └── lang
│ │ ├── deutsch.html
│ │ ├── english.html
│ │ ├── espanol.html
│ │ └── italiano.html
├── _includes
│ └── lang-test.html
├── _plugins
│ ├── lang-test
│ │ ├── config_de.yml
│ │ └── config_it.yml
│ └── loader.rb
├── _posts
└── lang
│ ├── deutsch.html
│ ├── english.html
│ ├── espanol.html
│ └── italiano.html
└── standard
├── _async_css.yml
├── _combine_false.yml
├── _compress_false.yml
├── _config.yml
├── _configure_asset_destination.yml
├── _expected
├── async_css
│ └── asset_tag.html
├── combine_false
│ ├── asset_tag.html
│ ├── javascripts
│ │ └── theme
│ │ │ ├── bar.js
│ │ │ ├── blah.js
│ │ │ ├── foo.js
│ │ │ └── jq.min.js
│ └── stylesheets
│ │ ├── awesome-sauce
│ │ ├── plugin-media-test-print.css
│ │ └── plugin-test.css
│ │ └── theme
│ │ ├── main.css
│ │ ├── theme-media-test-print.css
│ │ ├── theme-test.css
│ │ └── theme-test2.css
├── compress_false
│ ├── javascripts
│ │ └── all-.js
│ └── stylesheets
│ │ ├── all-.css
│ │ └── print-.css
├── configure_asset_destination
│ ├── asset_tag.html
│ ├── css
│ │ ├── all-.css
│ │ └── print-.css
│ └── js
│ │ └── all-.js
├── copy_layouts_pages
│ ├── layouts
│ │ ├── default.html
│ │ └── test.html
│ └── pages
│ │ ├── disable-test.html
│ │ ├── four.xml
│ │ ├── one.xml
│ │ ├── three.md
│ │ └── two.md
├── copy_test
│ ├── config.yml
│ ├── files
│ │ ├── disabled-file.txt
│ │ ├── favicon.ico
│ │ ├── favicon.png
│ │ └── test.html
│ ├── fonts
│ │ ├── font-one.otf
│ │ └── font-two.ttf
│ ├── includes
│ │ ├── bar.html
│ │ └── greet.html
│ ├── javascripts
│ │ ├── bar.js
│ │ ├── blah.coffee
│ │ ├── disable-this.js
│ │ ├── foo.js
│ │ └── jq.min.js
│ ├── layouts
│ │ ├── default.html
│ │ └── test.html
│ ├── pages
│ │ ├── disable-test.html
│ │ ├── four.xml
│ │ ├── one.xml
│ │ ├── three.md
│ │ └── two.md
│ ├── stylesheets
│ │ ├── disable-this.css
│ │ ├── disable.sass
│ │ ├── main.scss
│ │ ├── partials
│ │ │ └── _colors.scss
│ │ ├── theme-media-test@print.css
│ │ ├── theme-test.css
│ │ └── theme-test2.css
│ └── templates
│ │ ├── post_index.html
│ │ ├── template-override-test.html
│ │ └── template-test.html
├── order_assets
│ ├── asset_tag.html
│ ├── javascripts
│ │ └── all-.js
│ └── stylesheets
│ │ ├── all-.css
│ │ └── print-.css
├── standard
│ ├── asset_tag.html
│ ├── config-test.html
│ ├── dir
│ │ └── d.html
│ ├── favicon.ico
│ ├── favicon.png
│ ├── fonts
│ │ └── awesome-sauce
│ │ │ └── foo.otf
│ ├── four
│ │ └── index.xml
│ ├── javascripts
│ │ └── all-.js
│ ├── robots.txt
│ ├── stylesheets
│ │ ├── all-.css
│ │ └── print-.css
│ ├── template-test
│ │ ├── index.html
│ │ └── override.html
│ ├── test.html
│ ├── test_config
│ │ ├── plugin_config.html
│ │ └── theme_config.html
│ ├── test_layouts
│ │ ├── local.html
│ │ ├── plugin_layout.html
│ │ ├── test_markdown.html
│ │ ├── theme.html
│ │ └── theme_override.html
│ └── test_pages
│ │ ├── c.html
│ │ ├── feed
│ │ └── index.xml
│ │ ├── include-subdir.html
│ │ ├── plugin_page.html
│ │ ├── plugin_page_override.html
│ │ ├── theme_page.html
│ │ └── three.html
├── test-theme
│ ├── .gitignore
│ ├── .travis.yml
│ └── lib
│ │ ├── test-theme.rb
│ │ └── test-theme
│ │ └── version.rb
└── uglify_js_false
│ └── all-.js
├── _includes
├── foo.html
└── post_data.html
├── _layouts
├── head.html
└── local.html
├── _order_assets.yml
├── _plugins
├── awesome-sauce
│ └── config.yml
├── loader.rb
└── theme
│ ├── config.yml
│ ├── includes
│ └── bar.html
│ ├── layouts
│ └── test.html
│ ├── stylesheets
│ ├── partials
│ │ └── _colors.sass
│ └── theme-test.css
│ └── templates
│ └── template-override-test.html
├── asset_tag.html
├── favicon.png
├── test_config
├── plugin_config.html
└── theme_config.html
├── test_layouts
├── local.html
├── plugin_layout.html
├── test_markdown.md
├── theme.html
└── theme_override.html
└── test_pages
├── include-subdir.html
└── plugin_page_override.html
/.gitignore:
--------------------------------------------------------------------------------
1 | *.gem
2 | *.rbc
3 | .bundle
4 | .config
5 | .yardoc
6 | Gemfile.lock
7 | InstalledFiles
8 | _yardoc
9 | coverage
10 | doc/
11 | lib/bundler/man
12 | pkg
13 | rdoc
14 | spec/reports
15 | test/tmp
16 | test/version_tmp
17 | tmp
18 | .DS_Store
19 | .sass-cache
20 | test/site
21 | .code-highlighter-cache
22 | _site
23 | .ink-cache
24 | .jekyll-metadata
25 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: ruby
2 | rvm:
3 | - 2.0.0
4 | script: clash 1-14
5 | notifications:
6 | slack:
7 | secure: cF+Q0YpLF1q0xIO2aIDG6pSF5pDG6qBMEMpypcExkFolrcmSgvsK+AxeQ9RD0OSIPpET7Kip9SUHR1tu7du4JXxPjvkTQvR/iMHaYbKwAqGdDKoksiqxS6HdIsXQBSUFg4p+YY5HiCJErGZWV+H3NF16GbAipAH1zGBIedZYwJk=
8 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ### 1.2.1 (2015-09-07)
4 | - Fix: For bootstrap pages, titles no longer include site url. That should be handled by templates.
5 |
6 | ### 1.2.0 (2015-06-26)
7 | - New: you can configure output destinations for asset pipeline stylesheets and javascripts.
8 |
9 | ### 1.1.4 (2015-05-18)
10 | - Fix: Cache writes no longer trigger Jekyll watch.
11 | - Fix: Cache writes happen after site builds.
12 |
13 | ### 1.1.3 (2015-05-17)
14 | - Fix: Ink assets filters files which shouldn't be included like .hidden_file, emacs.backup~, etc
15 |
16 | ### 1.1.2 (2015-05-12)
17 | - Use Jekyll Hooks if you got 'em.
18 | - Now supporting Jekyll 2 & 3
19 | - In Jekyll 3 Coffeescript is optional - Added a request to install the gem if a plugin uses it but it is not present.
20 |
21 | ### 1.1.1 (2015-05-11)
22 | - Minor: Gemspec dependency updates.
23 |
24 | ### 1.1.0 (2015-05-03)
25 | - New: Added support for asynchronous stylesheet loading. [#56](https://github.com/octopress/ink/pull/56)
26 | - New: Now loading combined javascripts asynchronously by default.
27 |
28 | ## 1.0.0 - 2015-05-02
29 | - Minor: Improved styling for Octopress Ink list command output.
30 | - Minor: Fixed issue where changelog couldn't be processed by Octopress Docs.
31 |
32 | ### 1.0.0 RC64 - 2015-04-28
33 | - Minor: Improved bundler integration
34 | - Minor: Added short flags for ink list and ink copy subcommands.
35 |
36 | ### 1.0.0 RC63 - 2015-04-26
37 | - New: Pages and Sass assets can read plugin config at {{ plugin.config_label }} instead of {{ plugins.plugin-name.config_label }}.
38 |
39 | ### 1.0.0 RC62 - 2015-04-25
40 | - Fix: octopress-autoprefixer is a runtime dependencies, not a development dependency.
41 |
42 | ### 1.0.0 RC61 - 2015-04-25
43 | - New: Added octopress-autoprefixer to runtime dependencies. Now plugins can expect prefix-free CSS.
44 |
45 | ### 1.0.0 RC60 - 2015-04-24
46 | - Fix: New plugin gemspec has a proper regex for adding files.
47 | - Fix: Plugins created when passing --path option get proper correct names.
48 |
49 | ### 1.0.0 RC59 - 2015-03-27
50 | - Fix: Properly clean asset cache during Jekyll watch.
51 |
52 | ### 1.0.0 RC58 - 2015-03-27
53 | - Fix: When assets are recompiled during Jekyll watch, their file fingerprints are refreshed.
54 |
55 | ### 1.0.0 RC57 - 2015-03-27
56 | - Fix: Now asset pipeline is properly reset during Jekyll watch.
57 | - Minor: Added caching to speed up category and tag liquid tags.
58 |
59 | ### 1.0.0 RC56 - 2015-03-22
60 | - Fix: Tag links and lists weren't being output
61 | - Fix: Tags and categories would throw errors if tags were used but plugin
62 | didn't have tag/category templates installed.
63 | - Change: tag names:
64 | from `{% tags %}` -> `{% tag_links %}`
65 | from `{% categories %}` -> `{% category_links %}`
66 |
67 | ### 1.0.0 RC55 - 2015-03-14
68 | - Added `ink_watch` site configuration, allowing plugin authors to add their plugin assets directory to Jekyll's watch list.
69 |
70 | ### 1.0.0 RC54 - 2015-03-10
71 | - Added `new_page` method to page assets to mirror template functionality.
72 | - Generated pages can now reference the asset instance that generated them.
73 |
74 | ### 1.0.0 RC53 - 2015-03-05
75 | - Fix: Removed reference to debugger
76 |
77 | ### 1.0.0 RC52 - 2015-03-05
78 | - Plugin Bootstrap's templates do a better job of outputting content based on site posts.
79 |
80 | ### 1.0.0 RC51 - 2015-03-04
81 | - Fix: Plugin bootstrap only fires if Site has posts.
82 | - Fix: Use double quotes for HTML attributes in liquid tags.
83 |
84 | ### 1.0.0 RC50 - 2015-03-04
85 | - Improved information about disabled or overridden assets on `ink list plugin` commands
86 | - Reworked plugin bootstrap to use templates instead of pages
87 | - Removed page clone method (templates should be used for this)
88 |
89 | ### 1.0.0 RC49 - 2015-03-02
90 | - New: Plugin bootstrap allows plugins to work with templates for post indexes and RSS feeds. Each with automatic support for multilingual sites.
91 |
92 | Plugins can add pages and templates for:
93 | - A post index
94 | - A post archive
95 | - A post RSS feed
96 | - A link posts RSS feed (with octopress-linkblog)
97 | - An articles RSS feed (with octopress-linkblog)
98 | - A post RSS feed
99 | - Category index pages
100 | - Tag index pages
101 | - Category RSS feeds
102 | - Tag RSS feeds
103 |
104 | The plugin bootstrap will automatically handle page titles, permalinks and generating multiple pages for each tag and category.
105 | If a user installs octopress-multilingual, all pages will be replicated and filtered for each language.
106 |
107 | ### 1.0.0 RC48 - 2015-02-18
108 | - Minor: Improved template asset info when listed with `octopress ink list [plugin]` command.
109 |
110 | ### 1.0.0 RC47 - 2015-02-18
111 | - Fix: `octopress ink list [plugin]` triggers site read to ensure all plugins are ready to present info.
112 | - Fix: Template page info improvements
113 |
114 | ### 1.0.0 RC46 - 2015-02-18
115 | - Fix: Site reset triggers reset method on each plugin.
116 |
117 | ### 1.0.0 RC45 - 2015-02-18
118 | - Fix: Plugins weren't being initialized properly due to a race condition
119 |
120 | ### 1.0.0 RC44 - 2015-02-18
121 | - Fix: Plugins reset for each build, fixing builds with Jekyll's watch enabled.
122 | - New: Added plugin templates for dynamically generating pages.
123 |
124 | ### 1.0.0 RC43 - 2015-02-16
125 | - Fix: Multilingual configurations are deep merged with primary language config to allow for less unnecessary duplication.
126 |
127 | ### 1.0.0 RC42 - 2015-02-15
128 | - New: Plugins can define order for stylesheet and javascript assets.
129 |
130 | ### 1.0.0 RC41 - 2015-02-13
131 | - Fix: Properly copies pages without permalinks.
132 | - Permalink configurations now allow directories and file extensions in config keys.
133 |
134 | ### 1.0.0 RC40 - 2015-02-08
135 | - Improvements to ink list command output.
136 | - Ensures plugins cannot be registered multiple times.
137 |
138 | ### 1.0.0 RC39 - 2015-02-07
139 | - New: Octopress Page assets have methods for accessing the plugin and asset that generated them.
140 |
141 | ### 1.0.0 RC38 - 2015-02-05
142 | - Fix: Plugin asset paths were improperly generated.
143 |
144 | ### 1.0.0 RC37 - 2015-01-31
145 |
146 | - Added `clone` method to page assets.
147 | - Pages now list permalink settings in `ink list` view.
148 | - Refactored page permalink system.
149 |
150 | ### 1.0.0 RC36 - 2015-01-31
151 |
152 | - Fix: Octopress Hooks now fire properly on page assets.
153 |
154 | ### 1.0.0 RC35 - 2015-01-28
155 |
156 | - Fix: Includes nested in sub directories work again. [#40](https://github.com/octopress/ink/issues/40)
157 |
158 | ### 1.0.0 RC34 - 2015-01-28
159 |
160 | - Fix: Don't attempt to remove cached assets if they don't exist.
161 |
162 | ### 1.0.0 RC33 - 2015-01-28
163 |
164 | - Fix: Doesn't assume site plugin path is in site source directory. Thanks [@drallgood](https://github.com/octopress/feeds/issues/10)!
165 |
166 | ### 1.0.0 RC32 - 2015-01-26
167 |
168 | - Minor change: Moved plugin requiring out to Octopress gem.
169 |
170 | ### 1.0.0 RC31 - 2015-01-26
171 |
172 | - Fix: Sass partials in subdirectories aren't added to asset pipeline.
173 | - Fix: Now copies assets in subdirectories into correct paths.
174 | - Fix: Plugins are now loaded via Jekyll's plugin manager
175 |
176 | ### 1.0.0 RC30 - 2015-01-22
177 |
178 | - Added `set_lang` placeholder so plugins can easily integrate with [octopress-multilingual](https://github.com/octopress/multilingual).
179 |
180 | ### 1.0.0 RC29 - 2015-01-14
181 |
182 | - Fixed path issues when writing stylesheet tags.
183 |
184 | ### 1.0.0 RC28 - 2015-01-14
185 |
186 | - Minified javascripts (whatever.min.js) are not re-compressed and are added first in the builds
187 |
188 | ### 1.0.0 RC27 - 2015-01-12
189 |
190 | - Fixed: Invisible "dot" files are now ignored as plugin assets. [#32](https://github.com/octopress/ink/issues/32)
191 |
192 | ### 1.0.0 RC26 - 2015-01-09
193 |
194 | - Fixed: Issue where setting destination config would break Jekyll cleaner.
195 |
196 | ### 1.0.0 RC25 - 2015-01-06
197 |
198 | - Now loading octopress-include-tag properly.
199 |
200 | ### 1.0.0 RC24 - 2015-01-04
201 |
202 | - Added gem name metadata to plugin scaffold
203 |
204 | ### 1.0.0 RC23 - 2015-01-02
205 |
206 | - Reworked integration with Octopress Docs
207 |
208 | ### 1.0.0 RC22 - 2015-01-01
209 |
210 | - Moved Asset pipeline configuration under `asset_pipline` key in _config.yml
211 |
212 | ### 1.0.0 RC21 - 2014-12-13
213 |
214 | - Documentation fixes
215 |
216 | ### 1.0.0 RC20 - 2014-12-13
217 |
218 | - Improvements to scaffold and docs.
219 |
220 | ### 1.0.0 RC19 - 2014-12-09
221 |
222 | - Fixes to be compatible with the latest versions of Octopress and Jekyll.
223 |
224 | ### 1.0.0 RC18 - 2014-10-07
225 |
226 | - Improved integration with octopress-docs for displaying plugin documentation.
227 |
228 | ### 1.0.0 RC17 - 2014-09-01
229 |
230 | - Fixed issue where Sass required a `_plugins/[plugin]/stylesheets` directory.
231 |
232 | ### 1.0.0 RC16 - 2014-08-21
233 |
234 | - New: Access the url for a plugin's page from anywhere with `{{ theme.permalinks.page_name }}` or `{{ plugins.pugin-name.permalinks.page_name }}`.
235 | - Fix: Properly invalidate caches for `jekyll build --watch` support.
236 |
237 | ### 1.0.0 RC15 - 2014-08-17
238 |
239 | - Fixed an issue where Octopress would trigger site_payload too early.
240 |
241 | ### 1.0.0 RC14 - 2014-08-11
242 |
243 | - Reworked asset methods
244 |
245 | ### 1.0.0 RC13 - 2014-08-11
246 |
247 | - Fixed an issue with asset tags
248 |
249 | ### 1.0.0 RC12 - 2014-08-03
250 |
251 | - Extracted all tags to separate projects under [github.com/octopress](https://github.com/octopress).
252 | - Now the only tag provided by default is [include-tag](https://github.com/octopress/include-tag).
253 | - Switched from jekyll-page-hooks to octopress-hooks.
254 | - Extracted link post feature as a separate plugin [octopress-linkblog](https://github.com/octopress/linkblog)
255 | - Extracted page date feature as a separate plugin [octopress-date-format](https://github.com/octopress/date-format)
256 | - Extracted Autoprefixer a separate plugin [octopress-autoprefixer](https://github.com/octopress/autoprefixer)
257 |
258 | ### 1.0.0 RC11 - 2014-06-27
259 |
260 | - Fixed: Render tag properly processes local variables.
261 |
262 | ### 1.0.0 RC10 - 2014-06-26
263 |
264 | - Render tag does a better job of preserving `{% raw %}` escaped content.
265 |
266 | ### 1.0.0 RC9 - 2014-06-21
267 |
268 | - Added jekyll-page-hooks as a dependency.
269 | - Now processing partials as ConvertiblePartials
270 |
271 | ### 1.0.0 RC8 - 2014-06-09
272 |
273 | - Improved the way Ink manages the payload
274 | - Added `linkposts` and `articles` methods to Ink
275 |
276 | ### 1.0.0 RC7 - 2014-06-08
277 |
278 | - New: Added `excerpted` post var, true if post.excerpt is shorted than post.content.
279 |
280 | ### 1.0.0 RC6 - 2014-06-07
281 |
282 | - Fixed: Gemspec scaffold does not include Ink's pre-release version numbers.
283 | - Fixed: Better formatting for ordinal dates.
284 | - Other minor bug fixes
285 |
286 | ### 1.0.0 RC5 - 2014-06-06
287 |
288 | - New: site.linkposts loops through linkposts
289 | - New: site.articles loops through non-linkpost articles
290 |
291 | ### 1.0.0 RC4 - 2014-05-28
292 |
293 | - Improved: Plugin scaffold does a better job of handling gem names with dashes.
294 |
295 | ### 1.0.0 RC3 - 2014-05-27
296 |
297 | - Improved: Now copy and list commands use the flag --config-file instead of --defaults
298 |
299 | ### 1.0.0 RC2 - 2014-05-26
300 |
301 | - Fixed: Post and Page data is appended to at read time.
302 |
303 | ### 1.0.0 RC1 - 2014-05-25
304 |
305 | - Initial release candidate
306 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | # Specify your gem's dependencies in themebase.gemspec
4 | gemspec
5 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 Brandon Mathis
2 |
3 | MIT License
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining
6 | a copy of this software and associated documentation files (the
7 | "Software"), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be
14 | included in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Octopress Ink
2 |
3 | Use Ink to help you build themes and plugins for Jekyll.
4 |
5 | [](http://badge.fury.io/rb/octopress-ink)
6 | [](https://travis-ci.org/octopress/ink)
7 |
8 | ## Installation
9 |
10 | Add this line to your application's Gemfile:
11 |
12 | gem 'octopress-ink'
13 |
14 | And then execute:
15 |
16 | $ bundle
17 |
18 | Or install it yourself as:
19 |
20 | $ gem install octopress-ink
21 |
22 | ## Usage
23 |
24 | Usage is different for users and developers, and useful documentation requires more than a giant README. Docs will be posted with the launch of the new Octopress 3.0 site. In the mean time, you can browse the `assets/docs/` directory for a look at the documentation that's coming.
25 |
26 | ## Contributing
27 |
28 | 1. Fork it ( https://github.com/octopress/ink/fork )
29 | 2. Create your feature branch (`git checkout -b my-new-feature`)
30 | 3. Commit your changes (`git commit -am 'Add some feature'`)
31 | 4. Push to the branch (`git push origin my-new-feature`)
32 | 5. Create new Pull Request
33 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | require "bundler/gem_tasks"
2 |
--------------------------------------------------------------------------------
/assets/docs/_configuration.markdown:
--------------------------------------------------------------------------------
1 | | Configuration | Description |
2 | |:--------------|:------------|
3 | | name | The display name for your plugin, e.g. "My Plugin" |
4 | | assets_path | Path to your plugin's assets directory |
5 | | slug | Optional: The slug is how users will reference your plugin, (Default: sluggified name) |
6 | | type | Optional: "plugin" or "theme" (Default: "plugin") |
7 | | version | Optional: Version will be displayed with plugin info |
8 | | description | Optional: Description will be displayed with plugin info |
9 | | website | Optional: Website will be displayed with plugin info |
10 |
--------------------------------------------------------------------------------
/assets/docs/_plugin-template.markdown:
--------------------------------------------------------------------------------
1 | ```ruby
2 | require "octopress-ink"
3 |
4 | Octopress::Ink.add_plugin({
5 | name: "My Plugin",
6 | slug: "my-plugin",
7 | assets_path: File.expand_path(File.join(File.dirname(__FILE__), '../assets')),
8 | type: "plugin",
9 | version: MyPlugin::VERSION,
10 | description: "",
11 | website: ""
12 | })
13 | ```
14 |
--------------------------------------------------------------------------------
/assets/docs/creating-a-plugin.markdown:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Create an Octopress Ink Plugin"
3 | permalink: /ink/creating-a-plugin/
4 | ---
5 |
6 | *This guide assumes you have already installed Git, and have Ruby 1.9.3 or greater.*
7 |
8 | Octopress Ink plugins are distributed as ruby gems so you'll need to create an account at [RubyGems.org](https://rubygems.org/sign_up) if you haven't yet. Also, be sure to install the [Bundler](http://bundler.io) gem.
9 |
10 | ## Creating a plugin
11 |
12 | Creating an Octopress Ink plugin is very simple. Here's the standard template.
13 |
14 | ```ruby
15 | require "octopress-ink"
16 |
17 | Octopress::Ink.add_plugin({
18 | name: "My Plugin",
19 | slug: "my-plugin",
20 | gem: "my-plugin",
21 | path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
22 | type: "plugin",
23 |
24 | # Metadata which is displayed with plugin info
25 | version: MyPlugin::VERSION,
26 | description: "My plugin does awesome stuff",
27 | source_url: "https://github.com/user/project",
28 | website: ""
29 | })
30 | ```
31 |
32 | The configuration options are as follows.
33 |
34 | | Configuration | Description |
35 | |:--------------|:------------|
36 | | name | The display name for your plugin, e.g. "My Plugin" |
37 | | path | Path to your plugin's root directory |
38 | | slug | Optional: The slug is how users will reference your plugin, (Default: sluggified name) |
39 | | gem | Optional: This is displayed in plugin info and on the local docs site. |
40 | | type | Optional: "plugin" or "theme" (Default: "plugin") |
41 | | version | Optional: Version will be displayed with plugin info |
42 | | description | Optional: Description will be displayed with plugin info |
43 | | website | Optional: Website will be displayed with plugin info |
44 | | source_url | Optional: Direct people to the GitHub project (or elsewhere) |
45 |
46 | Note: For themes, the slug will be set to `theme`. This makes it easy for users to work with any theme with a consistent slug name.
47 |
48 | Next you simply need an `assets` directory at the root of your gem with subdirectories for each asset type you plan to use in your plugin.
49 |
50 | If you have a gem-based plugin which you'd like to convert into an Octopress Ink plugin, this should make it easy for you.
51 |
52 | ```sh
53 | $ octopress ink init your_gem
54 | ```
55 |
56 | This will add the asset directories, create a demo site, and print out a plugin template with instructions for how to add it to your gem.
57 |
58 | ### Create a plugin from scratch
59 |
60 | To create a new plugin named "Some Plugin" run:
61 |
62 | ```sh
63 | $ octopress ink new some_plugin
64 | ```
65 |
66 | This does the following.
67 |
68 | - Creates a new gem using Bundler's gem scaffolding.
69 | - It adds `octopress` and `octopress-ink` as dependencies in the gemspec.
70 | - An Octopress Ink plugin template is added to `lib/some_plugin.rb`.
71 | - `assets/` contains empty asset directories.
72 | - `demo/` contains a blank Jekyll site with your plugin already integrated for easy testing.
73 |
74 | Here's what the new `some_plugin` directory looks like.
75 |
76 | ```
77 | assets/
78 | docs/
79 | files/
80 | fonts/
81 | images/
82 | includes/
83 | javascripts/
84 | layouts/
85 | pages/
86 | stylesheets/
87 | lib/
88 | some_plugin/
89 | version.rb
90 | some_plugin.rb
91 | demo/
92 | _layouts/
93 | _posts/
94 | Gemfile
95 | index.html
96 | some_plugin.gemspec
97 | Gemfile
98 | LICENSE.txt
99 | Rakefile
100 | README.md
101 | ```
102 |
103 | In `lib/some_plugin.rb` you'll find an Octopress Ink plugin created specifically for your gem.
104 |
105 | ```ruby
106 | require 'lib/version'
107 | require 'octopress-ink'
108 |
109 | Octopress::Ink.add_plugin({
110 | name: "Some Plugin",
111 | slug: "some-plugin",
112 | gem: "some-plugin",
113 | path: File.expand_path(File.join(File.dirname(__FILE__), "..")),
114 | type: "some_plugin",
115 | version: SomePlugin::Version,
116 | description: "",
117 | website: "",
118 | source_url: ""
119 | })
120 | ```
121 |
122 | Change whatever you want and you are ready to start building your plugin.
123 |
124 | ### Building on an existing plugin
125 |
126 | If you're going to convert an existing gem-based Jekyll plugin to use Octopress Ink, from your gem directory run:
127 |
128 | ```sh
129 | $ octopress ink init .
130 | ```
131 |
132 | This will add the assets directories and the demo site to your
133 | plugin. To finish setting up your plugin, you'll need to add the plugin template to your gem.
134 |
135 | ## Plugin assets
136 |
137 | Octopress Ink plugins make it super easy to integrate assets with any Jekyll site. Your plugin should have an `assets` directory,
138 | typically in the root directory of your gem. Inside `assets` there will be folders for each asset type your plugin uses plan to use.
139 |
140 | Note: Assets are copied at build time and assets will not overwrite an existing file.
141 |
142 | | Asset directory | Description |
143 | |:----------------|:------------------------------------------------|
144 | | layouts | Users can add layouts by setting `layout: plugin_slug:some_layout` in a page's YAML front-matter. |
145 | | includes | Includes are available to users by `{% include plugin_slug:some_file.html %}`. |
146 | | pages | `pages/feed.xml` is processed and copied to `_site/feed.xml` at build time. Setting `permalink: feed/` renders to `_site/feed/index.xml`. |
147 | | files | `files/favicon.ico` is copied to `_site/favicon.ico`. |
148 | | fonts | `wingdings.ttf` is copied to `_site/fonts/plugin_slug/wingdings.ttf`. |
149 | | images | `cat.gif` is copied to `_site/images/plugin_slug/cat.gif`. |
150 | | javascripts | `boom.js` is combined with all plugin javascripts into a single fingerprinted file. |
151 | | stylesheets | `theme.scss` and `print.css` are combined with all plugin stylesheets into a single fingerprinted file. |
152 | | docs | Add documentation files for your plugin here. Users will be able to read it by running `octopress docs`. |
153 |
154 | ### Ordering Javascript and Stylesheet assets
155 |
156 | By default when scripts and stylesheets are combined, they are added based on
157 | their order in the file system. You can manually specify order like this:
158 |
159 | ```
160 | order_js:
161 | - jquery.js
162 | - kittens.coffee
163 |
164 | order_css:
165 | - normalize.css
166 | - site.sass
167 | ```
168 | Assets will ordered as specified. Any additional assets will be appended based on their order in the file system.
169 |
170 | Note: It is not necessary to write full paths in these configurations. An asset at `javascripts/lib/jquery.js` will match `jquery.js` and be ordered accordingly.
171 |
172 |
173 | ### Layouts
174 |
175 | Layouts will probably mostly be useful if you're developing a theme. For a typical theme you'll probably have three layouts:
176 |
177 | ```
178 | assets/
179 | layouts/
180 | default.html
181 | page.html
182 | post.html
183 | ```
184 |
185 | Here's a example of a simple `default.html` layout.
186 |
187 | ```
188 |
189 |
190 |
191 |
192 | {{ page.title }} - {{ site.title }}
193 | {% css_asset_tag %}
194 |
195 |
196 | {{ content }}
197 | {% js_asset_tag %}
198 |
199 |
200 | ```
201 |
202 | You'll notice the `{% css_asset_tag %}` and `{% js_asset_tag %}` tags. These are special tags that come with Octopress Ink and output the ` ` and `}
7 | end
8 |
9 | def tag_path
10 | Filters.expand_url(File.join(dir, file))
11 | end
12 |
13 | def add
14 | Plugins.add_js_tag tag
15 | super
16 | end
17 |
18 | def destination
19 | File.join(base, plugin.slug, file)
20 | end
21 | end
22 | end
23 | end
24 | end
25 |
26 |
--------------------------------------------------------------------------------
/lib/octopress-ink/assets/lang_config.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Assets
4 | class LangConfig < Config
5 | attr_reader :lang
6 |
7 | def initialize(plugin, path, lang)
8 | super(plugin, path)
9 | @lang = lang
10 | end
11 | end
12 | end
13 | end
14 | end
15 |
16 |
--------------------------------------------------------------------------------
/lib/octopress-ink/assets/layout.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Assets
4 | class Layout < Asset
5 |
6 | def initialize(plugin, base, file)
7 | super
8 | register
9 | end
10 |
11 | private
12 |
13 | def register
14 | dir = user_dir
15 | if !exists?(File.join(dir, file))
16 | dir = plugin_dir
17 | end
18 |
19 | Octopress.site.layouts[name] = Ink::Layout.new(Octopress.site, dir, file)
20 | end
21 |
22 | def name
23 | name = "#{plugin.slug}:#{file}"
24 | # remove extension
25 | name = name.split(".")[0..-2].join(".")
26 | end
27 | end
28 | end
29 | end
30 | end
31 |
32 |
--------------------------------------------------------------------------------
/lib/octopress-ink/assets/local_template.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Assets
4 | class LocalTemplate < Template
5 | def initialize(plugin, base, layout)
6 | @layout = layout
7 | super(plugin, base, layout.name)
8 | end
9 |
10 | def path
11 | plugin_path
12 | end
13 |
14 | def plugin_path
15 | File.join(base, file)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/lib/octopress-ink/assets/page.rb:
--------------------------------------------------------------------------------
1 | # These are files which need to be in added to the root of the site directory
2 | # Use root assets for files like robots.text or favicon.ico
3 |
4 | module Octopress
5 | module Ink
6 | module Assets
7 | class PageAsset < Asset
8 | attr_reader :filename
9 | attr_accessor :data, :permalink_name
10 |
11 | def initialize(plugin, base, file)
12 | @root = plugin.assets_path
13 | @plugin = plugin
14 | @base = base
15 | @filename = file
16 | @dir = File.dirname(file)
17 | @file = File.basename(file)
18 | @exists = {}
19 | @permalink_name = file.sub(File.extname(file), '')
20 | @data = {}
21 | file_check
22 | end
23 |
24 | # Add page to Jekyll pages if no other page has a conflicting destination
25 | #
26 | def add
27 | if page.url && !find_page(page)
28 | Octopress.site.pages << page
29 | plugin.config['permalinks'] ||= {}
30 | permalink_config ||= page.url
31 | end
32 | end
33 |
34 | def merge_data(data={})
35 | page.data.merge!(data)
36 | end
37 |
38 | def deep_merge(data={})
39 | Jekyll::Utils.deep_merge_hashes(page.data, data)
40 | end
41 |
42 | def new_page(data={})
43 | page = Ink::Page.new(Octopress.site, File.dirname(self.path), '.', File.basename(self.path))
44 | page.data.merge!(data)
45 | page.plugin = plugin
46 | page.asset = self
47 | page
48 | end
49 |
50 | def find_page(page)
51 | site_dir = Octopress.site.dest
52 | dest = page.destination(site_dir)
53 |
54 | Octopress.site.pages.clone.each do |p|
55 | return p if p.destination(site_dir) == dest
56 | end
57 | return false
58 | end
59 |
60 | def page
61 | @page ||= begin
62 | page = Page.new(Octopress.site, source_dir, page_dir, file)
63 |
64 | if permalink_config
65 | page.data['permalink'] = permalink_config
66 | else
67 | permalink = page.data['permalink']
68 | end
69 |
70 | page.data.merge!(@data)
71 | page.plugin = plugin
72 | page.asset = self
73 |
74 | page
75 | end
76 | end
77 |
78 | def permalink
79 | page.url
80 | end
81 |
82 | def url; permalink; end
83 |
84 | def lang
85 | data['lang']
86 | end
87 |
88 | def permalink=(url)
89 | page.data['permalink'] = url
90 | permalink_config = url
91 | end
92 |
93 | def permalink_config
94 | if Octopress.multilingual? && lang
95 | plugin.config(lang)['permalinks'][permalink_name]
96 | else
97 | plugin.config['permalinks'][permalink_name]
98 | end
99 | end
100 |
101 | def permalink_config=(url)
102 | if permalink_name
103 | plugin.config['permalinks'][permalink_name] = url
104 | end
105 | end
106 |
107 | private
108 |
109 | def page_dir
110 | dir == '.' ? '' : dir
111 | end
112 |
113 | def plugin_path
114 | File.join(plugin_dir, dir, file)
115 | end
116 |
117 | def user_dir
118 | File.join Plugins.custom_dir, plugin.slug, base
119 | end
120 |
121 | end
122 | end
123 | end
124 | end
125 |
--------------------------------------------------------------------------------
/lib/octopress-ink/assets/sass.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Assets
4 | class Sass < Stylesheet
5 | attr_accessor :exists, :render
6 |
7 | def initialize(plugin, base, file)
8 | @plugin = plugin
9 | @base = base
10 | @file = file
11 | @media = media || 'all'
12 | @root = plugin.assets_path
13 | @dir = File.join(plugin.slug, base)
14 | @exists = {}
15 | file_check
16 | end
17 |
18 | def add
19 | unless File.basename(file).start_with?('_')
20 | Plugins.add_css_tag tag
21 | Plugins.static_files << StaticFileContent.new(content, destination)
22 | end
23 | end
24 |
25 | def ext
26 | File.extname(path)
27 | end
28 |
29 | def load_paths
30 | lp = [theme_load_path]
31 | lp.unshift user_load_path if Dir.exists? user_load_path
32 | lp
33 | end
34 |
35 | def disabled?
36 | is_disabled('sass', filename) || is_disabled('stylesheets', filename)
37 | end
38 |
39 | def content
40 | @render ||= begin
41 | contents = super
42 | if payload
43 | Liquid::Template.parse(contents).render!({ 'plugin' => @plugin.config }.merge(payload))
44 | else
45 | contents
46 | end
47 | end
48 |
49 | PluginAssetPipeline.compile_sass(self)
50 | end
51 |
52 | def destination
53 | File.join(base, plugin.slug, output_file_name)
54 | end
55 |
56 | private
57 |
58 | def user_load_path
59 | File.join(Plugins.custom_dir, dir, File.dirname(file)).sub /\/\.$/, ''
60 | end
61 |
62 | def theme_load_path
63 | File.expand_path(File.join(root, base))
64 | end
65 |
66 | def user_path
67 | # Allow Sass overrides to use either syntax
68 | if file =~ /s[ac]ss$/
69 | [File.join(user_dir, file), File.join(user_dir, alt_syntax_file)]
70 | else
71 | File.join user_dir, file
72 | end
73 | end
74 |
75 | def alt_syntax_file
76 | ext = File.extname(file)
77 | alt_ext = (ext == '.scss' ? '.sass' : '.scss')
78 | file.sub(ext, alt_ext)
79 | end
80 |
81 | def output_file_name
82 | File.basename(file.sub('@','-'), '.*') << '.css'
83 | end
84 | end
85 | end
86 | end
87 | end
88 |
89 |
--------------------------------------------------------------------------------
/lib/octopress-ink/assets/stylesheet.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Assets
4 | class Stylesheet < Asset
5 |
6 | def initialize(plugin, base, file)
7 | @plugin = plugin
8 | @file = file
9 | @base = base
10 | @media = media || 'all'
11 | @root = plugin.assets_path
12 | @dir = File.join(plugin.slug, 'stylesheets')
13 | @exists = {}
14 | file_check
15 | end
16 |
17 | def media
18 | m = @media
19 | if file =~ /@(.+?)\./
20 | m = $1
21 | end
22 | m
23 | end
24 |
25 | def disabled?
26 | is_disabled('css', filename) || is_disabled('stylesheets', filename)
27 | end
28 |
29 | def tag
30 | %Q{ }
31 | end
32 |
33 | def tag_path
34 | Filters.expand_url(File.join(dir, output_file_name))
35 | end
36 |
37 | def add
38 | Plugins.add_css_tag tag
39 | super
40 | end
41 |
42 | private
43 |
44 | def destination
45 | File.join(base, plugin.slug, output_file_name)
46 | end
47 |
48 | def output_file_name
49 | file.sub('@','-')
50 | end
51 | end
52 | end
53 | end
54 | end
55 |
56 |
--------------------------------------------------------------------------------
/lib/octopress-ink/assets/template.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Assets
4 | class Template < Asset
5 | attr_reader :pages
6 |
7 | def initialize(*args)
8 | super(*args)
9 | @pages = []
10 | @existing_pages = {}
11 | end
12 |
13 | def add; end
14 |
15 | def info
16 | message = " - #{asset_info}\n"
17 |
18 | unless disabled?
19 | self.pages.each do |page|
20 | if existing_page = @existing_pages[page.url]
21 | message << " #{page.url.ljust(33)} Disabled: /#{existing_page.path} already exists\n"
22 | else
23 | message << " #{page.url}\n"
24 | end
25 | end
26 | end
27 |
28 | message
29 | end
30 |
31 | def new_page(data={})
32 | return if disabled?
33 | page = Ink::Page.new(Octopress.site, File.dirname(self.path), '.', File.basename(self.path))
34 | page.data.merge!(data)
35 | page.plugin = plugin
36 | page.asset = self
37 | self.pages << page
38 |
39 | if existing_page = page_exists?(page)
40 | if existing_page.respond_to?(:plugin)
41 | @replacement = existing_page.plugin.name
42 | else
43 | @existing_pages[existing_page.url] = existing_page
44 | end
45 | false
46 | else
47 | page
48 | end
49 | end
50 |
51 | def page_exists?(page)
52 | Octopress.site.pages.find {|p| p.url == page.url}
53 | end
54 | end
55 | end
56 | end
57 | end
58 |
--------------------------------------------------------------------------------
/lib/octopress-ink/cache.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Cache
4 | extend self
5 |
6 | INK_CACHE_DIR = '.ink-cache'
7 |
8 | def reset
9 | @cache_files = []
10 | @write_cache = {}
11 | end
12 |
13 | def read_cache(asset, options)
14 | path = get_cache_path(INK_CACHE_DIR, cache_label(asset), options.to_s << asset.content)
15 | @cache_files << path
16 | File.exist?(path) ? File.read(path) : nil unless path.nil?
17 | end
18 |
19 | def write_to_cache(asset, content, options)
20 | FileUtils.mkdir_p(INK_CACHE_DIR) unless File.directory?(INK_CACHE_DIR)
21 | path = get_cache_path(INK_CACHE_DIR, cache_label(asset), options.to_s << asset.content)
22 | @write_cache[path] = content
23 | content
24 | end
25 |
26 | def cache_label(asset)
27 | "#{asset.plugin.slug}-#{File.basename(asset.file, '.*').downcase}"
28 | end
29 |
30 | def get_cache_path(dir, label, str)
31 | File.join(dir, ".#{label}#{Digest::MD5.hexdigest(str)}.js")
32 | end
33 |
34 | def write
35 | @write_cache.each do |path, contents|
36 | File.open(path, 'w') do |f|
37 | f.print(contents)
38 | end
39 | end
40 | @write_cache = {}
41 | end
42 |
43 | def clean
44 | if File.directory?(INK_CACHE_DIR)
45 | remove = Find.find(INK_CACHE_DIR).to_a.reject do |file|
46 | @cache_files.include?(file) || File.directory?(file)
47 | end
48 |
49 | FileUtils.rm(remove)
50 | end
51 | end
52 | end
53 | end
54 | end
55 |
--------------------------------------------------------------------------------
/lib/octopress-ink/commands.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Commands
4 | require 'octopress-ink/commands/list'
5 | require 'octopress-ink/commands/copy'
6 | require 'octopress-ink/commands/new'
7 | require 'octopress-ink/commands/init'
8 |
9 | class Ink < Octopress::Command
10 |
11 | def self.init_with_program(p)
12 | p.command(:ink) do |c|
13 | c.version Octopress::Ink::VERSION
14 | c.description "Work with your Octopress Ink plugins."
15 | c.syntax "ink "
16 |
17 | c.action do |args, options|
18 | puts c if args.empty?
19 | end
20 |
21 | List.process_command(c)
22 | Copy.process_command(c)
23 | New.process_command(c)
24 | Init.process_command(c)
25 | end
26 | end
27 | end
28 | end
29 | end
30 | end
31 |
32 |
--------------------------------------------------------------------------------
/lib/octopress-ink/commands/copy.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Commands
4 | class Copy
5 | def self.process_command(p)
6 | p.command(:copy) do |c|
7 | c.syntax "copy [options]"
8 | c.description "Copy plugin assets to _plugins/PLUGIN/."
9 | c.option "all", "--all", "Copy all plugin assets."
10 | c.option "force", "--force", "Overwrite files."
11 | c.option "path", "--path PATH", "Copy plugin assets to an alternate path."
12 | CommandHelpers.add_asset_options(c, 'Copy')
13 |
14 | c.action do |args, options|
15 | if args.empty?
16 | puts "Error: Please pass a plugin slug to install assets from that plugin."
17 | Octopress::Ink.list_plugins
18 | else
19 | name = args[0]
20 | Octopress::Ink.copy_plugin_assets(name, options)
21 | end
22 | end
23 | end
24 | end
25 | end
26 | end
27 | end
28 | end
29 |
30 |
--------------------------------------------------------------------------------
/lib/octopress-ink/commands/helpers.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Commands
4 | module CommandHelpers
5 | def self.add_asset_options(c, action)
6 | c.option "config-file", "-c", "--config", "#{action} plugin's config file"
7 | c.option "layouts", "-l", "--layouts", "#{action} only layouts"
8 | c.option "includes", "-i", "--includes", "#{action} only includes"
9 | c.option "pages", "-p", "--pages", "#{action} only pages"
10 | c.option "templates", "-t", "--templates", "#{action} only pages"
11 | c.option "stylesheets", "-s", "--stylesheets", "#{action} only Stylesheets (.css, .scss, .sass)"
12 | c.option "css", "--css", "#{action} only CSS files (.css)"
13 | c.option "sass", "--sass", "#{action} only Sass files (.scss, .sass)"
14 | c.option "javascripts", "-j", "--javascripts", "#{action} only Javascripts (.js and .coffee)"
15 | c.option "js", "--js", "#{action} only Javascript files (.js)"
16 | c.option "coffee", "--coffee", "#{action} only Coffeescript files (.coffee)"
17 | c.option "images", "-I", "--images", "#{action} only images"
18 | c.option "fonts", "--fonts", "#{action} only fonts"
19 | c.option "files", "--files", "#{action} only files"
20 | end
21 | end
22 | end
23 | end
24 | end
25 |
26 |
--------------------------------------------------------------------------------
/lib/octopress-ink/commands/init.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Commands
4 | class Init
5 | def self.process_command(p)
6 | p.command(:init) do |c|
7 | c.syntax "init [options]"
8 | c.description "Add Octopress Ink scaffolding to an existing gem based plugin."
9 | c.option "theme", "--theme", "Plugin will be a theme."
10 |
11 | c.action do |args, options|
12 | if args.empty?
13 | raise "Please provide a plugin name, e.g. my_awesome_plugin."
14 | else
15 | @options = options
16 | @options['path'] = args[0]
17 | init_plugin
18 | end
19 | end
20 | end
21 | end
22 |
23 | def self.init_plugin
24 | settings = New.gem_settings(@options['path'])
25 | settings[:type] = @options['theme'] ? 'theme' : 'plugin'
26 |
27 | New.add_asset_dirs(settings)
28 | New.add_demo_files(settings)
29 |
30 | puts "\nTo finish setting up your Octopress Ink plugin:\n".bold
31 | puts "1. Add gem requirements to your gemspec:\n\n"
32 | puts New.dependencies(settings).sub("\n\n", "\n").yellow
33 | puts "2. Add an Octopress Ink plugin to your gem, making changes as necessary:\n\n"
34 |
35 | template = <<-HERE
36 | require "octopress-ink"
37 |
38 | Octopress::Ink.add_plugin({
39 | #{New.indent(New.plugin_config(settings))}
40 | })
41 | HERE
42 |
43 | puts template.yellow
44 | end
45 | end
46 | end
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/lib/octopress-ink/commands/list.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Commands
4 | class List
5 | def self.process_command(p)
6 | p.command(:list) do |c|
7 | c.syntax "list [plugin] [options]"
8 | c.description "Get a list of installed octopress ink plugins for this site."
9 | c.option "all", "--all", "List all plugins and their assets."
10 | CommandHelpers.add_asset_options(c, 'List')
11 |
12 | c.action do |args, options|
13 | if args.empty?
14 | Octopress::Ink.list(options)
15 | else
16 | name = args.first
17 | Octopress::Ink.plugin_list(name, options)
18 | end
19 | end
20 | end
21 | end
22 | end
23 | end
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/lib/octopress-ink/commands/new.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Commands
4 | class New
5 | def self.process_command(p)
6 | p.command(:new) do |c|
7 | c.syntax "new [options]"
8 | c.description "Create a new Octopress Ink plugin with Ruby gem scaffolding."
9 | c.option "theme", "--theme", "Create a new theme."
10 | c.option "path", "--path PATH", "Create a plugin at a specified path (defaults to current directory)."
11 |
12 | c.action do |args, options|
13 | if args.empty?
14 | raise "Please provide a plugin name, e.g. my_awesome_plugin."
15 | else
16 | @options = options
17 | @options['name'] = args[0]
18 | new_plugin
19 | end
20 | end
21 | end
22 | end
23 |
24 | def self.new_plugin
25 | path = @options['path'] ||= Dir.pwd
26 | gem_name = @options['name']
27 | path_to_gem = File.join(path, gem_name)
28 |
29 | if !File.exist?(path)
30 | raise "Directory not found: #{File.expand_path(path)}."
31 | end
32 |
33 | Dir.chdir(path) do
34 | if Dir.exist?(gem_name) && !Dir["#{gem_name}/*"].empty?
35 | raise "Directory not empty: #{File.expand_path(gem_name)}."
36 | end
37 |
38 | name = gem_name.gsub(/-/,'_')
39 | create_gem(name)
40 |
41 | fix_name(gem_name) if name != gem_name
42 |
43 | @settings = gem_settings(gem_name)
44 | @settings[:type] = @options['theme'] ? 'theme' : 'plugin'
45 |
46 | fix_spec_files
47 | add_to_gitignore
48 | add_dependency
49 | add_plugin
50 | add_assets
51 | end
52 | end
53 |
54 | def self.fix_name(path)
55 | name = @options['name'].gsub(/-/,'_')
56 | path = rename('./', name)
57 |
58 | rename(path, "lib/#{name}")
59 |
60 | gemspec = rename(path, "#{name}.gemspec")
61 | gem_file = rename(path, "lib/#{name}.rb")
62 |
63 | rewrite_name(gemspec, name)
64 | rewrite_name(gem_file, name)
65 | rewrite_name(File.join(path, 'README.md'), name)
66 | rewrite_name(File.join(path, 'Gemfile'), name)
67 |
68 | action = "rename".rjust(12).green.bold
69 | puts "#{action} #{name} to #{@options['name']}"
70 | end
71 |
72 | def self.rewrite_name(path, name)
73 | new_name = name.gsub(/_/, '-')
74 | content = File.read(path).gsub(name, new_name)
75 |
76 | File.open(path, 'w+') do |f|
77 | f.write(content)
78 | end
79 | end
80 |
81 | def self.rename(path, target)
82 | old = File.join(path, target)
83 | new = File.join(path, target.gsub(/_/, '-'))
84 | FileUtils.mv(old, new)
85 | new
86 | end
87 |
88 | def self.fix_spec_files
89 | @settings[:gemspec].sub! /(#{@settings[:spec_var]}\.files\s+=\s+)(.+)$/ do
90 | $1+"`git ls-files -z`.split(\"\\x0\").grep(%r{^(bin/|lib/|assets/|changelog|readme|license)}i)"
91 | end.sub!(/\s*#{@settings[:spec_var]}\.test_files.+$/, '')
92 | end
93 |
94 | def self.add_to_gitignore
95 | path = File.join @settings[:path], '.gitignore'
96 | content = File.open(path).read << <<-HERE
97 | .*-cache
98 | _site
99 | HERE
100 |
101 | File.open(path, 'w+') do |f|
102 | f.write(content)
103 | end
104 | end
105 |
106 | # Create a new gem with Bundle's gem command
107 | #
108 | def self.create_gem(name)
109 | begin
110 | require 'bundler'
111 | require 'bundler/cli'
112 | Bundler::CLI.start(['gem', name])
113 |
114 | rescue LoadError
115 | raise "To use this feature you'll need to install the bundler gem with `gem install bundler`."
116 | end
117 |
118 | end
119 |
120 | # Add Octopress Ink dependency to Gemspec
121 | #
122 | def self.add_dependency
123 | pos = @settings[:gemspec].rindex("end")
124 | @settings[:gemspec] = insert_before(@settings[:gemspec], pos, indent(dependencies))
125 |
126 | File.open(@settings[:gemspec_path], 'w+') {|f| f.write(@settings[:gemspec]) }
127 | end
128 |
129 | # Returns lines which need to be added as a dependency
130 | #
131 | # spec_var - variable used to assign gemspec attributes,
132 | # e.g. "spec" as in spec.name = "gem name"
133 | #
134 | def self.dependencies
135 | minor_version = VERSION.scan(/\d+\.\d/)[0]
136 | current_patch_version = VERSION.sub(/\.(alpha|rc).*/i, '')
137 | d = "#{@settings[:spec_var]}.add_development_dependency \"octopress\"\n\n"
138 | d = "#{@settings[:spec_var]}.add_development_dependency \"clash\"\n\n"
139 | d += "#{@settings[:spec_var]}.add_runtime_dependency \"octopress-ink\", \"~> #{minor_version}\"\n"
140 | end
141 |
142 | # Add Octopress Ink plugin to core module file
143 | #
144 | def self.add_plugin
145 | # Grab the module directory from the version.rb require.
146 | # If a gem is created with dashes e.g. "some-gem", Bundler puts the module file at lib/some/gem.rb
147 | file = File.join(@settings[:path], @settings[:module_path])
148 | mod = File.open(file).read
149 | mod = add_simple_plugin mod
150 |
151 | File.open(file, 'w+') {|f| f.write(mod) }
152 | end
153 |
154 | def self.add_assets
155 | dirs = %w{docs images fonts pages templates files layouts includes stylesheets javascripts}.map do |asset|
156 | File.join(@settings[:path], 'assets', asset)
157 | end
158 | create_empty_dirs dirs
159 |
160 | # Add Jekyll configuration file
161 | #
162 | FileUtils.touch File.join(@settings[:path], 'assets', 'config.yml')
163 | end
164 |
165 | # New plugin uses a simple configuration hash
166 | #
167 | def self.add_simple_plugin(mod)
168 | mod = "#{@settings[:require_version]}\n"
169 | mod += "require 'octopress-ink'\n"
170 | if @settings[:type] == 'theme'
171 | mod += "\nOctopress::Ink.add_theme({\n#{indent(plugin_config)}\n})\n"
172 | else
173 | mod += "\nOctopress::Ink.add_plugin({\n#{indent(plugin_config)}\n})\n"
174 | end
175 | end
176 |
177 |
178 | # Return an Ink Plugin configuration hash desinged for this gem
179 | #
180 | def self.plugin_config
181 | depth = @settings[:module_path].count('/')
182 | assets_path = ("../" * depth) + 'assets'
183 |
184 | config = <<-HERE
185 | name: "#{@settings[:module_name]}",
186 | slug: "#{@settings[:type] == 'theme' ? 'theme' : @settings[:name]}",
187 | gem: "#{@settings[:name]}",
188 | path: File.expand_path(File.join(File.dirname(__FILE__), "..")),
189 | version: #{@settings[:version]},
190 | description: "", # What does your theme/plugin do?
191 | source_url: "https://github.com/user/project", # <- Update info
192 | website: "" # Optional project website
193 | HERE
194 | config.rstrip
195 | end
196 |
197 | def self.write(path, contents)
198 | action = File.exist?(path) ? "written".rjust(12).blue.bold : "create".rjust(12).green.bold
199 |
200 | File.open(path, 'w+') do |f|
201 | f.write(contents)
202 | end
203 | puts "#{action} #{path.sub("#{Dir.pwd}/", '')}"
204 | end
205 |
206 | def self.create_empty_dirs(dirs)
207 | dirs.each do |d|
208 | dir = File.join(d)
209 | action = Dir.exist?(dir) ? "exists".rjust(12).blue.bold : "create".rjust(12).green.bold
210 | FileUtils.mkdir_p dir
211 | puts "#{action} #{dir.sub("#{Dir.pwd}/", '')}/"
212 | end
213 | end
214 |
215 | # Read gem settings from the gemspec
216 | #
217 | def self.gem_settings(gem_path)
218 | gemspec_path = Dir.glob(File.join(gem_path, "/*.gemspec")).first
219 |
220 | if gemspec_path.nil?
221 | raise "No gemspec file found at #{gem_path}/. To create a new plugin use `octopress ink new `"
222 | end
223 |
224 | gemspec = File.open(gemspec_path).read
225 | require_version = gemspec.scan(/require.+version.+$/)[0]
226 | module_subpath = require_version.scan(/['"](.+)\/version/).flatten[0]
227 | version = gemspec.scan(/version.+=\s+(.+)$/).flatten[0]
228 | module_name = format_name(version.split('::')[-2])
229 |
230 | {
231 | path: gem_path,
232 | gemspec: gemspec,
233 | gemspec_path: gemspec_path,
234 | spec_var: gemspec.scan(/(\w+)\.name/).flatten[0],
235 | name: gemspec.scan(/name.+['"](.+)['"]/).flatten[0],
236 | version: version,
237 | require_version: require_version,
238 | module_path: File.join('lib', module_subpath + '.rb'),
239 | module_name: module_name
240 | }
241 | end
242 |
243 | # Add spaces between capital letters
244 | #
245 | def self.format_name(name)
246 | name.scan(/.*?[a-z](?=[A-Z]|$)/).join(' ')
247 | end
248 |
249 | # Indent each line of a string
250 | #
251 | def self.indent(input, level=1)
252 | input.gsub(/^/, ' ' * level)
253 | end
254 |
255 | # Insert a string before a position
256 | #
257 | def self.insert_before(str, pos, input)
258 | if pos
259 | str[0..(pos - 1)] + input + str[pos..-1]
260 | else
261 | str
262 | end
263 | end
264 | end
265 | end
266 | end
267 | end
268 |
--------------------------------------------------------------------------------
/lib/octopress-ink/configuration.rb:
--------------------------------------------------------------------------------
1 | # encoding: UTF-8
2 |
3 | module Octopress
4 | module Ink
5 | DEFAULT_OPTIONS = {
6 | 'asset_pipeline' => {
7 | 'combine_css' => true,
8 | 'compress_css' => true,
9 | 'combine_js' => true,
10 | 'compress_js' => true,
11 | 'uglifier' => {},
12 | 'async_css' => false,
13 | 'async_js' => true,
14 | 'stylesheets_destination' => 'stylesheets',
15 | 'javascripts_destination' => 'javascripts',
16 | },
17 |
18 | 'date_format' => 'ordinal',
19 | }
20 |
21 | def self.configuration(options={})
22 | @config ||= Jekyll::Utils.deep_merge_hashes(DEFAULT_OPTIONS, Octopress.configuration(options))
23 | end
24 |
25 | end
26 | end
27 |
28 |
--------------------------------------------------------------------------------
/lib/octopress-ink/jekyll/convertible.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Convertible
4 | include Jekyll::Convertible
5 |
6 | # Read the YAML frontmatter.
7 | #
8 | # base - The String path to the dir containing the file.
9 | # name - The String filename of the file.
10 | # opts - optional parameter to File.read, default at site configs
11 | #
12 | # Returns nothing.
13 | def read_yaml(base, name, opts = {})
14 | begin
15 | self.content = File.read(File.join(base, name), merged_file_read_opts(opts))
16 | if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
17 | self.content = $POSTMATCH
18 | self.data = SafeYAML.load($1)
19 | end
20 | rescue SyntaxError => e
21 | Jekyll.logger.warn "YAML Exception reading #{File.join(base, name)}: #{e.message}"
22 | rescue Exception => e
23 | Jekyll.logger.warn "Error reading file #{File.join(base, name)}: #{e.message}"
24 | end
25 |
26 | self.data ||= {}
27 | end
28 | end
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/lib/octopress-ink/jekyll/hooks.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | if defined?(Jekyll::Hooks)
4 |
5 | Jekyll::Hooks.register :site, :after_reset do |site|
6 | Ink.watch_assets(site)
7 | if Plugins.registered
8 | Plugins.reset
9 | end
10 | end
11 |
12 | Jekyll::Hooks.register :site, :post_read do |site|
13 | Octopress.site = site
14 | Ink::Plugins.register
15 | Ink::Plugins.add_files
16 | end
17 |
18 | Jekyll::Hooks.register :site, :pre_render do |site, payload|
19 | Ink.payload.each do |key, val|
20 | payload[key] = val
21 | end
22 | end
23 |
24 | Jekyll::Hooks.register :site, :post_write do |site|
25 | Octopress::Ink::Plugins.static_files.each do |f|
26 | f.write(site.dest)
27 | end
28 |
29 | Octopress::Ink::Cache.write
30 | Octopress::Ink::Cache.clean
31 | end
32 | else
33 | class SiteHook < Hooks::Site
34 | def reset(site)
35 | Ink.watch_assets(site)
36 | if Plugins.registered
37 | Plugins.reset
38 | end
39 | end
40 |
41 | def post_read(site)
42 | Octopress.site = site
43 | Ink::Plugins.register
44 | Ink::Plugins.add_files
45 | end
46 |
47 | def merge_payload(payload, site)
48 | Ink.payload
49 | end
50 |
51 | def post_write(site)
52 | Octopress::Ink::Plugins.static_files.each do |f|
53 | f.write(site.dest)
54 | end
55 |
56 | Octopress::Ink::Cache.write
57 | Octopress::Ink::Cache.clean
58 | end
59 | end
60 | end
61 | end
62 | end
63 |
64 |
--------------------------------------------------------------------------------
/lib/octopress-ink/jekyll/layout.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | class Layout < Jekyll::Layout
4 | include Ink::Convertible
5 | end
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/lib/octopress-ink/jekyll/page.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | class Page < Jekyll::Page
4 | include Ink::Convertible
5 | attr_accessor :dir, :name, :plugin, :asset
6 |
7 | def relative_asset_path
8 | site_source = Pathname.new Octopress.site.source
9 | page_source = Pathname.new @base
10 | page_source.relative_path_from(site_source).to_s
11 | end
12 |
13 | def render(layouts, site_payload)
14 | site_payload = {
15 | 'plugin' => plugin.config(data['lang'])
16 | }.merge(site_payload)
17 |
18 | super(layouts, site_payload)
19 | end
20 |
21 |
22 | # Allow pages to read url from plugin configuration
23 | #
24 | def url
25 | @url ||= begin
26 | super
27 |
28 | if @url && @url =~ /\/$/
29 | if self.ext == '.xml'
30 | @url = File.join(url, "index.xml")
31 | else
32 | @url = File.join(url, "index.html")
33 | end
34 | end
35 |
36 | @url
37 | end
38 | end
39 | end
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/lib/octopress-ink/jekyll/static_file.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | class StaticFile
4 | def initialize(source, dest)
5 | @source = source
6 | @dest = dest
7 | end
8 |
9 | def destination(dest)
10 | File.join(dest, @dest)
11 | end
12 |
13 | def path
14 | @source
15 | end
16 |
17 | def write(dest)
18 | dest_path = destination(dest)
19 |
20 | FileUtils.mkdir_p(File.dirname(dest_path))
21 | FileUtils.cp(@source, dest_path)
22 |
23 | true
24 | end
25 | end
26 | end
27 | end
28 |
29 |
--------------------------------------------------------------------------------
/lib/octopress-ink/jekyll/static_file_content.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | class StaticFileContent < StaticFile
4 | def write(dest)
5 | dest_path = destination(dest)
6 |
7 | FileUtils.mkdir_p(File.dirname(dest_path))
8 | File.open(dest_path, 'w') { |f| f.write(@source) }
9 |
10 | true
11 | end
12 | end
13 | end
14 | end
15 |
16 |
--------------------------------------------------------------------------------
/lib/octopress-ink/plugin/bootstrap.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Bootstrap
4 | attr_reader :post_index, :post_archive, :category_index, :tag_index, :main_feed, :category_feed, :tag_feed, :articles_feed, :links_feed
5 |
6 | # This module gives Plugins the ability to easily offer
7 | # Index pages, archives, RSS feeds, Category and Tag indexes
8 | # All with multilingual support.
9 | #
10 |
11 | class << self
12 | attr_reader :pages, :categories, :tags, :feeds
13 | attr_accessor :tag_links, :category_links, :tag_list, :category_list
14 |
15 | def reset
16 | @pages = {}
17 | @categories = {}
18 | @tags = {}
19 | @feeds = {}
20 | @tag_links = {}
21 | @tag_list = {}
22 | @category_links = {}
23 | @category_list = {}
24 | end
25 |
26 | def page(lang, type, key)
27 | @pages[type][key]
28 | end
29 |
30 | def category(category, lang)
31 | category = "#{category}_#{page.lang}" if Octopress.multilingual? && page.lang
32 | @categories[category]
33 | end
34 |
35 | def tag(tag, lang)
36 | tag = "#{tag}_#{page.lang}" if Octopress.multilingual? && page.lang
37 | @tags[tag]
38 | end
39 |
40 | def add_page(page, key=nil)
41 | if @pages[page.url].nil?
42 | @pages[page.url] = page
43 |
44 | url = page.url.sub(/index.(xml|html)/, '')
45 |
46 | if key == 'feeds'
47 | @feeds[url] = page.data['title']
48 | elsif key == 'tag'
49 | tag = page.data[key]
50 | tag = "#{tag}_#{page.lang}" if Octopress.multilingual? && page.lang
51 | @tags[tag] = url
52 | elsif key == 'category'
53 | category = page.data[key]
54 | category = "#{category}_#{page.lang}" if Octopress.multilingual? && page.lang
55 | @categories[category] = url
56 | end
57 | page
58 | end
59 | end
60 | end
61 |
62 | # Generate site pages from bootstrappable pages and templates
63 | #
64 | def bootstrap_plugin
65 | register_templates
66 | inject_configs
67 |
68 | # Add pages for other languages
69 | if Octopress.multilingual?
70 | Octopress::Multilingual.languages.each { |lang| inject_pages(lang) }
71 | else
72 | inject_pages
73 | end
74 | end
75 |
76 | # Find templates
77 | def register_templates
78 | @post_index = find_template('post_index.html')
79 | @post_archive = find_template('post_archive.html')
80 | @main_feed = find_template('main_feed.xml')
81 | @articles_feed = find_template('articles_feed.xml')
82 | @links_feed = find_template('links_feed.xml')
83 | @category_index = find_template('category_index.html')
84 | @tag_index = find_template('tag_index.html')
85 | @category_feed = find_template('category_feed.xml')
86 | @tag_feed = find_template('tag_feed.xml')
87 | end
88 |
89 | # Merge optional configurations with plugin configuration
90 | # Plugin configs overrides optional configs
91 | #
92 | def inject_configs
93 | optional_configs.each do |opt_config|
94 | @config = Jekyll::Utils.deep_merge_hashes(YAML.load(opt_config), @config)
95 | end
96 | end
97 |
98 | # Add default configurations based on matching pages and templates
99 | #
100 | def optional_configs
101 | opt_config = []
102 | opt_config << post_index_config if post_index
103 | opt_config << post_archive_config if post_archive
104 | opt_config << main_feed_config if main_feed
105 | opt_config << links_feed_config if links_feed
106 | opt_config << articles_feed_config if articles_feed
107 | opt_config << category_index_config if category_index
108 | opt_config << tag_index_config if tag_index
109 | opt_config << category_feed_config if category_feed
110 | opt_config << tag_feed_config if tag_feed
111 |
112 | # Add shared configurations for tags and categories
113 | #
114 | opt_config << category_config_defaults if category_index || category_feed
115 | opt_config << tag_config_defaults if tag_index || tag_feed
116 |
117 | # Add feed defaults if plugin has any feed pages
118 | #
119 | if main_feed || links_feed || articles_feed || category_feed || tag_feed
120 | opt_config << feed_config_defaults
121 | end
122 |
123 | opt_config
124 | end
125 |
126 | # Automatically clone pages or generate templates
127 | #
128 | # This will only occur if:
129 | # - Site configuration warrants it
130 | # - Plugin assets are present
131 | #
132 | # For example:
133 | # - Index pages are cloned only for additonal languages on multilingual sites
134 | # - Link-blogging feeds are only generated if the octopress-linkblog plugin is present
135 | # - Category and tag indexes and feeds depend on post metadata and configuration
136 | #
137 | def inject_pages(lang=nil)
138 |
139 | # Save some time if there are no posts
140 | if posts?(lang)
141 |
142 | config = self.config(lang)
143 |
144 | add_indexes(config, lang, post_index)
145 | add_indexes(config, lang, post_archive)
146 |
147 | add_feeds(config, lang, main_feed)
148 |
149 | if linkposts?(lang)
150 | add_feeds(config, lang, links_feed)
151 | add_feeds(config, lang, articles_feed)
152 | end
153 |
154 | add_meta_indexes(config, lang, 'category', 'categories')
155 | add_meta_indexes(config, lang, 'tag', 'tags')
156 | end
157 | end
158 |
159 | def posts?(lang)
160 | if lang && Octopress.multilingual?
161 | !Octopress.site.posts_by_language(lang).empty?
162 | else
163 | !Octopress.site.posts.empty?
164 | end
165 | end
166 |
167 | def linkposts?(lang)
168 | if defined?(Octopress::Linkblog) && lang && Octopress.multilingual?
169 | !Octopress.site.linkposts_by_language(lang).empty?
170 | else
171 | !Octopress.site.posts.select {|p| p.data['linkpost']}.empty?
172 | end
173 | end
174 |
175 | def add_indexes(config, lang, template)
176 | return if template.nil?
177 |
178 | permalink = page_permalink(template, lang)
179 | title = page_title(template, config, lang)
180 |
181 | if page = template.new_page({
182 | 'lang' => lang,
183 | 'title' => title,
184 | 'permalink' => permalink
185 | })
186 |
187 | Bootstrap.add_page(page)
188 | Octopress.site.pages << page
189 | end
190 | end
191 |
192 | def add_feeds(config, lang, template)
193 | return if template.nil?
194 |
195 | permalink = page_permalink(template, lang)
196 |
197 | if page = template.new_page({
198 | 'lang' => lang,
199 | 'permalink' => permalink,
200 | 'title' => page_title(template, config, lang),
201 | 'feed_type' => feed_type(template),
202 | 'plugin' => self
203 | })
204 |
205 |
206 | Bootstrap.add_page(page, "feeds")
207 | Octopress.site.pages << page
208 | end
209 |
210 | page
211 | end
212 |
213 | # Generates tag or category index or feed pages for each category and language
214 | # Unless configuration lists specific categories
215 | #
216 | def add_meta_indexes(config, lang, type, types)
217 |
218 | # Get page/feed template for category or tag
219 | page_template = self.send("#{type}_index")
220 | feed_template = self.send("#{type}_feed")
221 |
222 | # Don't continue if this plugin doesn't have templates for this
223 | return unless page_template || feed_template
224 |
225 | collection = if lang
226 | Octopress.site.send("#{types}_by_language", lang).keys
227 | else
228 | Octopress.site.send("#{types}").keys
229 | end
230 |
231 | # User configured categories or tags
232 | configured = Array(config[types]).map(&:downcase)
233 |
234 | # If configuration specifices tags or categories, only generate indexes for those
235 | if !configured.empty?
236 | collection.delete_if { |i| !configured.include?(i) }
237 | end
238 |
239 | collection.each do |item|
240 | item = item.downcase
241 | item_label = tag_or_category_display_label(item, config)
242 |
243 | # Only add pages if plugin has a feed template for this item
244 | # and it hasn't been disabled in the configuration
245 | #
246 | if page_template
247 | if config["#{type}_indexes"] == false
248 | page_template.disable
249 | else
250 | permalink = page_permalink(page_template, lang).sub(":#{type}", item)
251 |
252 | if page = page_template.new_page({
253 | 'lang' => lang,
254 | "#{type}" => item,
255 | 'title' => page_title(page_template, config, lang).sub(":#{type}", item_label),
256 | 'permalink' => permalink,
257 | 'plugin' => self
258 | })
259 |
260 | Bootstrap.add_page(page, type)
261 | Octopress.site.pages << page
262 | end
263 | end
264 | end
265 |
266 | # Only add feeds if plugin has a feed template for this item
267 | # and it hasn't been disabled in the configuration
268 | #
269 | if feed_template
270 |
271 | if config["#{type}_feeds"] == false
272 | feed_template.disable
273 | else
274 | permalink = page_permalink(feed_template, lang).sub(":#{type}", item)
275 |
276 | if page = feed_template.new_page({
277 | 'lang' => lang,
278 | "#{type}" => item,
279 | 'title' => page_title(feed_template, config, lang).sub(":#{type}", item_label),
280 | 'permalink' => permalink,
281 | 'feed_type' => type,
282 | 'plugin' => self
283 | })
284 |
285 | Bootstrap.add_page(page, 'feeds')
286 | Octopress.site.pages << page
287 | end
288 | end
289 | end
290 | end
291 | end
292 |
293 | # Ensure pages have language in their permalinks except the primary language pages
294 | # Unless the user has specified /:lang/ in their permalink config
295 | #
296 | def page_permalink(page, lang)
297 | permalink = config(lang)['permalinks'][page_type(page)]
298 |
299 | # Obey the permalink configuration
300 | permalink = if lang && permalink.include?(":lang")
301 | permalink.sub(":lang", lang)
302 |
303 | # Otherwise only add lang for secondary languages
304 | elsif lang && lang != Octopress.site.config['lang']
305 | File.join("/#{lang}", permalink)
306 |
307 | # Finally strip language from url if primary language or no language defined
308 | else
309 | permalink.sub("/:lang/", '/')
310 | end
311 |
312 | if permalink.end_with?('/')
313 | ext = File.extname(page.path).match('xml') ? 'xml' : 'html'
314 | permalink += "index.#{ext}"
315 | end
316 |
317 | permalink
318 | end
319 |
320 |
321 | # Discern feed type based on filename
322 | #
323 | def feed_type(page)
324 | if page.path.include? 'articles'
325 | 'articles'
326 | elsif page.path.include? 'links'
327 | 'links'
328 | elsif page.path.include? 'category'
329 | 'category'
330 | elsif page.path.include? 'tag'
331 | 'tag'
332 | else
333 | 'main'
334 | end
335 | end
336 |
337 | def page_type(page)
338 | if page.path.include? 'feed'
339 | "#{feed_type(page)}_feed"
340 | elsif page.path.include? 'post_index'
341 | "post_index"
342 | elsif page.path.include? 'post_archive'
343 | "post_archive"
344 | elsif page.path.include? 'category_index'
345 | "category_index"
346 | elsif page.path.include? 'tag_index'
347 | "tag_index"
348 | end
349 | end
350 |
351 | def page_title(page, config, lang)
352 | type = page_type(page)
353 | title = config['titles'][type]
354 | if lang && Octopress.multilingual?
355 | title = title.sub(':lang_name', Octopress::Multilingual.language_name(lang))
356 | end
357 | title
358 | end
359 |
360 | def tag_or_category_display_label(label, config)
361 | label = label.capitalize
362 |
363 | if labels = config["#{type}_labels"]
364 | label = labels[type] || label
365 | end
366 |
367 | label
368 | end
369 |
370 | # Default configuration settings
371 | # Plugin authors can use or override these settings
372 | #
373 | def post_index_config
374 | <<-CONFIG
375 | titles:
376 | post_index: Posts
377 |
378 | permalinks:
379 | post_index: /
380 | CONFIG
381 | end
382 |
383 | def post_archive_config
384 | <<-CONFIG
385 | titles:
386 | post_archive: Archive
387 |
388 | permalinks:
389 | post_archive: /archive/
390 | CONFIG
391 | end
392 |
393 | def category_index_config
394 | <<-CONFIG
395 | titles:
396 | category_index: Posts in :category
397 |
398 | permalinks:
399 | category_index: #{"/:lang" if Octopress.multilingual?}/categories/:category/
400 | CONFIG
401 | end
402 |
403 | def tag_index_config
404 | <<-CONFIG
405 | titles:
406 | tag_index: Posts tagged with :tag
407 |
408 | permalinks:
409 | tag_index: #{"/:lang" if Octopress.multilingual?}/tags/:tag/
410 | CONFIG
411 | end
412 |
413 | def main_feed_config
414 | <<-CONFIG
415 | titles:
416 | main_feed: Posts #{"(:lang_name)" if Octopress.multilingual?}
417 |
418 | permalinks:
419 | main_feed: #{"/:lang" if Octopress.multilingual?}/feed/
420 | CONFIG
421 | end
422 |
423 | def links_feed_config
424 | <<-CONFIG
425 | titles:
426 | links_feed: Links #{"(:lang_name)" if Octopress.multilingual?}
427 |
428 | permalinks:
429 | links_feed: #{"/:lang" if Octopress.multilingual?}/feed/links/
430 | CONFIG
431 | end
432 |
433 | def articles_feed_config
434 | <<-CONFIG
435 | titles:
436 | articles_feed: Articles #{"(:lang_name)" if Octopress.multilingual?}
437 |
438 | permalinks:
439 | articles_feed: #{"/:lang" if Octopress.multilingual?}/feed/articles/
440 | CONFIG
441 | end
442 |
443 | def category_feed_config
444 | <<-CONFIG
445 | titles:
446 | category_feed: Posts in :category #{"(:lang_name)" if Octopress.multilingual?}
447 |
448 | permalinks:
449 | category_feed: #{"/:lang" if Octopress.multilingual?}/feed/categories/:category/
450 | CONFIG
451 | end
452 |
453 | def tag_feed_config
454 | <<-CONFIG
455 | titles:
456 | tag_feed: Posts tagged with :tag #{"(:lang_name)" if Octopress.multilingual?}
457 |
458 | permalinks:
459 | tag_feed: #{"/:lang" if Octopress.multilingual?}/feed/tags/:tag/
460 | CONFIG
461 | end
462 |
463 | def category_config_defaults
464 | <<-CONFIG
465 | #{"category_indexes: false" if category_index }
466 | #{"category_feeds: false" if category_feed }
467 | categories: []
468 | CONFIG
469 | end
470 |
471 | def tag_config_defaults
472 | <<-CONFIG
473 | #{"tag_indexes: false" if tag_index }
474 | #{"tag_feeds: false" if tag_feed }
475 | tags: []
476 | CONFIG
477 | end
478 |
479 | def feed_config_defaults
480 | <<-CONFIG
481 | feed_count: 20 # Number of items in feeds
482 | feed_excerpts: false # Use post excerpts in feeds
483 | #{"posts_link_out: true" if links_feed }
484 | CONFIG
485 | end
486 | end
487 | end
488 | end
489 |
--------------------------------------------------------------------------------
/lib/octopress-ink/plugin_asset_pipeline.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module PluginAssetPipeline
4 | extend self
5 |
6 | def reset
7 | @sass_converter = nil
8 | @combined_stylesheets = nil
9 | @stylesheets = nil
10 | @javascripts = nil
11 | @uglify_settings = nil
12 | @combined_js = ''
13 | @stylesheet_fingerprint = {}
14 | @javascript_fingerprint = nil
15 | @uglify_settings ||= Jekyll::Utils.symbolize_hash_keys(Ink.configuration['asset_pipeline']['uglifier'])
16 | @css_dir = Ink.configuration['asset_pipeline']['stylesheets_destination']
17 | @js_dir = Ink.configuration['asset_pipeline']['javascripts_destination']
18 | end
19 |
20 | # Compile CSS to take advantage of Sass's compression settings
21 | #
22 | def compile_css(content)
23 | configs = sass_converter.sass_configs
24 | configs[:syntax] = :scss
25 | configs[:style] ||= :compressed if Ink.configuration['asset_pipeline']['compress_css']
26 |
27 | Sass.compile(content, configs)
28 | end
29 |
30 | def compile_sass(sass)
31 | Sass.compile(sass.render, sass_configs(sass))
32 | end
33 |
34 | # Gets default Sass configuration hash from Jekyll
35 | #
36 | def sass_configs(sass)
37 | configs = sass_converter.sass_configs
38 |
39 | configs[:syntax] = sass.ext.sub(/^\./,'').to_sym
40 |
41 | if sass.respond_to? :load_paths
42 | configs[:load_paths] = sass.load_paths
43 | end
44 |
45 | configs
46 | end
47 |
48 | # Access Jekyll's built in Sass converter
49 | #
50 | def sass_converter
51 | @sass_converter ||= begin
52 | Octopress.site.converters.find do |c|
53 | c.kind_of?(Jekyll::Converters::Sass)
54 | end
55 | end
56 | end
57 |
58 | # Return a link tag, for all plugins' stylesheets
59 | #
60 | def stylesheet_tag
61 | if Ink.configuration['asset_pipeline']['async_css']
62 | async_stylesheet_tag
63 | else
64 | combined_stylesheet_tag
65 | end
66 | end
67 |
68 | def combined_stylesheet_tag
69 | tags = ''
70 | combined_stylesheet_urls.each do |media, url|
71 | tags.concat " "
72 | end
73 | tags
74 | end
75 |
76 | def async_stylesheet_tag
77 | js = uglify(File.read(Ink.gem_dir('assets','js','loadCSS.js')))
78 | %Q{\n#{combined_stylesheet_tag} }
79 | end
80 |
81 | def load_css
82 | script = ''
83 | combined_stylesheet_urls.each do |media, url|
84 | script << %Q{loadCSS("#{url}", null, "#{media}")\n}
85 | end
86 | script
87 | end
88 |
89 | def combined_stylesheet_urls
90 | urls = {}
91 | combine_stylesheets.keys.each do |media|
92 | urls[media] = combined_stylesheet_url(media)
93 | end
94 | urls
95 | end
96 |
97 | def combined_stylesheet_url(media)
98 | Filters.expand_url(combined_stylesheet_path(media))
99 | end
100 |
101 | def javascript_tag
102 | unless @combined_js == ''
103 | if Ink.configuration['asset_pipeline']['async_js']
104 | ""
105 | else
106 | ""
107 | end
108 | end
109 | end
110 |
111 | def combined_javascript_url
112 | Filters.expand_url(combined_javascript_path)
113 | end
114 |
115 | # Combine stylesheets from each plugin
116 | #
117 | # Returns a hash of stylesheets grouped by media types
118 | #
119 | # output: { 'screen' => 'body { background... }' }
120 | #
121 | def combine_stylesheets
122 | @combined_stylesheets ||= begin
123 | combined = {}
124 |
125 |
126 | stylesheets.clone.each do |media,files|
127 | files.each do |file|
128 | header = "/* #{file.plugin.type.capitalize}: #{file.plugin.name} */"
129 | combined[media] ||= ''
130 | combined[media] << "#{header}\n" unless combined[media] =~ /#{file.plugin.name}/
131 | combined[media] << file.content
132 | end
133 | end
134 |
135 | combined
136 | end
137 | end
138 |
139 | def write_combined_stylesheet
140 | css = combine_stylesheets
141 | css.keys.each do |media|
142 | contents = compile_css(css[media])
143 | write_files(contents, combined_stylesheet_path(media))
144 | end
145 | end
146 |
147 | def combined_stylesheet_path(media)
148 | File.join(@css_dir, "#{media}-#{stylesheet_fingerprint(media)}.css")
149 | end
150 |
151 | def stylesheet_fingerprint(media)
152 | @stylesheet_fingerprint[media] ||=
153 | fingerprint(stylesheets[media].clone.map(&:path))
154 | end
155 |
156 | # Get all plugins stylesheets
157 | #
158 | # Returns a hash of assets grouped by media
159 | #
160 | # output: { 'screen' => [Octopress::Ink::Assets::Stylesheet, ..]
161 | #
162 | def stylesheets
163 | @stylesheets ||= begin
164 | files = {}
165 | Plugins.plugins.clone.each do |plugin|
166 | plugin.stylesheets.each do |file|
167 | files[file.media] ||= []
168 | files[file.media] << file
169 | end
170 | end
171 | files
172 | end
173 | end
174 |
175 | def javascripts
176 | @javascripts ||=
177 | Plugins.plugins.clone.map(&:javascripts).flatten
178 | end
179 |
180 | def javascript_fingerprint
181 | @javascript_fingerprint ||=
182 | fingerprint(javascripts.clone.map(&:path))
183 | end
184 |
185 | def combined_javascript_path
186 | File.join(@js_dir, "all-#{javascript_fingerprint}.js")
187 | end
188 |
189 | def write_combined_javascript
190 | if Ink.configuration['asset_pipeline']['combine_js']
191 | javascripts.each do |file|
192 |
193 | js = if compress_js?(file)
194 | if cached = Cache.read_cache(file, @uglify_settings)
195 | cached
196 | else
197 | js = uglify(file.content)
198 | Cache.write_to_cache(file, js, @uglify_settings)
199 | end
200 | else
201 | file.content
202 | end
203 |
204 | unless @combined_js =~ /#{file.plugin.name}/
205 | @combined_js << "/* #{file.plugin.type.capitalize}: #{file.plugin.name} */\n"
206 | end
207 | @combined_js << js
208 | end
209 |
210 | unless @combined_js == ''
211 | write_files(@combined_js, combined_javascript_path)
212 | end
213 | end
214 | end
215 |
216 | def uglify(js)
217 | Uglifier.new(@uglify_settings).compile(js)
218 | end
219 |
220 | def compress_js?(file)
221 | Ink.configuration['asset_pipeline']['compress_js'] && !file.path.end_with?('.min.js')
222 | end
223 |
224 | def write_files(source, dest)
225 | Plugins.static_files << StaticFileContent.new(source, dest)
226 | end
227 |
228 | def fingerprint(paths)
229 | return '' if ENV['JEKYLL_ENV'] == 'test'
230 | paths = [paths] unless paths.is_a? Array
231 | Digest::MD5.hexdigest(paths.clone.map! { |path| "#{File.mtime(path).to_i}" }.join)
232 | end
233 |
234 | end
235 | end
236 | end
237 |
--------------------------------------------------------------------------------
/lib/octopress-ink/plugins.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Plugins
4 | attr_reader :registered, :css_asset_paths, :js_asset_paths
5 | extend self
6 |
7 | @registered = false
8 | @plugins = []
9 | @user_plugins = []
10 |
11 | def theme
12 | @theme
13 | end
14 |
15 | def each(&block)
16 | plugins.each(&block)
17 | end
18 |
19 | # Store static files to be written
20 | #
21 | def static_files
22 | @static_files
23 | end
24 |
25 | def size
26 | plugins.size
27 | end
28 |
29 | def plugin(slug)
30 | if slug == 'theme'
31 | @theme
32 | else
33 | found = plugins.reject { |p| p.slug != slug }
34 | if found.empty?
35 | raise IOError.new "No Theme or Plugin with the slug '#{slug}' was found."
36 | end
37 | found.first
38 | end
39 | end
40 |
41 | def plugins
42 | [@theme].concat(@plugins).concat(@user_plugins).compact
43 | end
44 |
45 | def reset
46 | @registered = false
47 | end
48 |
49 | def register
50 | unless @registered
51 | @registered = true
52 | @static_files = []
53 | @css_tags = []
54 | @js_tags = []
55 | Cache.reset
56 | Bootstrap.reset
57 | PluginAssetPipeline.reset
58 |
59 | plugins.each(&:register)
60 | end
61 | end
62 |
63 | def add_files
64 | add_assets(%w{images pages files fonts docs})
65 | add_stylesheets
66 | add_javascripts
67 | end
68 |
69 | def add_assets(assets)
70 | plugins.each do |p|
71 | p.add_asset_files(assets)
72 | end
73 | end
74 |
75 | def add_css_tag(tag)
76 | @css_tags << tag
77 | end
78 |
79 | def add_js_tag(tag)
80 | @js_tags << tag
81 | end
82 |
83 | def register_plugin(plugin, options=nil)
84 | new_plugin = plugin.new(options)
85 |
86 | case new_plugin.type
87 | when 'theme'
88 | @theme = new_plugin
89 | else
90 | if new_plugin.local
91 | @user_plugins << new_plugin
92 | else
93 | @plugins << new_plugin
94 | end
95 | end
96 | end
97 |
98 | def config(lang=nil)
99 | @configs ||= {}
100 | @configs[lang || 'default'] ||= get_config(lang)
101 | end
102 |
103 | def get_config(lang=nil)
104 | config = {}
105 | config['plugins'] = {}
106 |
107 | plugins.each do |p|
108 | if p == theme
109 | config['theme'] = p.config(lang)
110 | else
111 | config['plugins'][p.slug] = p.config(lang)
112 | end
113 | end
114 |
115 | config
116 | end
117 |
118 | # Inclue partials from plugins
119 | #
120 | def include(name, file)
121 | p = plugin(name)
122 | p.include(file)
123 | end
124 |
125 | # Read plugin dir from site configs
126 | #
127 | def custom_dir
128 | Octopress.site.plugin_manager.plugins_path.first
129 | end
130 |
131 | # Copy/Generate Stylesheets
132 | #
133 | def add_stylesheets
134 | if Ink.configuration['asset_pipeline']['combine_css']
135 | PluginAssetPipeline.write_combined_stylesheet
136 | else
137 | add_assets(%w{css sass})
138 | end
139 | end
140 |
141 | # Copy/Generate Javascripts
142 | #
143 | def add_javascripts
144 | if Ink.configuration['asset_pipeline']['combine_js']
145 | PluginAssetPipeline.write_combined_javascript
146 | else
147 | add_assets(%w{js coffee})
148 | end
149 | end
150 |
151 | def css_tags
152 | if Ink.configuration['asset_pipeline']['combine_css']
153 | PluginAssetPipeline.stylesheet_tag
154 | else
155 | @css_tags.join('')
156 | end
157 | end
158 |
159 | def js_tags
160 | if Ink.configuration['asset_pipeline']['combine_js']
161 | PluginAssetPipeline.javascript_tag
162 | else
163 | @js_tags.join('')
164 | end
165 | end
166 | end
167 | end
168 | end
169 |
--------------------------------------------------------------------------------
/lib/octopress-ink/tags.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Tags
4 | autoload :JavascriptTag, 'octopress-ink/tags/javascript'
5 | autoload :StylesheetTag, 'octopress-ink/tags/stylesheet'
6 | autoload :CategoryTag, 'octopress-ink/tags/category_tag'
7 | autoload :FeedsTag, 'octopress-ink/tags/feeds_tag'
8 | autoload :FeedUpdatedTag, 'octopress-ink/tags/feed_updated_tag'
9 | end
10 | end
11 | end
12 |
13 |
--------------------------------------------------------------------------------
/lib/octopress-ink/tags/category_tag.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Tags
4 | class CategoryTag < Liquid::Tag
5 | def initialize(tag, input, tokens)
6 | super
7 | @tag = tag
8 | if !input.nil?
9 | @input = input.strip
10 | end
11 | end
12 |
13 | def render(context)
14 | @context = context
15 |
16 | # Check to see if post loop is active, otherwise default to current page
17 | page = context['post'] || context['page']
18 |
19 | tags = Bootstrap.send(@tag)[page['url']]
20 |
21 | if tags.nil?
22 | if tags = item_tags(page)
23 | # Cache tags to speed up multiple references for the same post
24 | Bootstrap.send(@tag)[page['url']] = tags
25 | end
26 | end
27 |
28 | tags
29 | end
30 |
31 | def item_tags(page)
32 | items = page[item_name_plural]
33 |
34 | return nil if items.nil? || items.empty?
35 |
36 | items = items.sort.map { |i| item_link(page, i) }.compact.map do |link|
37 | if item_list?
38 | link = %Q{#{link} }
39 | end
40 |
41 | link
42 | end
43 |
44 | return nil if items.empty?
45 |
46 | if item_list?
47 | %Q{}
48 | else
49 | %Q{#{items.join(', ')} }
50 | end
51 | end
52 |
53 | def item_list?
54 | @tag.end_with? '_list'
55 | end
56 |
57 | def item_name
58 | @tag.match('tag') ? 'tag' : 'category'
59 | end
60 |
61 | def item_name_plural
62 | @tag.match('tag') ? 'tags' : 'categories'
63 | end
64 |
65 | def item_link(page, item)
66 | if dir = Bootstrap.send(item_name, item, page['lang'])
67 | path = File.join(@context['site']['baseurl'] || '', dir)
68 | %Q{#{item.capitalize} }
69 | end
70 | end
71 | end
72 | end
73 | end
74 | end
75 |
--------------------------------------------------------------------------------
/lib/octopress-ink/tags/feed_updated_tag.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Tags
4 | class FeedUpdatedTag < Liquid::Tag
5 | def render(context)
6 | feed = context['page.feed_type']
7 | site = context['site']
8 |
9 | if feed == 'category'
10 | posts = site['categories'][context['page.category']]
11 | else
12 | posts = site[feed] || site['posts']
13 | end
14 |
15 | if posts && !posts.empty?
16 | post = posts.sort_by do |p|
17 | p.data['date_updated'] || p.date
18 | end.last
19 |
20 | post.data['date_updated_xml'] || post.data['date_xml']
21 | end
22 | end
23 | end
24 | end
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/lib/octopress-ink/tags/feeds_tag.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Tags
4 | class FeedsTag < Liquid::Tag
5 | def render(context)
6 | tags = []
7 | Bootstrap.feeds.each do |url, title|
8 | tags << tag(url, title)
9 | end
10 | tags.join("\n")
11 | end
12 |
13 | def tag(url, title)
14 | %Q{ }
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/lib/octopress-ink/tags/javascript.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Tags
4 | class JavascriptTag < Liquid::Tag
5 | def render(context)
6 | Plugins.js_tags
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
13 |
--------------------------------------------------------------------------------
/lib/octopress-ink/tags/set_lang.rb:
--------------------------------------------------------------------------------
1 | # A placeholder for smooth integration of Octopress Multilingual
2 | unless defined? Octopress::Multilingual
3 | Liquid::Template.register_tag('set_lang', Liquid::Block)
4 | end
5 |
--------------------------------------------------------------------------------
/lib/octopress-ink/tags/stylesheet.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | module Tags
4 | class StylesheetTag < Liquid::Tag
5 | def render(context)
6 | Plugins.css_tags
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
13 |
--------------------------------------------------------------------------------
/lib/octopress-ink/utils.rb:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | module Octopress
4 | module Ink
5 | module Utils
6 | extend self
7 |
8 | def pretty_print_yaml(yaml)
9 | # Use json pretty_print, but make it look like yaml
10 | #
11 | JSON.pretty_generate(yaml)
12 | .sub(/\A{\n/,'') # remove leading {
13 | .sub(/}\z/,'') # remove trailing }
14 | .gsub(/^/,' ') # indent
15 | .gsub(/"(.+?)":/,'\1:') # remove quotes around keys
16 | .gsub(/,$/,'') # remove commas from end of lines
17 | .gsub(/{\n/,"\n") # remove keys with empty hashes
18 | .gsub(/^\s+}\n/,'') # remove keys with empty hashes
19 | .gsub(/\[\s+\]/,'[]') # remove whitespace in empty arrays
20 | end
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/lib/octopress-ink/version.rb:
--------------------------------------------------------------------------------
1 | module Octopress
2 | module Ink
3 | VERSION = "1.2.1"
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/lib/octopress-ink/watch.rb:
--------------------------------------------------------------------------------
1 | require 'jekyll-watch'
2 |
3 | # Add assets directories for selected Octopress Ink plugins to Jekyll's watch directories,
4 | # allowing plugin authors to dynamically preview changes to their plugin's assets.
5 | #
6 | module Jekyll
7 | module Watcher
8 | extend self
9 |
10 | def build_listener(site, options)
11 | require 'listen'
12 | paths = [options['source']].concat(ink_watch_paths(site)).compact
13 | Listen.to(
14 | *paths,
15 | :ignore => listen_ignore_paths(options),
16 | :force_polling => options['force_polling'],
17 | &(listen_handler(site))
18 | )
19 | end
20 |
21 | def ink_watch_paths(site)
22 | if plugins = site.config['ink_watch']
23 | if plugins == 'all'
24 | Octopress::Ink.plugins.dup.map(&:asset_paths)
25 | else
26 | plugin_paths Array(plugins)
27 | end
28 | end
29 | end
30 |
31 | def plugin_paths(plugins)
32 | plugins.dup.map do |plugin|
33 | if plugin = Octopress::Ink.plugin(plugin)
34 | plugin.assets_path
35 | end
36 | end.compact
37 | end
38 | end
39 | end
40 |
--------------------------------------------------------------------------------
/octopress-ink.gemspec:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 | lib = File.expand_path('../lib', __FILE__)
3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4 | require 'octopress-ink/version'
5 |
6 | Gem::Specification.new do |spec|
7 | spec.name = "octopress-ink"
8 | spec.version = Octopress::Ink::VERSION
9 | spec.authors = ["Brandon Mathis"]
10 | spec.email = ["brandon@imathis.com"]
11 | spec.summary = %q{A framework for creating themes and plugins for Jekyll sites}
12 | spec.homepage = "https://github.com/octopress/ink"
13 | spec.license = "MIT"
14 |
15 | spec.files = `git ls-files -z`.split("\x0").grep(/^(bin\/|lib\/|assets\/|demo\/|changelog|readme|license)/i)
16 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17 | spec.require_paths = ["lib"]
18 |
19 |
20 | spec.add_runtime_dependency "jekyll", ">= 2.0"
21 |
22 | spec.add_runtime_dependency "uglifier", "~> 2.5"
23 | spec.add_runtime_dependency "octopress-hooks", "~> 2.2"
24 | spec.add_runtime_dependency "octopress-include-tag", "~> 1.0"
25 | spec.add_runtime_dependency "octopress-filters", "~> 1.1"
26 | spec.add_runtime_dependency "octopress-date-format"
27 | spec.add_runtime_dependency "octopress-autoprefixer"
28 | spec.add_runtime_dependency "octopress", "~> 3.0"
29 |
30 | spec.add_development_dependency "rake"
31 | spec.add_development_dependency "clash"
32 | spec.add_development_dependency "octopress-multilingual"
33 | spec.add_development_dependency "octopress-linkblog"
34 | spec.add_development_dependency "jekyll-coffeescript"
35 |
36 | spec.add_development_dependency "bundler", "~> 1.7"
37 | spec.add_development_dependency "octopress-debugger"
38 | end
39 |
--------------------------------------------------------------------------------
/test/_clash.yml:
--------------------------------------------------------------------------------
1 | -
2 | title: Simple build
3 | dir: standard
4 | build: true
5 | -
6 | title: Compare build
7 | dir: standard
8 | compare: _expected/standard _site
9 | -
10 | title: Should build with separate javascript and stylesheet files
11 | dir: standard
12 | build: true
13 | config:
14 | jekyll:
15 | - _config.yml
16 | - _combine_false.yml
17 | compare:
18 | - _expected/combine_false/stylesheets _site/stylesheets
19 | - _expected/combine_false/javascripts _site/javascripts
20 | - _expected/combine_false/asset_tag.html _site/asset_tag.html
21 | -
22 | title: Should compress stylesheets and javascripts
23 | dir: standard
24 | build: true
25 | config:
26 | jekyll:
27 | - _config.yml
28 | - _compress_false.yml
29 | compare:
30 | - _expected/compress_false/stylesheets _site/stylesheets
31 | - _expected/compress_false/javascripts _site/javascripts
32 | -
33 | title: Should build with separate javascript and stylesheet files
34 | dir: standard
35 | build: true
36 | config:
37 | jekyll:
38 | - _config.yml
39 | theme: _order_assets.yml
40 | compare:
41 | - _expected/order_assets/stylesheets _site/stylesheets
42 | - _expected/order_assets/javascripts _site/javascripts
43 | - _expected/order_assets/asset_tag.html _site/asset_tag.html
44 | -
45 | title: Should build with asynchronous CSS loading via loadCSS.js
46 | dir: standard
47 | build: true
48 | config:
49 | jekyll:
50 | - _config.yml
51 | - _async_css.yml
52 | compare:
53 | - _expected/async_css/asset_tag.html _site/asset_tag.html
54 | -
55 | title: Should build stylesheets and javascripts to css and js directories
56 | dir: standard
57 | build: true
58 | config:
59 | jekyll:
60 | - _config.yml
61 | - _configure_asset_destination.yml
62 | compare:
63 | - _expected/configure_asset_destination/css _site/css
64 | - _expected/configure_asset_destination/js _site/js
65 | - _expected/configure_asset_destination/asset_tag.html _site/asset_tag.html
66 | -
67 | title: Should allow multilingual configuration
68 | dir: multilingual
69 | build: true
70 | compare: _expected _site
71 | -
72 | title: Test plugin bootstrap templates
73 | dir: bootstrap
74 | build: true
75 | compare: _expected _site
76 | -
77 | title: Test local plugin bootstrap
78 | dir: bootstrap-local
79 | build: true
80 | compare: _expected/index.html _site/index.html
81 | -
82 | title: Test plugin bootstrap with no posts
83 | dir: bootstrap-no-posts
84 | build: true
85 | compare: _expected _site
86 | -
87 | title: Test plugin bootstrap with no linkposts
88 | dir: bootstrap-no-linkposts
89 | build: true
90 | compare: _expected _site
91 | -
92 | title: Test plugin bootstrap with all the toppings
93 | dir: bootstrap-multilingual-linkblog
94 | build: true
95 | compare: _expected _site
96 | -
97 | title: Should copy all theme assets
98 | dir: standard
99 | before: octopress ink copy theme --path _copy --force
100 | compare: _expected/copy_test _copy
101 | after: rm -rf _copy
102 | -
103 | title: Should copy only pages and layouts
104 | dir: standard
105 | before: octopress ink copy theme --layouts --pages --path _copy --force
106 | compare: _expected/copy_layouts_pages _copy
107 | after: rm -rf _copy
108 | -
109 | title: Should create a plugins scaffold
110 | dir: standard
111 | before:
112 | - 'rm -rf _site/test-theme'
113 | - 'git config user.name > .git-config-user-name'
114 | - 'git config user.email > .git-config-user-email'
115 | - 'git config user.name ""'
116 | - 'git config user.email ""'
117 | - 'octopress ink new test-theme --theme --path _site'
118 | - 'rm -rf _site/test-theme/.git'
119 | compare:
120 | - _expected/test-theme/lib _site/test-theme/lib
121 | after:
122 | - 'cat .git-config-user-name | tr -d "\n" | xargs -0 git config user.name'
123 | - 'cat .git-config-user-email | tr -d "\n" | xargs -0 git config user.email'
124 | - 'rm -rf .git-config-user-name .git-config-user-email'
125 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/config.yml:
--------------------------------------------------------------------------------
1 | test: config from plugin
2 | test_override: also config from plugin
3 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/docs/index.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | omg
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/files/robots.txt:
--------------------------------------------------------------------------------
1 | I like robots
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/fonts/foo.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/octopress/ink/7a3a796b63d361f6f60bf516dba099664e11fd80/test/_ink_plugins/awesome-sauce/assets/fonts/foo.otf
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/includes/dir/other-include.html:
--------------------------------------------------------------------------------
1 | Why, hello there!
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/includes/some-include.html:
--------------------------------------------------------------------------------
1 | include from plugin
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/layouts/test-layout.html:
--------------------------------------------------------------------------------
1 | The awesome-sauce plugin layout
2 | {{ content }}
3 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/pages/a.html:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /cats.html
3 | ---
4 | Page one from plugin
5 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/pages/b.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | Page two from plugin
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/pages/config-test.html:
--------------------------------------------------------------------------------
1 | ---
2 | test: working
3 | ---
4 |
5 | {{ page.test }} -> working
6 | {{ plugin.test }} <-- Get plugin config?
7 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/pages/dir/c.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | This is page C.
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/pages/dir/d.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | This page has no permalink :)
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/stylesheets/plugin-media-test@print.css:
--------------------------------------------------------------------------------
1 | article a:after {
2 | content: attr(href);
3 | }
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/assets/stylesheets/plugin-test.css:
--------------------------------------------------------------------------------
1 | .plugin-widget {
2 | background: red;
3 | color: #fff;
4 | }
5 |
--------------------------------------------------------------------------------
/test/_ink_plugins/awesome-sauce/plugin.rb:
--------------------------------------------------------------------------------
1 | require 'octopress-ink'
2 |
3 | class AwesomeSauce < Octopress::Ink::Plugin
4 | def add_template_pages
5 | add_template_page('template-test.html', {
6 | 'title' => 'Awesome!',
7 | 'permalink' => '/kittens/index.html',
8 | })
9 | end
10 | end
11 |
12 | Octopress::Ink::Plugins.register_plugin(AwesomeSauce, {
13 | name: 'Awesome Sauce',
14 | slug: 'awesome-sauce',
15 | path: File.expand_path(File.dirname(__FILE__)),
16 | description: "Test some plugins y'all"
17 | })
18 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap-local/plugin.rb:
--------------------------------------------------------------------------------
1 | require 'octopress-ink'
2 |
3 | module Octopress
4 | class LocalBootstrap < Ink::Plugin
5 | def reset
6 | super
7 | @local_layout_dir = Jekyll::LayoutReader.new(Octopress.site).layout_directory
8 | end
9 |
10 | def find_template(name)
11 | if local && layout = Octopress.site.layouts.values.find { |l| l.name == name }
12 | @templates << Ink::Assets::LocalTemplate.new(self, @local_layout_dir, layout)
13 | @templates.last
14 | else
15 | super(name)
16 | end
17 | end
18 | end
19 | end
20 |
21 | Octopress::Ink.register_plugin(Octopress::LocalBootstrap, {
22 | name: "Bootstrap Local",
23 | description: "Bootstrap local layouts",
24 | path: File.expand_path(File.dirname(__FILE__)),
25 | local: true
26 | })
27 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap-theme/assets/templates/main_feed.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | From Theme:
4 | {{ page.title }} - {{ page.lang }}
5 | {% for post in site.posts %}{{ post.title }} - {{ post.lang }}
6 | {% endfor %}
7 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap-theme/assets/templates/post_index.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | From Theme:
4 | {{ page.title }} - {{ page.lang }}
5 | {% for post in site.posts %}{{ post.title }} - {{ post.lang }}
6 | {% endfor %}
7 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap-theme/plugin.rb:
--------------------------------------------------------------------------------
1 | require 'octopress-ink'
2 | Octopress::Ink.add_theme({
3 | name: "Bootstrap Theme",
4 | description: "Bootstrap test theme",
5 | path: File.expand_path(File.dirname(__FILE__))
6 | })
7 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/includes/category-loop.html:
--------------------------------------------------------------------------------
1 | {{ page.title }} - {{ page.lang }}
2 | {% for post in site.categories[page.category] %}{{ post.title }} - {{ post.lang }}
3 | {% endfor %}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/includes/post-loop.html:
--------------------------------------------------------------------------------
1 | {{ page.title }} - {{ page.lang }}
2 | {% for post in site.posts %}{{ post.title }} - {{ post.lang }}
3 | {% endfor %}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/includes/tag-loop.html:
--------------------------------------------------------------------------------
1 | {{ page.title }} - {{ page.lang }}
2 | {% for post in site.tags[page.tag] %}{{ post.title }} - {{ post.lang }}
3 | {% endfor %}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/templates/articles_feed.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {{ page.title }} - {{ page.lang }}
4 | {% for post in site.articles %}{{ post.title }} - {{ post.lang }}
5 | {% endfor %}
6 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/templates/category_feed.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {% include bootstrap:category-loop.html %}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/templates/category_index.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {% include bootstrap:category-loop.html %}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/templates/links_feed.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {{ page.title }} - {{ page.lang }}
4 | {% for post in site.linkposts %}{{ post.title }} - {{ post.lang }}
5 | {% endfor %}
6 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/templates/main_feed.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {% include bootstrap:post-loop.html %}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/templates/post_archive.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | Archive
4 | {% include bootstrap:post-loop.html %}
5 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/templates/post_index.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | From Bootstrap:
4 | {% include bootstrap:post-loop.html %}
5 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/templates/tag_feed.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {% include bootstrap:tag-loop.html %}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/assets/templates/tag_index.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {% include bootstrap:tag-loop.html %}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/bootstrap/plugin.rb:
--------------------------------------------------------------------------------
1 | require 'octopress-ink'
2 | Octopress::Ink.add_plugin({
3 | name: "Bootstrap",
4 | description: "Bootstrap test",
5 | path: File.expand_path(File.dirname(__FILE__))
6 | })
7 |
--------------------------------------------------------------------------------
/test/_ink_plugins/lang-test/assets/config.yml:
--------------------------------------------------------------------------------
1 | title: Main language title
2 | subtitle: a subtitle
3 |
--------------------------------------------------------------------------------
/test/_ink_plugins/lang-test/assets/config_de.yml:
--------------------------------------------------------------------------------
1 | title: German title
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/lang-test/plugin.rb:
--------------------------------------------------------------------------------
1 | require 'octopress-ink'
2 |
3 | Octopress::Ink.add_plugin({
4 | name: 'Lang Test',
5 | path: File.expand_path(File.dirname(__FILE__)),
6 | description: "Testing language configurations."
7 | })
8 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/config.yml:
--------------------------------------------------------------------------------
1 | test: config from theme
2 | test_override: also config from theme
3 |
4 | sass:
5 | import: partials/colors
6 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/files/.foo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/octopress/ink/7a3a796b63d361f6f60bf516dba099664e11fd80/test/_ink_plugins/test-theme/assets/files/.foo
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/files/disabled-file.txt:
--------------------------------------------------------------------------------
1 | some stupid file that shouldn't
2 | exist
3 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/files/favicon.ico:
--------------------------------------------------------------------------------
1 | default favicon
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/files/favicon.png:
--------------------------------------------------------------------------------
1 | some favicon
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/files/test.html:
--------------------------------------------------------------------------------
1 | testing theme/files assets
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/fonts/font-one.otf:
--------------------------------------------------------------------------------
1 | not a font
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/fonts/font-two.ttf:
--------------------------------------------------------------------------------
1 | such font. very kern.
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/includes/bar.html:
--------------------------------------------------------------------------------
1 | include from theme
2 |
3 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/includes/greet.html:
--------------------------------------------------------------------------------
1 | {{ include.greeting }}, I heard you like includes.
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/javascripts/bar.js:
--------------------------------------------------------------------------------
1 | console.log('bar')
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/javascripts/blah.coffee:
--------------------------------------------------------------------------------
1 | console.log 'dang'
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/javascripts/disable-this.js:
--------------------------------------------------------------------------------
1 | console.log('omgwtfbbq!!!11one')
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/javascripts/foo.js:
--------------------------------------------------------------------------------
1 | console.log('omg')
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/javascripts/jq.min.js:
--------------------------------------------------------------------------------
1 | console.log("this should not be minifed")
2 | //There should be
3 |
4 | //A space there ^
5 |
6 | // and there
7 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ page.title }}
7 |
8 |
9 |
10 | {{ content }}
11 |
12 |
13 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/layouts/test.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | ---
4 | {{ content }}
5 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/pages/disable-test.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | This page shouldn't appear
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/pages/four.xml:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /four/
3 | ---
4 |
5 | This page is totally a thing.
6 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/pages/one.xml:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /test_pages/feed/
3 | ---
4 | fooo
5 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/pages/three.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | permalink: /test_pages/three.html
4 | ---
5 |
6 | SUB BABY
7 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/pages/two.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | ---
4 |
5 | Testing pages. **strong** *emphasized* [a link](http://example.com)
6 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/stylesheets/disable-this.css:
--------------------------------------------------------------------------------
1 | .do-not-exist { background: #bcbcbc; }
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/stylesheets/disable.sass:
--------------------------------------------------------------------------------
1 | .do-not-exist
2 | background: #f00
3 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/stylesheets/main.scss:
--------------------------------------------------------------------------------
1 | ---
2 | property: background
3 | ---
4 | @import '{{ theme.sass.import }}';
5 | body { {{ page.property }}: $bg; }
6 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/stylesheets/partials/_colors.scss:
--------------------------------------------------------------------------------
1 | $bg: white;
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/stylesheets/theme-media-test@print.css:
--------------------------------------------------------------------------------
1 | * { background: none; color: #000; }
2 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/stylesheets/theme-test.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | }
5 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/stylesheets/theme-test2.css:
--------------------------------------------------------------------------------
1 | .main {
2 | color: #444;
3 | }
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/templates/post_index.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | From Theme:
4 | {{ page.title }}
5 | {% for post in site.posts %}
6 | {{ post.title }}{% endfor %}
7 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/templates/template-override-test.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {{ page.title }}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/assets/templates/template-test.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {{ page.title }}
4 |
--------------------------------------------------------------------------------
/test/_ink_plugins/test-theme/plugin.rb:
--------------------------------------------------------------------------------
1 | require 'octopress-ink'
2 | class ThemePlugin < Octopress::Ink::Plugin
3 | def add_template_pages
4 | add_template_page('template-test.html', {
5 | 'title' => 'Awesome!',
6 | 'permalink' => '/template-test/index.html'
7 | })
8 | add_template_page('template-override-test.html', {
9 | 'title' => 'Crash Override',
10 | 'permalink' => '/template-test/override.html'
11 | })
12 | end
13 | end
14 |
15 | Octopress::Ink.register_theme(ThemePlugin, {
16 | name: "Classic Theme",
17 | description: "Test theme y'all",
18 | path: File.expand_path(File.dirname(__FILE__))
19 | })
20 |
--------------------------------------------------------------------------------
/test/_posts/2014-02-01-test-post.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Test Post
3 | lang: de
4 | category: awesome
5 | tags: nice sweet
6 | ---
7 |
8 | Test post **strong** *emphasized* [some link](http://example.com)
9 |
10 |
--------------------------------------------------------------------------------
/test/_posts/2014-02-02-test-post-2.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Another Test Post
3 | lang: en
4 | category: cool
5 | tag: sweet
6 | ---
7 |
8 | some random post
9 | relative link
10 |
--------------------------------------------------------------------------------
/test/_posts/2015-02-27-link-post-de.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Another Link Post
3 | lang: de
4 | external-url: http://example.de/awesome/
5 | ---
6 |
7 | some random post
8 | relative link
9 |
--------------------------------------------------------------------------------
/test/_posts/2015-02-27-link-post.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: A Link Post
3 | lang: en
4 | category: cool
5 | tag: sweet
6 | external-url: http://example.com/awesome/
7 | ---
8 |
9 | some random post
10 | relative link
11 |
--------------------------------------------------------------------------------
/test/_templates/page:
--------------------------------------------------------------------------------
1 | ---
2 | layout: {{ layout }}
3 | title: {{ title }}
4 | ---
5 |
--------------------------------------------------------------------------------
/test/_templates/post:
--------------------------------------------------------------------------------
1 | ---
2 | layout: {{ layout }}
3 | title: {{ title }}
4 | date: {{ date }}
5 | ---
6 |
--------------------------------------------------------------------------------
/test/bootstrap-local/_config.yml:
--------------------------------------------------------------------------------
1 | name: Some Jekyll Site
2 | category_labels:
3 | awesome: Totally Sweet
4 |
--------------------------------------------------------------------------------
/test/bootstrap-local/_expected/index.html:
--------------------------------------------------------------------------------
1 | Read from site layouts
2 |
--------------------------------------------------------------------------------
/test/bootstrap-local/_layouts/post_index.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | Read from site layouts
4 |
--------------------------------------------------------------------------------
/test/bootstrap-local/_plugins/loader.rb:
--------------------------------------------------------------------------------
1 | require '../_ink_plugins/bootstrap-local/plugin.rb'
2 |
--------------------------------------------------------------------------------
/test/bootstrap-local/_posts:
--------------------------------------------------------------------------------
1 | ../_posts
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_config.yml:
--------------------------------------------------------------------------------
1 | lang: en
2 | name: Some Jekyll Site
3 | category_labels:
4 | awesome: Totally Sweet
5 | gems:
6 | - octopress-multilingual
7 | - octopress-linkblog
8 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/archive/index.html:
--------------------------------------------------------------------------------
1 | From Bootstrap (Override):
2 | Archive
3 |
4 | A Link Post
5 | Another Test Post
6 |
7 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/2015/02/27/link-post-de.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/archivieren/index.html:
--------------------------------------------------------------------------------
1 | From Bootstrap (Override):
2 | Archivieren - (Deutsch)
3 |
4 | Another Link Post
5 | Test Post
6 |
7 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/awesome/2014/02/01/test-post.html:
--------------------------------------------------------------------------------
1 | Test post strong emphasized some link
2 |
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/categories/awesome/index.html:
--------------------------------------------------------------------------------
1 | Posts in Awesome - de
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/feed/articles/index.xml:
--------------------------------------------------------------------------------
1 | Articles (Deutsch) - de
2 | Test Post - de
3 |
4 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/feed/categories/awesome/index.xml:
--------------------------------------------------------------------------------
1 | Posts in Awesome (Deutsch) - de
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/feed/index.xml:
--------------------------------------------------------------------------------
1 | From Theme:
2 | Posts (Deutsch) - de
3 | Another Link Post - de
4 | Test Post - de
5 |
6 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/feed/links/index.xml:
--------------------------------------------------------------------------------
1 | Links (Deutsch) - de
2 | Another Link Post - de
3 |
4 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/feed/tags/nice/index.xml:
--------------------------------------------------------------------------------
1 | Posts tagged with Nice (Deutsch) - de
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/feed/tags/sweet/index.xml:
--------------------------------------------------------------------------------
1 | Posts tagged with Sweet (Deutsch) - de
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/index.html:
--------------------------------------------------------------------------------
1 | From Theme:
2 | Posts - de
3 | Another Link Post - de
4 | Test Post - de
5 |
6 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/tags/nice/index.html:
--------------------------------------------------------------------------------
1 | Posts tagged with Nice - de
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/de/tags/sweet/index.html:
--------------------------------------------------------------------------------
1 | Posts tagged with Sweet - de
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/en/categories/cool/index.html:
--------------------------------------------------------------------------------
1 | Posts in Cool - en
2 | A Link Post - en
3 | Another Test Post - en
4 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/en/cool/2014/02/02/test-post-2.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/en/cool/2015/02/27/link-post.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/en/feed/articles/index.xml:
--------------------------------------------------------------------------------
1 | Articles (English) - en
2 | Another Test Post - en
3 |
4 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/en/feed/categories/cool/index.xml:
--------------------------------------------------------------------------------
1 | Posts in Cool (English) - en
2 | A Link Post - en
3 | Another Test Post - en
4 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/en/feed/index.xml:
--------------------------------------------------------------------------------
1 | From Theme:
2 | Posts (English) - en
3 | A Link Post - en
4 | Another Test Post - en
5 |
6 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/en/feed/links/index.xml:
--------------------------------------------------------------------------------
1 | Links (English) - en
2 | A Link Post - en
3 |
4 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/en/feed/tags/sweet/index.xml:
--------------------------------------------------------------------------------
1 | Posts tagged with Sweet (English) - en
2 | A Link Post - en
3 | Another Test Post - en
4 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/en/tags/sweet/index.html:
--------------------------------------------------------------------------------
1 | Posts tagged with Sweet - en
2 | A Link Post - en
3 | Another Test Post - en
4 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_expected/index.html:
--------------------------------------------------------------------------------
1 | From Theme:
2 | Posts - en
3 | A Link Post - en
4 | Another Test Post - en
5 |
6 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_plugins/bootstrap/config.yml:
--------------------------------------------------------------------------------
1 | category_feeds: true
2 | category_indexes: true
3 | tag_feeds: true
4 | tag_indexes: true
5 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_plugins/bootstrap/config_de.yml:
--------------------------------------------------------------------------------
1 | titles:
2 | post_index: Posts - awesome
3 | post_archive: Archivieren - (:lang_name)
4 | permalinks:
5 | post_archive: /:lang/archivieren/
6 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_plugins/bootstrap/templates/post_archive.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | From Bootstrap (Override):
4 | {{ page.title }}
5 | {% for post in site.posts %}
6 | {{ post.title }}{% endfor %}
7 |
8 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_plugins/loader.rb:
--------------------------------------------------------------------------------
1 | require '../_ink_plugins/bootstrap/plugin.rb'
2 | require '../_ink_plugins/bootstrap-theme/plugin.rb'
3 |
--------------------------------------------------------------------------------
/test/bootstrap-multilingual-linkblog/_posts:
--------------------------------------------------------------------------------
1 | ../_posts
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_config.yml:
--------------------------------------------------------------------------------
1 | name: Some Jekyll Site
2 | category_labels:
3 | awesome: Totally Sweet
4 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_expected/2014/02/01/test-post.html:
--------------------------------------------------------------------------------
1 | Test post strong emphasized some link
2 |
3 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_expected/2014/02/02/test-post-2.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_expected/archive/index.html:
--------------------------------------------------------------------------------
1 | From Bootstrap (Override):
2 | Archive
3 |
4 | Another Test Post
5 | Test Post
6 |
7 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_expected/feed/index.xml:
--------------------------------------------------------------------------------
1 | From Theme:
2 | Posts -
3 | Another Test Post - en
4 | Test Post - de
5 |
6 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_expected/index.html:
--------------------------------------------------------------------------------
1 | From Theme:
2 | Posts -
3 | Another Test Post - en
4 | Test Post - de
5 |
6 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_plugins/bootstrap/config.yml:
--------------------------------------------------------------------------------
1 | category_feeds: true
2 | category_indexes: true
3 | tag_feeds: true
4 | tag_indexes: true
5 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_plugins/bootstrap/config_de.yml:
--------------------------------------------------------------------------------
1 | titles:
2 | post_index: Posts - awesome
3 | post_archive: Archivieren - (:lang_name)
4 | permalinks:
5 | post_archive: /:lang/archivieren/
6 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_plugins/bootstrap/templates/post_archive.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | From Bootstrap (Override):
4 | {{ page.title }}
5 | {% for post in site.posts %}
6 | {{ post.title }}{% endfor %}
7 |
8 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_plugins/loader.rb:
--------------------------------------------------------------------------------
1 | require '../_ink_plugins/bootstrap/plugin.rb'
2 | require '../_ink_plugins/bootstrap-theme/plugin.rb'
3 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_posts/2014-02-01-test-post.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Test Post
3 | lang: de
4 | ---
5 |
6 | Test post **strong** *emphasized* [some link](http://example.com)
7 |
8 |
--------------------------------------------------------------------------------
/test/bootstrap-no-linkposts/_posts/2014-02-02-test-post-2.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Another Test Post
3 | lang: en
4 | ---
5 |
6 | some random post
7 | relative link
8 |
--------------------------------------------------------------------------------
/test/bootstrap-no-posts/_config.yml:
--------------------------------------------------------------------------------
1 | name: Some Jekyll Site
2 | category_labels:
3 | awesome: Totally Sweet
4 |
--------------------------------------------------------------------------------
/test/bootstrap-no-posts/_expected/index.html:
--------------------------------------------------------------------------------
1 | just this page should exist
2 |
--------------------------------------------------------------------------------
/test/bootstrap-no-posts/_plugins/bootstrap/config.yml:
--------------------------------------------------------------------------------
1 | category_feeds: true
2 | category_indexes: true
3 | tag_feeds: true
4 | tag_indexes: true
5 |
--------------------------------------------------------------------------------
/test/bootstrap-no-posts/_plugins/bootstrap/config_de.yml:
--------------------------------------------------------------------------------
1 | titles:
2 | post_index: Posts - awesome
3 | post_archive: Archivieren - (:lang_name)
4 | permalinks:
5 | post_archive: /:lang/archivieren/
6 |
--------------------------------------------------------------------------------
/test/bootstrap-no-posts/_plugins/bootstrap/templates/post_archive.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | From Bootstrap (Override):
4 | {{ page.title }}
5 | {% for post in site.posts %}
6 | {{ post.title }}{% endfor %}
7 |
8 |
--------------------------------------------------------------------------------
/test/bootstrap-no-posts/_plugins/loader.rb:
--------------------------------------------------------------------------------
1 | require '../_ink_plugins/bootstrap/plugin.rb'
2 | require '../_ink_plugins/bootstrap-theme/plugin.rb'
3 |
--------------------------------------------------------------------------------
/test/bootstrap-no-posts/index.html:
--------------------------------------------------------------------------------
1 | just this page should exist
2 |
--------------------------------------------------------------------------------
/test/bootstrap/_config.yml:
--------------------------------------------------------------------------------
1 | name: Some Jekyll Site
2 | category_labels:
3 | awesome: Totally Sweet
4 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/2015/02/27/link-post-de.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/archive/index.html:
--------------------------------------------------------------------------------
1 | From Bootstrap (Override):
2 | Archive
3 |
4 | Another Link Post
5 | A Link Post
6 | Another Test Post
7 | Test Post
8 |
9 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/awesome/2014/02/01/test-post.html:
--------------------------------------------------------------------------------
1 | Test post strong emphasized some link
2 |
3 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/categories/awesome/index.html:
--------------------------------------------------------------------------------
1 | Posts in Awesome -
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/categories/cool/index.html:
--------------------------------------------------------------------------------
1 | Posts in Cool -
2 | A Link Post - en
3 | Another Test Post - en
4 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/category_tag_test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Cool
8 |
9 | Sweet
10 |
11 |
12 | Cool
13 |
14 | Sweet
15 |
16 |
17 | Awesome
18 |
19 | Nice , Sweet
20 |
21 |
22 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/cool/2014/02/02/test-post-2.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/cool/2015/02/27/link-post.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/feed/categories/awesome/index.xml:
--------------------------------------------------------------------------------
1 | Posts in Awesome -
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/feed/categories/cool/index.xml:
--------------------------------------------------------------------------------
1 | Posts in Cool -
2 | A Link Post - en
3 | Another Test Post - en
4 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/feed/index.xml:
--------------------------------------------------------------------------------
1 | From Theme:
2 | Posts -
3 | Another Link Post - de
4 | A Link Post - en
5 | Another Test Post - en
6 | Test Post - de
7 |
8 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/feed/tags/nice/index.xml:
--------------------------------------------------------------------------------
1 | Posts tagged with Nice -
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/feed/tags/sweet/index.xml:
--------------------------------------------------------------------------------
1 | Posts tagged with Sweet -
2 | A Link Post - en
3 | Another Test Post - en
4 | Test Post - de
5 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/index.html:
--------------------------------------------------------------------------------
1 | From Theme:
2 | Posts -
3 | Another Link Post - de
4 | A Link Post - en
5 | Another Test Post - en
6 | Test Post - de
7 |
8 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/tags/nice/index.html:
--------------------------------------------------------------------------------
1 | Posts tagged with Nice -
2 | Test Post - de
3 |
--------------------------------------------------------------------------------
/test/bootstrap/_expected/tags/sweet/index.html:
--------------------------------------------------------------------------------
1 | Posts tagged with Sweet -
2 | A Link Post - en
3 | Another Test Post - en
4 | Test Post - de
5 |
--------------------------------------------------------------------------------
/test/bootstrap/_plugins/bootstrap/config.yml:
--------------------------------------------------------------------------------
1 | category_feeds: true
2 | category_indexes: true
3 | tag_feeds: true
4 | tag_indexes: true
5 |
--------------------------------------------------------------------------------
/test/bootstrap/_plugins/bootstrap/config_de.yml:
--------------------------------------------------------------------------------
1 | titles:
2 | post_index: Posts - awesome
3 | post_archive: Archivieren - (:lang_name)
4 | permalinks:
5 | post_archive: /:lang/archivieren/
6 |
--------------------------------------------------------------------------------
/test/bootstrap/_plugins/bootstrap/templates/post_archive.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | From Bootstrap (Override):
4 | {{ page.title }}
5 | {% for post in site.posts %}
6 | {{ post.title }}{% endfor %}
7 |
8 |
--------------------------------------------------------------------------------
/test/bootstrap/_plugins/loader.rb:
--------------------------------------------------------------------------------
1 | require '../_ink_plugins/bootstrap/plugin.rb'
2 | require '../_ink_plugins/bootstrap-theme/plugin.rb'
3 |
--------------------------------------------------------------------------------
/test/bootstrap/_posts:
--------------------------------------------------------------------------------
1 | ../_posts/
--------------------------------------------------------------------------------
/test/bootstrap/category_tag_test.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {% for post in site.posts %}
4 | {% category_links %}
5 | {% category_list %}
6 | {% tag_links %}
7 | {% tag_list %}
8 | {% endfor %}
9 |
--------------------------------------------------------------------------------
/test/multilingual/_config.yml:
--------------------------------------------------------------------------------
1 | lang: en
2 |
--------------------------------------------------------------------------------
/test/multilingual/_expected/de/2015/02/27/link-post-de.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/multilingual/_expected/de/awesome/2014/02/01/test-post.html:
--------------------------------------------------------------------------------
1 | Test post strong emphasized some link
2 |
3 |
--------------------------------------------------------------------------------
/test/multilingual/_expected/en/cool/2014/02/02/test-post-2.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/multilingual/_expected/en/cool/2015/02/27/link-post.html:
--------------------------------------------------------------------------------
1 | some random post
2 | relative link
3 |
--------------------------------------------------------------------------------
/test/multilingual/_expected/lang/deutsch.html:
--------------------------------------------------------------------------------
1 | Deutsch titel
2 |
--------------------------------------------------------------------------------
/test/multilingual/_expected/lang/english.html:
--------------------------------------------------------------------------------
1 | Main language title
2 |
--------------------------------------------------------------------------------
/test/multilingual/_expected/lang/espanol.html:
--------------------------------------------------------------------------------
1 | Main language title
2 |
--------------------------------------------------------------------------------
/test/multilingual/_expected/lang/italiano.html:
--------------------------------------------------------------------------------
1 | Italiano titolo
2 |
--------------------------------------------------------------------------------
/test/multilingual/_includes/lang-test.html:
--------------------------------------------------------------------------------
1 | {{ plugins.lang-test.title }}
2 |
--------------------------------------------------------------------------------
/test/multilingual/_plugins/lang-test/config_de.yml:
--------------------------------------------------------------------------------
1 | title: Deutsch titel
2 |
--------------------------------------------------------------------------------
/test/multilingual/_plugins/lang-test/config_it.yml:
--------------------------------------------------------------------------------
1 | title: Italiano titolo
2 |
--------------------------------------------------------------------------------
/test/multilingual/_plugins/loader.rb:
--------------------------------------------------------------------------------
1 | require '../_ink_plugins/lang-test/plugin.rb'
2 |
--------------------------------------------------------------------------------
/test/multilingual/_posts:
--------------------------------------------------------------------------------
1 | ../_posts
--------------------------------------------------------------------------------
/test/multilingual/lang/deutsch.html:
--------------------------------------------------------------------------------
1 | ---
2 | lang: de
3 | ---
4 | {% include lang-test.html %}
5 |
--------------------------------------------------------------------------------
/test/multilingual/lang/english.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {% include lang-test.html %}
4 |
--------------------------------------------------------------------------------
/test/multilingual/lang/espanol.html:
--------------------------------------------------------------------------------
1 | ---
2 | lang: es
3 | ---
4 | {% include lang-test.html %}
5 |
--------------------------------------------------------------------------------
/test/multilingual/lang/italiano.html:
--------------------------------------------------------------------------------
1 | ---
2 | lang: it
3 | ---
4 | {% include lang-test.html %}
5 |
--------------------------------------------------------------------------------
/test/standard/_async_css.yml:
--------------------------------------------------------------------------------
1 | asset_pipeline:
2 | async_css: true
3 |
--------------------------------------------------------------------------------
/test/standard/_combine_false.yml:
--------------------------------------------------------------------------------
1 | asset_pipeline:
2 | combine_css: false
3 | combine_js: false
4 | compress_css: false
5 | uglify_js: false
6 |
--------------------------------------------------------------------------------
/test/standard/_compress_false.yml:
--------------------------------------------------------------------------------
1 | asset_pipeline:
2 | compress_css: false
3 | compress_js: false
4 |
--------------------------------------------------------------------------------
/test/standard/_config.yml:
--------------------------------------------------------------------------------
1 | include_test: foo.html
2 | url: http://octopress.org
3 | timezone: America/Chicago
4 | markdown: redcarpet
5 | name: Your New Jekyll Site
6 | gems:
7 | - octopress-ink
8 |
--------------------------------------------------------------------------------
/test/standard/_configure_asset_destination.yml:
--------------------------------------------------------------------------------
1 | asset_pipeline:
2 | javascripts_destination: js
3 | stylesheets_destination: css
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/async_css/asset_tag.html:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/asset_tag.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/javascripts/theme/bar.js:
--------------------------------------------------------------------------------
1 | console.log('bar')
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/javascripts/theme/blah.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | console.log('dang');
3 |
4 | }).call(this);
5 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/javascripts/theme/foo.js:
--------------------------------------------------------------------------------
1 | console.log('omg')
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/javascripts/theme/jq.min.js:
--------------------------------------------------------------------------------
1 | console.log("this should not be minifed")
2 | //There should be
3 |
4 | //A space there ^
5 |
6 | // and there
7 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/stylesheets/awesome-sauce/plugin-media-test-print.css:
--------------------------------------------------------------------------------
1 | article a:after {
2 | content: attr(href);
3 | }
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/stylesheets/awesome-sauce/plugin-test.css:
--------------------------------------------------------------------------------
1 | .plugin-widget {
2 | background: red;
3 | color: #fff;
4 | }
5 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/stylesheets/theme/main.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: #bcbcbc; }
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/stylesheets/theme/theme-media-test-print.css:
--------------------------------------------------------------------------------
1 | * { background: none; color: #000; }
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/stylesheets/theme/theme-test.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 2px;
3 | padding: 2px;
4 | }
5 |
--------------------------------------------------------------------------------
/test/standard/_expected/combine_false/stylesheets/theme/theme-test2.css:
--------------------------------------------------------------------------------
1 | .main {
2 | color: #444;
3 | }
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/compress_false/javascripts/all-.js:
--------------------------------------------------------------------------------
1 | /* Theme: Classic Theme */
2 | console.log('bar')
3 | console.log('omg')
4 | console.log("this should not be minifed")
5 | //There should be
6 |
7 | //A space there ^
8 |
9 | // and there
10 | (function() {
11 | console.log('dang');
12 |
13 | }).call(this);
14 |
--------------------------------------------------------------------------------
/test/standard/_expected/compress_false/stylesheets/all-.css:
--------------------------------------------------------------------------------
1 | /* Theme: Classic Theme */
2 | body {
3 | margin: 2px;
4 | padding: 2px; }
5 |
6 | .main {
7 | color: #444; }
8 |
9 | body {
10 | background: #bcbcbc; }
11 |
12 | /* Plugin: Awesome Sauce */
13 | .plugin-widget {
14 | background: red;
15 | color: #fff; }
16 |
--------------------------------------------------------------------------------
/test/standard/_expected/compress_false/stylesheets/print-.css:
--------------------------------------------------------------------------------
1 | /* Theme: Classic Theme */
2 | * {
3 | background: none;
4 | color: #000; }
5 |
6 | /* Plugin: Awesome Sauce */
7 | article a:after {
8 | content: attr(href); }
9 |
--------------------------------------------------------------------------------
/test/standard/_expected/configure_asset_destination/asset_tag.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/configure_asset_destination/css/all-.css:
--------------------------------------------------------------------------------
1 | body{margin:2px;padding:2px}.main{color:#444}body{background:#bcbcbc}.plugin-widget{background:red;color:#fff}
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/configure_asset_destination/css/print-.css:
--------------------------------------------------------------------------------
1 | *{background:none;color:#000}article a:after{content:attr(href)}
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/configure_asset_destination/js/all-.js:
--------------------------------------------------------------------------------
1 | /* Theme: Classic Theme */
2 | console.log("bar");console.log("omg");console.log("this should not be minifed")
3 | //There should be
4 |
5 | //A space there ^
6 |
7 | // and there
8 | (function(){console.log("dang")}).call(this);
--------------------------------------------------------------------------------
/test/standard/_expected/copy_layouts_pages/layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ page.title }}
7 |
8 |
9 |
10 | {{ content }}
11 |
12 |
13 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_layouts_pages/layouts/test.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | ---
4 | {{ content }}
5 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_layouts_pages/pages/disable-test.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | This page shouldn't appear
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_layouts_pages/pages/four.xml:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /four/
3 | ---
4 |
5 | This page is totally a thing.
6 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_layouts_pages/pages/one.xml:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /test_pages/feed/
3 | ---
4 | fooo
5 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_layouts_pages/pages/three.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | permalink: /test_pages/three.html
4 | ---
5 |
6 | SUB BABY
7 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_layouts_pages/pages/two.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | ---
4 |
5 | Testing pages. **strong** *emphasized* [a link](http://example.com)
6 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/config.yml:
--------------------------------------------------------------------------------
1 | test: config from theme
2 | test_override: also config from theme
3 |
4 | sass:
5 | import: partials/colors
6 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/files/disabled-file.txt:
--------------------------------------------------------------------------------
1 | some stupid file that shouldn't
2 | exist
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/files/favicon.ico:
--------------------------------------------------------------------------------
1 | default favicon
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/files/favicon.png:
--------------------------------------------------------------------------------
1 | some favicon
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/files/test.html:
--------------------------------------------------------------------------------
1 | testing theme/files assets
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/fonts/font-one.otf:
--------------------------------------------------------------------------------
1 | not a font
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/fonts/font-two.ttf:
--------------------------------------------------------------------------------
1 | such font. very kern.
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/includes/bar.html:
--------------------------------------------------------------------------------
1 | include from theme
2 |
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/includes/greet.html:
--------------------------------------------------------------------------------
1 | {{ include.greeting }}, I heard you like includes.
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/javascripts/bar.js:
--------------------------------------------------------------------------------
1 | console.log('bar')
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/javascripts/blah.coffee:
--------------------------------------------------------------------------------
1 | console.log 'dang'
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/javascripts/disable-this.js:
--------------------------------------------------------------------------------
1 | console.log('omgwtfbbq!!!11one')
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/javascripts/foo.js:
--------------------------------------------------------------------------------
1 | console.log('omg')
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/javascripts/jq.min.js:
--------------------------------------------------------------------------------
1 | console.log("this should not be minifed")
2 | //There should be
3 |
4 | //A space there ^
5 |
6 | // and there
7 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ page.title }}
7 |
8 |
9 |
10 | {{ content }}
11 |
12 |
13 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/layouts/test.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | ---
4 | {{ content }}
5 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/pages/disable-test.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | This page shouldn't appear
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/pages/four.xml:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /four/
3 | ---
4 |
5 | This page is totally a thing.
6 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/pages/one.xml:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /test_pages/feed/
3 | ---
4 | fooo
5 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/pages/three.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | permalink: /test_pages/three.html
4 | ---
5 |
6 | SUB BABY
7 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/pages/two.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | ---
4 |
5 | Testing pages. **strong** *emphasized* [a link](http://example.com)
6 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/stylesheets/disable-this.css:
--------------------------------------------------------------------------------
1 | .do-not-exist { background: #bcbcbc; }
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/stylesheets/disable.sass:
--------------------------------------------------------------------------------
1 | .do-not-exist
2 | background: #f00
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/stylesheets/main.scss:
--------------------------------------------------------------------------------
1 | ---
2 | property: background
3 | ---
4 | @import '{{ theme.sass.import }}';
5 | body { {{ page.property }}: $bg; }
6 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/stylesheets/partials/_colors.scss:
--------------------------------------------------------------------------------
1 | $bg: white;
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/stylesheets/theme-media-test@print.css:
--------------------------------------------------------------------------------
1 | * { background: none; color: #000; }
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/stylesheets/theme-test.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | }
5 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/stylesheets/theme-test2.css:
--------------------------------------------------------------------------------
1 | .main {
2 | color: #444;
3 | }
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/templates/post_index.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | From Theme:
4 | {{ page.title }}
5 | {% for post in site.posts %}
6 | {{ post.title }}{% endfor %}
7 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/templates/template-override-test.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {{ page.title }}
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/copy_test/templates/template-test.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {{ page.title }}
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/order_assets/asset_tag.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/order_assets/javascripts/all-.js:
--------------------------------------------------------------------------------
1 | /* Theme: Classic Theme */
2 | console.log("omg");console.log("this should not be minifed")
3 | //There should be
4 |
5 | //A space there ^
6 |
7 | // and there
8 | (function(){console.log("dang")}).call(this);console.log("bar");
--------------------------------------------------------------------------------
/test/standard/_expected/order_assets/stylesheets/all-.css:
--------------------------------------------------------------------------------
1 | body{margin:2px;padding:2px}body{background:#bcbcbc}.main{color:#444}.plugin-widget{background:red;color:#fff}
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/order_assets/stylesheets/print-.css:
--------------------------------------------------------------------------------
1 | *{background:none;color:#000}article a:after{content:attr(href)}
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/asset_tag.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/config-test.html:
--------------------------------------------------------------------------------
1 | working -> working
2 | config from plugin <-- Get plugin config?
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/dir/d.html:
--------------------------------------------------------------------------------
1 | This page has no permalink :)
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/favicon.ico:
--------------------------------------------------------------------------------
1 | default favicon
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/favicon.png:
--------------------------------------------------------------------------------
1 | override favicon
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/fonts/awesome-sauce/foo.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/octopress/ink/7a3a796b63d361f6f60bf516dba099664e11fd80/test/standard/_expected/standard/fonts/awesome-sauce/foo.otf
--------------------------------------------------------------------------------
/test/standard/_expected/standard/four/index.xml:
--------------------------------------------------------------------------------
1 | This page is totally a thing.
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/javascripts/all-.js:
--------------------------------------------------------------------------------
1 | /* Theme: Classic Theme */
2 | console.log("bar");console.log("omg");console.log("this should not be minifed")
3 | //There should be
4 |
5 | //A space there ^
6 |
7 | // and there
8 | (function(){console.log("dang")}).call(this);
--------------------------------------------------------------------------------
/test/standard/_expected/standard/robots.txt:
--------------------------------------------------------------------------------
1 | I like robots
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/stylesheets/all-.css:
--------------------------------------------------------------------------------
1 | body{margin:2px;padding:2px}.main{color:#444}body{background:#bcbcbc}.plugin-widget{background:red;color:#fff}
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/stylesheets/print-.css:
--------------------------------------------------------------------------------
1 | *{background:none;color:#000}article a:after{content:attr(href)}
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/template-test/index.html:
--------------------------------------------------------------------------------
1 | Awesome!
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/template-test/override.html:
--------------------------------------------------------------------------------
1 | Crash Override Boom!
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test.html:
--------------------------------------------------------------------------------
1 | testing theme/files assets
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_config/plugin_config.html:
--------------------------------------------------------------------------------
1 | config from plugin
2 | config from plugin override
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_config/theme_config.html:
--------------------------------------------------------------------------------
1 | config from theme
2 | config from theme override
3 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_layouts/local.html:
--------------------------------------------------------------------------------
1 | Testing a local layout
2 | Load a standard layout
3 |
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_layouts/plugin_layout.html:
--------------------------------------------------------------------------------
1 | The awesome-sauce plugin layout
2 | Load a layout from the awesome-sauce plugin
3 |
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_layouts/test_markdown.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | strong emphasized a link
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_layouts/theme.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Load a theme layout
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_layouts/theme_override.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Load a layout from the theme override
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_pages/c.html:
--------------------------------------------------------------------------------
1 | This is page C.
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_pages/feed/index.xml:
--------------------------------------------------------------------------------
1 | fooo
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_pages/include-subdir.html:
--------------------------------------------------------------------------------
1 | Why, hello there!
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_pages/plugin_page.html:
--------------------------------------------------------------------------------
1 | Page two from plugin
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_pages/plugin_page_override.html:
--------------------------------------------------------------------------------
1 | This page should not be overwritten by the plugin page.
2 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_pages/theme_page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Testing pages. strong emphasized a link
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test/standard/_expected/standard/test_pages/three.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | SUB BABY
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test/standard/_expected/test-theme/.gitignore:
--------------------------------------------------------------------------------
1 | /.bundle/
2 | /.yardoc
3 | /Gemfile.lock
4 | /_yardoc/
5 | /coverage/
6 | /doc/
7 | /pkg/
8 | /spec/reports/
9 | /tmp/
10 | .*-cache
11 | _site
12 |
--------------------------------------------------------------------------------
/test/standard/_expected/test-theme/.travis.yml:
--------------------------------------------------------------------------------
1 | language: ruby
2 | rvm:
3 | - 2.1.2
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/test-theme/lib/test-theme.rb:
--------------------------------------------------------------------------------
1 | require 'test-theme/version'
2 | require 'octopress-ink'
3 |
4 | Octopress::Ink.add_theme({
5 | name: "Test Theme",
6 | slug: "theme",
7 | gem: "test-theme",
8 | path: File.expand_path(File.join(File.dirname(__FILE__), "..")),
9 | version: TestTheme::VERSION,
10 | description: "", # What does your theme/plugin do?
11 | source_url: "https://github.com/user/project", # <- Update info
12 | website: "" # Optional project website
13 | })
14 |
--------------------------------------------------------------------------------
/test/standard/_expected/test-theme/lib/test-theme/version.rb:
--------------------------------------------------------------------------------
1 | module TestTheme
2 | VERSION = "0.1.0"
3 | end
4 |
--------------------------------------------------------------------------------
/test/standard/_expected/uglify_js_false/all-.js:
--------------------------------------------------------------------------------
1 | /* Theme: Classic Theme */
2 | console.log('bar')
3 | console.log('omg')
4 | (function() {
5 | console.log('dang');
6 |
7 | }).call(this);
8 |
--------------------------------------------------------------------------------
/test/standard/_includes/foo.html:
--------------------------------------------------------------------------------
1 | Testing Include {{ include.some_var }}
2 |
--------------------------------------------------------------------------------
/test/standard/_includes/post_data.html:
--------------------------------------------------------------------------------
1 | title: {{ post.title }}
2 | title text: {{ post.title_text }}
3 | title html: {{ post.title_html }}
4 | title url: {{ post.title_url }}
5 | linkpost: {{ post.linkpost }}
6 |
7 | date: {{ post.date }}
8 | date_xml: {{ post.date_xml }}
9 | date_html: {{ post.date_html }}
10 |
11 | content: {{ post.content }}
12 |
--------------------------------------------------------------------------------
/test/standard/_layouts/head.html:
--------------------------------------------------------------------------------
1 | {% yield head %}
2 |
--------------------------------------------------------------------------------
/test/standard/_layouts/local.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | Testing a local layout
4 | {{ content }}
5 |
--------------------------------------------------------------------------------
/test/standard/_order_assets.yml:
--------------------------------------------------------------------------------
1 | order_js:
2 | - foo.js
3 | - jq.min.js
4 | - blah.coffee
5 |
6 | order_css:
7 | - theme-test.css
8 | - main.scss
9 |
10 | disable:
11 | stylesheets: disable-this.css
12 | sass: disable.sass
13 | javascripts: disable-this.js
14 |
--------------------------------------------------------------------------------
/test/standard/_plugins/awesome-sauce/config.yml:
--------------------------------------------------------------------------------
1 | test_override: config from plugin override
2 | permalinks:
3 | a: /test_pages/plugin_page_override.html
4 | b: /test_pages/plugin_page.html
5 | dir/c.html: /test_pages/c.html
6 |
--------------------------------------------------------------------------------
/test/standard/_plugins/loader.rb:
--------------------------------------------------------------------------------
1 | require '../_ink_plugins/test-theme/plugin.rb'
2 | require '../_ink_plugins/awesome-sauce/plugin.rb'
3 |
--------------------------------------------------------------------------------
/test/standard/_plugins/theme/config.yml:
--------------------------------------------------------------------------------
1 | test_override: config from theme override
2 | permalinks:
3 | two: /test_pages/theme_page.html
4 | feed: /test_pages/feed/
5 |
6 | disable:
7 | fonts: true
8 | stylesheets: disable-this.css
9 | sass: disable.sass
10 | pages:
11 | - disable-test.html
12 | - test_pages/disable-test.html
13 | files: disabled-file.txt
14 | javascripts: disable-this.js
15 |
--------------------------------------------------------------------------------
/test/standard/_plugins/theme/includes/bar.html:
--------------------------------------------------------------------------------
1 | include from theme override
2 |
3 |
--------------------------------------------------------------------------------
/test/standard/_plugins/theme/layouts/test.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | ---
4 | {{ content }}
5 |
--------------------------------------------------------------------------------
/test/standard/_plugins/theme/stylesheets/partials/_colors.sass:
--------------------------------------------------------------------------------
1 | $bg: #bcbcbc
2 |
--------------------------------------------------------------------------------
/test/standard/_plugins/theme/stylesheets/theme-test.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 2px;
3 | padding: 2px;
4 | }
5 |
--------------------------------------------------------------------------------
/test/standard/_plugins/theme/templates/template-override-test.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {{ page.title }} Boom!
4 |
--------------------------------------------------------------------------------
/test/standard/asset_tag.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {% css_asset_tag %}
4 | {% js_asset_tag %}
5 |
--------------------------------------------------------------------------------
/test/standard/favicon.png:
--------------------------------------------------------------------------------
1 | override favicon
2 |
--------------------------------------------------------------------------------
/test/standard/test_config/plugin_config.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {{ plugins.awesome-sauce.test }}
4 | {{ plugins.awesome-sauce.test_override }}
5 |
--------------------------------------------------------------------------------
/test/standard/test_config/theme_config.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {{ theme.test }}
4 | {{ theme.test_override }}
5 |
--------------------------------------------------------------------------------
/test/standard/test_layouts/local.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: local
3 | ---
4 | Load a standard layout
5 |
--------------------------------------------------------------------------------
/test/standard/test_layouts/plugin_layout.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: awesome-sauce:test-layout
3 | ---
4 | Load a layout from the awesome-sauce plugin
5 |
--------------------------------------------------------------------------------
/test/standard/test_layouts/test_markdown.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | ---
4 | **strong** *emphasized* [a link](http://example.com)
5 |
6 |
--------------------------------------------------------------------------------
/test/standard/test_layouts/theme.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:default
3 | ---
4 | Load a theme layout
5 |
--------------------------------------------------------------------------------
/test/standard/test_layouts/theme_override.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: theme:test
3 | ---
4 | Load a layout from the theme override
5 |
--------------------------------------------------------------------------------
/test/standard/test_pages/include-subdir.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | {% include awesome-sauce:dir/other-include.html %}
4 |
--------------------------------------------------------------------------------
/test/standard/test_pages/plugin_page_override.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 | This page should not be overwritten by the plugin page.
4 |
--------------------------------------------------------------------------------