bloggit 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History +4 -0
- data/Manifest +422 -0
- data/Rakefile +64 -0
- data/ReadMe +69 -0
- data/Todo +26 -0
- data/bin/bloggit +5 -0
- data/docs/index.html +57 -0
- data/docs/specifications.html +100 -0
- data/docs/src/_layout.rhtml +53 -0
- data/docs/src/index.markdown +5 -0
- data/docs/src/specifications.markdown +48 -0
- data/lib/bloggit.rb +28 -0
- data/lib/bloggit/boilerplate/Rakefile +2 -0
- data/lib/bloggit/boilerplate/pages/about.page +5 -0
- data/lib/bloggit/boilerplate/plugins/haloscan/init.rb +5 -0
- data/lib/bloggit/boilerplate/settings.yml +28 -0
- data/lib/bloggit/boilerplate/themes/default/styles/main.css +145 -0
- data/lib/bloggit/boilerplate/themes/default/templates/archive.rhtml +20 -0
- data/lib/bloggit/boilerplate/themes/default/templates/home.rhtml +6 -0
- data/lib/bloggit/boilerplate/themes/default/templates/layouts/main.rhtml +15 -0
- data/lib/bloggit/boilerplate/themes/default/templates/layouts/two-columns.rhtml +21 -0
- data/lib/bloggit/boilerplate/themes/default/templates/page.rhtml +8 -0
- data/lib/bloggit/boilerplate/themes/default/templates/post.rhtml +3 -0
- data/lib/bloggit/boilerplate/themes/default/templates/snippets/blog_entry.rhtml +16 -0
- data/lib/bloggit/boilerplate/themes/default/templates/snippets/navigation.rhtml +12 -0
- data/lib/bloggit/boilerplate/themes/default/templates/snippets/tag_list.rhtml +9 -0
- data/lib/bloggit/boilerplate/themes/default/templates/tag_archive.rhtml +38 -0
- data/lib/bloggit/checksum.rb +39 -0
- data/lib/bloggit/client/index.html +2 -0
- data/lib/bloggit/client/scripts/adapter/jquery/ext-jquery-adapter.js +12 -0
- data/lib/bloggit/client/scripts/adapter/jquery/jquery-plugins.js +965 -0
- data/lib/bloggit/client/scripts/adapter/jquery/jquery.js +2201 -0
- data/lib/bloggit/client/scripts/adapter/prototype/effects.js +1098 -0
- data/lib/bloggit/client/scripts/adapter/prototype/ext-prototype-adapter.js +12 -0
- data/lib/bloggit/client/scripts/adapter/prototype/prototype.js +2523 -0
- data/lib/bloggit/client/scripts/adapter/prototype/scriptaculous.js +59 -0
- data/lib/bloggit/client/scripts/adapter/yui/ext-yui-adapter.js +12 -0
- data/lib/bloggit/client/scripts/adapter/yui/yui-utilities.js +18 -0
- data/lib/bloggit/client/scripts/app.js +121 -0
- data/lib/bloggit/client/scripts/ext-all.js +256 -0
- data/lib/bloggit/client/scripts/resources/css/README.txt +3 -0
- data/lib/bloggit/client/scripts/resources/css/basic-dialog.css +286 -0
- data/lib/bloggit/client/scripts/resources/css/box.css +111 -0
- data/lib/bloggit/client/scripts/resources/css/button.css +148 -0
- data/lib/bloggit/client/scripts/resources/css/combo.css +46 -0
- data/lib/bloggit/client/scripts/resources/css/core.css +290 -0
- data/lib/bloggit/client/scripts/resources/css/date-picker.css +155 -0
- data/lib/bloggit/client/scripts/resources/css/dd.css +61 -0
- data/lib/bloggit/client/scripts/resources/css/debug.css +55 -0
- data/lib/bloggit/client/scripts/resources/css/ext-all.css +3167 -0
- data/lib/bloggit/client/scripts/resources/css/form.css +359 -0
- data/lib/bloggit/client/scripts/resources/css/grid.css +295 -0
- data/lib/bloggit/client/scripts/resources/css/layout.css +252 -0
- data/lib/bloggit/client/scripts/resources/css/menu.css +116 -0
- data/lib/bloggit/client/scripts/resources/css/panel.css +258 -0
- data/lib/bloggit/client/scripts/resources/css/qtips.css +119 -0
- data/lib/bloggit/client/scripts/resources/css/reset-min.css +9 -0
- data/lib/bloggit/client/scripts/resources/css/resizable.css +143 -0
- data/lib/bloggit/client/scripts/resources/css/tabs.css +134 -0
- data/lib/bloggit/client/scripts/resources/css/toolbar.css +160 -0
- data/lib/bloggit/client/scripts/resources/css/tree.css +179 -0
- data/lib/bloggit/client/scripts/resources/css/window.css +155 -0
- data/lib/bloggit/client/scripts/resources/css/ytheme-aero.css +581 -0
- data/lib/bloggit/client/scripts/resources/css/ytheme-gray.css +438 -0
- data/lib/bloggit/client/scripts/resources/css/ytheme-vista.css +511 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/aero-close-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/aero-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-center.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-left.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-right.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/collapse-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/expand-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/w-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-blue-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-hrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-vista-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/pspbrwse.jbf +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/sort-col-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/sort_asc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/sort_desc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-bg.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-btm-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/toolbar/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/btn-arrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/progress.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/progress2.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/corners-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/corners.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/l-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/l.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/r-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/r.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/tb-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/tb.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/dd/drop-add.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/dd/drop-no.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/dd/drop-yes.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/date-trigger.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/error-tip-corners.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/exclamation.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/text-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/trigger.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/Thumbs.db +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/arrow-left-white.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/arrow-right-white.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/col-move-bottom.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/col-move-top.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/dirty.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/done.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/drop-no.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/drop-yes.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/footer-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-blue-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-blue-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-hrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-loading.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-vista-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hd-pop.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-asc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-desc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-lock.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-lock.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-unlock.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-unlock.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/invalid_line.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/loading.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/mso-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/nowait.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-first-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-first.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-last-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-last.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-next-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-next.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-prev-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-prev.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/pick-button.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/refresh.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/sort_asc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/sort_desc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/wait.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/stick.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/stuck.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/group-checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/menu-parent.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/menu.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/unchecked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/qtip/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/qtip/tip-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shadow-c.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shadow-lr.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shadow.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/calendar.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/left-btn.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/right-btn.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/warning.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/square.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-arrow-light.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-arrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-over-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/gray-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/tb-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-add.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-between.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-no.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-under.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-yes.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-minus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-minus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-plus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-plus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-line.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-minus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-minus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-plus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-plus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/folder-open.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/folder.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/leaf.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/loading.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/dlg-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/grid/grid-hrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/stick.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/group-checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/menu-parent.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/menu.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/unchecked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/qtip/tip-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/toolbar/gray-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-center.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-left.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-right.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/dlg-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/w-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/grid/grid-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/grid/grid-vista-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/stick.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/qtip/tip-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/toolbar/gray-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/license.txt +25 -0
- data/lib/bloggit/client/scripts/resources/raw-images/shadow.psd +0 -0
- data/lib/bloggit/client/scripts/resources/resources.jsb +522 -0
- data/lib/bloggit/client/templates/json.rhtml +5 -0
- data/lib/bloggit/client/templates/main.rhtml +109 -0
- data/lib/bloggit/commandline.rb +52 -0
- data/lib/bloggit/commands/page_cmd.rb +17 -0
- data/lib/bloggit/commands/plugin_cmd.rb +89 -0
- data/lib/bloggit/commands/post_cmd.rb +17 -0
- data/lib/bloggit/commands/site_cmd.rb +82 -0
- data/lib/bloggit/commands/theme_cmd.rb +16 -0
- data/lib/bloggit/etc/hash.rb +24 -0
- data/lib/bloggit/etc/string.rb +5 -0
- data/lib/bloggit/generator.rb +331 -0
- data/lib/bloggit/hooks.rb +21 -0
- data/lib/bloggit/media.rb +40 -0
- data/lib/bloggit/page.rb +98 -0
- data/lib/bloggit/plugin.rb +52 -0
- data/lib/bloggit/post.rb +169 -0
- data/lib/bloggit/publisher.rb +115 -0
- data/lib/bloggit/server.rb +102 -0
- data/lib/bloggit/site.rb +183 -0
- data/lib/bloggit/tag.rb +61 -0
- data/lib/bloggit/tasks/client.rb +9 -0
- data/lib/bloggit/tasks/publishing.rb +36 -0
- data/lib/bloggit/tasks/scm.rb +78 -0
- data/lib/bloggit/tasks/specs.rb +128 -0
- data/lib/bloggit/template.rb +334 -0
- data/lib/bloggit/text_formatter.rb +50 -0
- data/lib/util/fixed_hoe.rb +553 -0
- data/test/fixtures/test.blog/Rakefile +7 -0
- data/test/fixtures/test.blog/pages/about.page +7 -0
- data/test/fixtures/test.blog/pages/coming-soon.page +3 -0
- data/test/fixtures/test.blog/pages/todo.page +23 -0
- data/test/fixtures/test.blog/plugins/example/init.rb +69 -0
- data/test/fixtures/test.blog/plugins/haloscan/init.rb +25 -0
- data/test/fixtures/test.blog/plugins/js_search/init.rb +51 -0
- data/test/fixtures/test.blog/plugins/rdoc_formatter/init.rb +14 -0
- data/test/fixtures/test.blog/posts/2004.03.07_to-boldly-go.post +11 -0
- data/test/fixtures/test.blog/posts/2007.03.25_sure-whatever.post +10 -0
- data/test/fixtures/test.blog/posts/2007.03.27_rdoc-anyone.post +13 -0
- data/test/fixtures/test.blog/posts/2010.12.07_35-already.post +5 -0
- data/test/fixtures/test.blog/settings.yml +34 -0
- data/test/fixtures/test.blog/themes/default/styles/main.css +145 -0
- data/test/fixtures/test.blog/themes/default/templates/archive.rhtml +22 -0
- data/test/fixtures/test.blog/themes/default/templates/home.rhtml +9 -0
- data/test/fixtures/test.blog/themes/default/templates/layouts/main.rhtml +17 -0
- data/test/fixtures/test.blog/themes/default/templates/layouts/two-columns.rhtml +21 -0
- data/test/fixtures/test.blog/themes/default/templates/page.rhtml +8 -0
- data/test/fixtures/test.blog/themes/default/templates/post.rhtml +15 -0
- data/test/fixtures/test.blog/themes/default/templates/snippets/blog_entry.rhtml +10 -0
- data/test/fixtures/test.blog/themes/default/templates/snippets/navigation.rhtml +12 -0
- data/test/fixtures/test.blog/themes/default/templates/snippets/tag_list.rhtml +9 -0
- data/test/fixtures/test.blog/themes/default/templates/tag_archive.rhtml +41 -0
- data/test/helpers.rb +25 -0
- data/test/unit/bloggit_test.rb +9 -0
- data/test/unit/page_test.rb +28 -0
- data/test/unit/post_test.rb +36 -0
- data/test/unit/site_test.rb +27 -0
- data/test/unit/template_test.rb +21 -0
- data/test/unit/text_formatter_test.rb +43 -0
- metadata +520 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title><%= site.title %> :: Bloggit</title>
|
|
4
|
+
<style>
|
|
5
|
+
HTML, BODY {
|
|
6
|
+
font: normal 12px Verdana;
|
|
7
|
+
margin: 0; padding: 0;
|
|
8
|
+
border: 0 none;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
height: 100%;
|
|
11
|
+
}
|
|
12
|
+
</style>
|
|
13
|
+
<link rel="stylesheet" type="text/css" href="/scripts/resources/css/ext-all.css" />
|
|
14
|
+
<script type="text/javascript" src="/scripts/adapter/jquery/jquery.js"></script>
|
|
15
|
+
<script type="text/javascript" src="/scripts/adapter/jquery/jquery-plugins.js"></script>
|
|
16
|
+
<script type="text/javascript" src="/scripts/adapter/jquery/ext-jquery-adapter.js"></script>
|
|
17
|
+
<script type="text/javascript" src="/scripts/ext-all.js"></script>
|
|
18
|
+
<script type="text/javascript" src="/scripts/app.js"></script>
|
|
19
|
+
<style>
|
|
20
|
+
.x-layout-panel-south, x-layout-panel-north {
|
|
21
|
+
background-color: #c9defa !important;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
24
|
+
</head>
|
|
25
|
+
<body>
|
|
26
|
+
<div id="container">
|
|
27
|
+
<div id="tab-pages">
|
|
28
|
+
<div id="pages-tb">
|
|
29
|
+
+ New Page,
|
|
30
|
+
- Delete (selected)
|
|
31
|
+
</div>
|
|
32
|
+
<div id="pages-grid">
|
|
33
|
+
Pages Grid
|
|
34
|
+
</div>
|
|
35
|
+
<div>Splitter?</div>
|
|
36
|
+
<div>Content Editor</div>
|
|
37
|
+
<div>Extra Info? (tags, title, slug, etc)</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div id="tab-posts">
|
|
40
|
+
<div id="posts-tb"></div>
|
|
41
|
+
<div id="posts-grid" style="height:500">
|
|
42
|
+
Posts Grid
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
Splitter?
|
|
46
|
+
</div>
|
|
47
|
+
<div>
|
|
48
|
+
Content Editor (title, slug, publish data, status, etc)
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div id="tab-themes">
|
|
52
|
+
<div id="themes-tb">
|
|
53
|
+
+ New Theme
|
|
54
|
+
</div>
|
|
55
|
+
<div>
|
|
56
|
+
Theme Tree
|
|
57
|
+
</div>
|
|
58
|
+
<div>
|
|
59
|
+
Theme Editor
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div id="tab-plugins">
|
|
63
|
+
<div id="plugins-tb">
|
|
64
|
+
+ New Plugin,
|
|
65
|
+
- Disable (selected)
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
Plugin Tree
|
|
69
|
+
</div>
|
|
70
|
+
<div>
|
|
71
|
+
Plugin Editor
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<div id="tab-media">
|
|
75
|
+
<div id="media-tb">
|
|
76
|
+
+ New Media,
|
|
77
|
+
- Delete (selected)
|
|
78
|
+
</div>
|
|
79
|
+
<div>
|
|
80
|
+
Media Tree View
|
|
81
|
+
</div>
|
|
82
|
+
<div>
|
|
83
|
+
Media Preview (?)
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<div id="tab-settings">
|
|
87
|
+
Settings
|
|
88
|
+
</div>
|
|
89
|
+
<div id="tab-preview">
|
|
90
|
+
<div id="preview-tb">
|
|
91
|
+
@ Refresh,
|
|
92
|
+
# Regenerate
|
|
93
|
+
</div>
|
|
94
|
+
<div>
|
|
95
|
+
Preview IFRAME
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<div id="site-header">
|
|
99
|
+
Bloggit <%= Bloggit::VERSION %>
|
|
100
|
+
</div>
|
|
101
|
+
<div id="home-page">
|
|
102
|
+
At your service, my dear.
|
|
103
|
+
</div>
|
|
104
|
+
<div id="status-bar">
|
|
105
|
+
Ready.
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</body>
|
|
109
|
+
</html>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'fileutils'
|
|
2
|
+
require 'cmdparse'
|
|
3
|
+
|
|
4
|
+
module Bloggit
|
|
5
|
+
module Cmdline
|
|
6
|
+
class << self
|
|
7
|
+
|
|
8
|
+
def commands
|
|
9
|
+
@commands ||= []
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
attr_accessor :verbose
|
|
13
|
+
|
|
14
|
+
def register(&block)
|
|
15
|
+
commands << block
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def build(cmd, site=nil)
|
|
19
|
+
commands.each do |block|
|
|
20
|
+
block.call(cmd, site)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def execute
|
|
25
|
+
cmd = CmdParse::CommandParser.new( true, true )
|
|
26
|
+
Bloggit::Cmdline.verbose = false
|
|
27
|
+
|
|
28
|
+
cmd.program_name = "bloggit"
|
|
29
|
+
cmd.program_version = Bloggit::RELEASE_INFO
|
|
30
|
+
|
|
31
|
+
cmd.options = CmdParse::OptionParserWrapper.new do |opt|
|
|
32
|
+
opt.separator "Global options:"
|
|
33
|
+
opt.on("--verbose", "Be verbose when outputting info") {|t| Bloggit::Cmdline.verbose = true }
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
#puts "Loading commands from #{File.join( File.dirname(__FILE__), 'commands', '*.rb')} (#{Bloggit::Cmdline.verbose})"
|
|
37
|
+
Dir[ File.join( File.dirname(__FILE__), 'commands', '*.rb') ].each do |command|
|
|
38
|
+
require command
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
site = Dir.getwd.ends_with?('.blog') ? Bloggit::Site.from_file(Dir.getwd) : nil
|
|
42
|
+
|
|
43
|
+
Cmdline.build( cmd, site )
|
|
44
|
+
|
|
45
|
+
cmd.add_command( CmdParse::HelpCommand.new )
|
|
46
|
+
cmd.add_command( CmdParse::VersionCommand.new )
|
|
47
|
+
|
|
48
|
+
cmd.parse
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Bloggit::Cmdline.register do |cmd, site|
|
|
2
|
+
unless site.nil?
|
|
3
|
+
|
|
4
|
+
page_cmd = CmdParse::Command.new( 'page', true, true )
|
|
5
|
+
page_cmd.short_desc = "Page Management"
|
|
6
|
+
cmd.add_command( page_cmd )
|
|
7
|
+
|
|
8
|
+
add_page = CmdParse::Command.new( 'new', false )
|
|
9
|
+
add_page.short_desc = "Create a new page"
|
|
10
|
+
add_page.set_execution_block do |args|
|
|
11
|
+
page = Bloggit::Page.to_file(args.to_s)
|
|
12
|
+
puts "#{page.filename} created."
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
page_cmd.add_command( add_page )
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Bloggit::Cmdline.register do |cmd, site|
|
|
2
|
+
unless site.nil?
|
|
3
|
+
|
|
4
|
+
plugin_cmd = CmdParse::Command.new( 'plugin', true, true )
|
|
5
|
+
plugin_cmd.short_desc = "Plugin Management"
|
|
6
|
+
cmd.add_command( plugin_cmd )
|
|
7
|
+
|
|
8
|
+
new_plugin = CmdParse::Command.new( 'new', false )
|
|
9
|
+
new_plugin.short_desc = "Create a new plugin"
|
|
10
|
+
new_plugin.set_execution_block do |args|
|
|
11
|
+
#page = Bloggit::Page.to_file(args.to_s)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
plugin_cmd.add_command( new_plugin )
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
PLUGIN_BOILERPLATE =<<EOF
|
|
19
|
+
# = Examples for creating your own plugins...
|
|
20
|
+
|
|
21
|
+
include Bloggit
|
|
22
|
+
|
|
23
|
+
# = Registering the plugin to retrieve settings from settings.yml
|
|
24
|
+
Plugin.register :example do |settings|
|
|
25
|
+
# this will read from the settings.yml under plugins.example
|
|
26
|
+
# $username = settings.fetch('username', '')
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# = Registering custom tags in the template engine
|
|
31
|
+
#
|
|
32
|
+
# This will register the tag `example` for use in any template page
|
|
33
|
+
# (including layouts). Example usage of this tag:
|
|
34
|
+
#
|
|
35
|
+
# <%= example :version %>
|
|
36
|
+
#
|
|
37
|
+
# Output:
|
|
38
|
+
#
|
|
39
|
+
# Bloggit 1.0.0
|
|
40
|
+
#
|
|
41
|
+
Template.register_tag :example do |*args|
|
|
42
|
+
kind, opts = args
|
|
43
|
+
opts ||= {}
|
|
44
|
+
|
|
45
|
+
case kind
|
|
46
|
+
when :version
|
|
47
|
+
"Bloggit "+ Bloggit::RELEASE_INFO
|
|
48
|
+
else
|
|
49
|
+
"Unknown tag "+ kind
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# = Responding to application events...
|
|
55
|
+
Bloggit::on_event(:after_generate) do |site, cache_dir|
|
|
56
|
+
# puts "I'm called after the rest of the site has been generated..."
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# = Adding a command line tool...
|
|
60
|
+
Cmdline.register do |cmd, site|
|
|
61
|
+
example_cmd = CmdParse::Command.new( 'example', true, true )
|
|
62
|
+
example_cmd.short_desc = "Example tool from plugin"
|
|
63
|
+
cmd.add_command( example_cmd )
|
|
64
|
+
|
|
65
|
+
sub_cmd = CmdParse::Command.new( 'sub', false )
|
|
66
|
+
sub_cmd.short_desc = "A sub command"
|
|
67
|
+
sub_cmd.set_execution_block do |args|
|
|
68
|
+
puts "Sub-command has been called, w00t!"
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
example_cmd.add_command( sub_cmd )
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# = Registering a custom text format:
|
|
75
|
+
begin
|
|
76
|
+
require 'rdoc/markup/simple_markup'
|
|
77
|
+
require 'rdoc/markup/simple_markup/to_html'
|
|
78
|
+
|
|
79
|
+
Bloggit::TextFormatter.register :rdoc do |text|
|
|
80
|
+
p = SM::SimpleMarkup.new
|
|
81
|
+
h = SM::ToHtml.new
|
|
82
|
+
p.convert(text, h)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
rescue LoadError
|
|
86
|
+
puts "There was an error registering the :rdoc text format:"+ $!
|
|
87
|
+
end
|
|
88
|
+
EOF
|
|
89
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Bloggit::Cmdline.register do |cmd, site|
|
|
2
|
+
unless site.nil?
|
|
3
|
+
|
|
4
|
+
post_cmd = CmdParse::Command.new( 'post', true, true )
|
|
5
|
+
post_cmd.short_desc = "Post Management"
|
|
6
|
+
cmd.add_command( post_cmd )
|
|
7
|
+
|
|
8
|
+
add_post = CmdParse::Command.new( 'new', false )
|
|
9
|
+
add_post.short_desc = "Create a new blog post"
|
|
10
|
+
add_post.set_execution_block do |args|
|
|
11
|
+
post = Bloggit::Post.to_file(args.to_s)
|
|
12
|
+
puts "#{post.filename} created."
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
post_cmd.add_command( add_post )
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Bloggit::Cmdline.register do |cmd, site|
|
|
2
|
+
site_cmd = CmdParse::Command.new( 'site', true, true )
|
|
3
|
+
|
|
4
|
+
site_cmd.short_desc = "Site Management"
|
|
5
|
+
|
|
6
|
+
cmd.add_command( site_cmd )
|
|
7
|
+
|
|
8
|
+
if site.nil?
|
|
9
|
+
|
|
10
|
+
new_site = CmdParse::Command.new( 'new', false )
|
|
11
|
+
new_site.short_desc = "Create a site bundle"
|
|
12
|
+
new_site.set_execution_block do |args|
|
|
13
|
+
|
|
14
|
+
raise "Site name required!" if args.to_s.empty?
|
|
15
|
+
|
|
16
|
+
name = args.to_s
|
|
17
|
+
bundle_name = "#{name}.blog"
|
|
18
|
+
current_dir = Dir.getwd
|
|
19
|
+
bundle_path = File.join(current_dir, bundle_name)
|
|
20
|
+
|
|
21
|
+
boiler_path = File.expand_path File.join( File.dirname(__FILE__), '..', 'boilerplate')
|
|
22
|
+
|
|
23
|
+
FileUtils.mkdir_p( bundle_path, :verbose=>false)
|
|
24
|
+
FileUtils.cp_r( Dir.glob(File.join(boiler_path, '*')), bundle_path, :verbose=>false)
|
|
25
|
+
|
|
26
|
+
# After the boilerplate copy... Make sure all the folders are there
|
|
27
|
+
dirs = [
|
|
28
|
+
File.join(current_dir, bundle_name, 'cache'),
|
|
29
|
+
File.join(current_dir, bundle_name, 'media'),
|
|
30
|
+
File.join(current_dir, bundle_name, 'pages'),
|
|
31
|
+
File.join(current_dir, bundle_name, 'posts'),
|
|
32
|
+
File.join(current_dir, bundle_name, 'plugins'),
|
|
33
|
+
File.join(current_dir, bundle_name, 'themes', 'default', 'images'),
|
|
34
|
+
File.join(current_dir, bundle_name, 'themes', 'default', 'styles'),
|
|
35
|
+
File.join(current_dir, bundle_name, 'themes', 'default', 'scripts'),
|
|
36
|
+
File.join(current_dir, bundle_name, 'themes', 'default', 'templates', 'layouts'),
|
|
37
|
+
File.join(current_dir, bundle_name, 'themes', 'default', 'templates', 'snippets')
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
dirs.each do |path|
|
|
41
|
+
FileUtils.mkdir_p( path, :verbose=>false)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
puts "#{bundle_name} created."
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
site_cmd.add_command( new_site )
|
|
48
|
+
|
|
49
|
+
else
|
|
50
|
+
|
|
51
|
+
gen_site = CmdParse::Command.new( 'generate', false )
|
|
52
|
+
gen_site.short_desc = "Generates site HTML in cache/ directory"
|
|
53
|
+
gen_site.set_execution_block do |args|
|
|
54
|
+
pub = Bloggit::Generator.new(site, Bloggit::Cmdline.verbose)
|
|
55
|
+
pub.generate_cache
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
site_cmd.add_command( gen_site )
|
|
59
|
+
|
|
60
|
+
# publish too?
|
|
61
|
+
pub_site = CmdParse::Command.new( 'publish', false )
|
|
62
|
+
pub_site.short_desc = "Uploads the HTML from cache/ to target server"
|
|
63
|
+
pub_site.set_execution_block do |args|
|
|
64
|
+
pub = Bloggit::Publisher.new(site, Bloggit::Cmdline.verbose)
|
|
65
|
+
pub.upload
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
site_cmd.add_command( pub_site )
|
|
69
|
+
|
|
70
|
+
# cleanup
|
|
71
|
+
|
|
72
|
+
cleanup_cache = CmdParse::Command.new( 'cleanup', false )
|
|
73
|
+
cleanup_cache.short_desc = "Removes files from cache/ directory"
|
|
74
|
+
cleanup_cache.set_execution_block do |args|
|
|
75
|
+
pub = Bloggit::Generator.new(site, Bloggit::Cmdline.verbose)
|
|
76
|
+
pub.cleanup_cache
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
site_cmd.add_command( cleanup_cache )
|
|
80
|
+
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Bloggit::Cmdline.register do |cmd, site|
|
|
2
|
+
unless site.nil?
|
|
3
|
+
|
|
4
|
+
theme_cmd = CmdParse::Command.new( 'theme', true, true )
|
|
5
|
+
theme_cmd.short_desc = "Theme Management"
|
|
6
|
+
cmd.add_command( theme_cmd )
|
|
7
|
+
|
|
8
|
+
new_theme = CmdParse::Command.new( 'new', false )
|
|
9
|
+
new_theme.short_desc = "Create a new theme"
|
|
10
|
+
new_theme.set_execution_block do |args|
|
|
11
|
+
#page = Bloggit::Page.to_file(args.to_s)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
theme_cmd.add_command( new_theme )
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
class Hash
|
|
2
|
+
|
|
3
|
+
# Extends a hash so that it can be used like an object in a template context (e.g. +hash.key+)
|
|
4
|
+
def method_missing(name, *args)
|
|
5
|
+
if name.to_s.ends_with? '='
|
|
6
|
+
name = name.to_s[0..-2]
|
|
7
|
+
self[name] = args[0]
|
|
8
|
+
else
|
|
9
|
+
if self.has_key? name.to_s
|
|
10
|
+
self[name.to_s]
|
|
11
|
+
elsif self.has_key? name.to_sym
|
|
12
|
+
self[name.to_sym]
|
|
13
|
+
else
|
|
14
|
+
super(name,*args)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Returns the binding so you can retrieve values from it...
|
|
20
|
+
def get_binding
|
|
21
|
+
binding
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
end
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# See Bloggit::Generator
|
|
2
|
+
module Bloggit
|
|
3
|
+
# = Generator
|
|
4
|
+
class Generator
|
|
5
|
+
attr_reader :site, :cache_dir, :template_dir, :errors
|
|
6
|
+
|
|
7
|
+
def initialize(site, verbose=false)
|
|
8
|
+
@v = verbose
|
|
9
|
+
@site = site
|
|
10
|
+
@cache_dir = File.join(site.base_path, 'cache')
|
|
11
|
+
@blog_root = site.blog_path # settings.fetch('blog_root', '')
|
|
12
|
+
@site_home = site.home_page # settings.fetch('homepage', 'blog')
|
|
13
|
+
|
|
14
|
+
Template.config { |t| t.site = @site }
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def cleanup_cache(opts={})
|
|
18
|
+
Bloggit::fire_event(:before_cleanup)
|
|
19
|
+
puts_if_verbose "Cleaning up files from cache folder..."
|
|
20
|
+
FileUtils.rm_rf Dir.glob( File.join(@cache_dir, '*') )
|
|
21
|
+
puts_if_verbose "Done."
|
|
22
|
+
rescue
|
|
23
|
+
puts "Done with errors:\n\n#{$!}"
|
|
24
|
+
ensure
|
|
25
|
+
Bloggit::fire_event(:after_cleanup)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def generate_cache(opts={})
|
|
29
|
+
@errors = {}
|
|
30
|
+
errs = Bloggit::fire_event(:before_generate, @site, @cache_dir)
|
|
31
|
+
@errors.merge!(errs) if errs.is_a?( Hash )
|
|
32
|
+
|
|
33
|
+
puts_if_verbose "Blog generation..."
|
|
34
|
+
gen_homepage(site.latest_posts)
|
|
35
|
+
|
|
36
|
+
if @site.blog_path != ''
|
|
37
|
+
create_folder site.blog_path
|
|
38
|
+
gen_inline_archive(site.latest_posts, :path=>@site.build_post_path('index.html'))
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
post_yrs = site.posts.group_by &:post_year
|
|
42
|
+
|
|
43
|
+
post_yrs.each do |year, posts_in_year|
|
|
44
|
+
create_folder @site.blog_path, year.to_s
|
|
45
|
+
gen_year_archive year, posts_in_year
|
|
46
|
+
post_mths = posts_in_year.group_by &:post_month
|
|
47
|
+
|
|
48
|
+
post_mths.each do |month, posts_in_month|
|
|
49
|
+
create_folder @site.blog_path, year.to_s, month.to_s
|
|
50
|
+
gen_month_archive year, month, posts_in_month
|
|
51
|
+
|
|
52
|
+
posts_in_month.each do |post|
|
|
53
|
+
gen_post(post)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
if site.has_tags?
|
|
59
|
+
create_folder 'tags'
|
|
60
|
+
gen_tags_archive(site.tags)
|
|
61
|
+
|
|
62
|
+
site.tags.each do |tag|
|
|
63
|
+
gen_tag_archive(tag)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
puts_if_verbose "News feed..."
|
|
68
|
+
gen_news_feed(site.posts)
|
|
69
|
+
|
|
70
|
+
puts_if_verbose "Static page generation..."
|
|
71
|
+
site.pages.each do |page|
|
|
72
|
+
gen_page(page)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
puts_if_verbose "Copying media files..."
|
|
76
|
+
media_root = File.join(site.base_path, 'media')
|
|
77
|
+
FileUtils.cp_r media_root, cache_dir, :verbose=>false
|
|
78
|
+
|
|
79
|
+
puts_if_verbose "Copying '#{site.theme}' theme files..."
|
|
80
|
+
create_folder 'theme'
|
|
81
|
+
theme_root = File.join(site.base_path, 'themes', site.theme)
|
|
82
|
+
theme_dirs = []
|
|
83
|
+
%w(images scripts styles).each {|dir| theme_dirs << File.join(theme_root, dir) }
|
|
84
|
+
FileUtils.cp_r theme_dirs, File.join(cache_dir, 'theme'), :verbose=>false
|
|
85
|
+
|
|
86
|
+
errs = Bloggit::fire_event(:after_generate, @site, @cache_dir)
|
|
87
|
+
@errors.merge!(errs) if errs.is_a?( Hash )
|
|
88
|
+
|
|
89
|
+
errs = Bloggit::fire_event(:before_finish, @site, @cache_dir)
|
|
90
|
+
@errors.merge!(errs) if errs.is_a?( Hash )
|
|
91
|
+
|
|
92
|
+
puts_if_verbose "Generating cache checksum..."
|
|
93
|
+
generate_checksums
|
|
94
|
+
|
|
95
|
+
puts_if_verbose ''
|
|
96
|
+
|
|
97
|
+
if @errors.keys.length == 0
|
|
98
|
+
puts "Done."
|
|
99
|
+
true
|
|
100
|
+
else
|
|
101
|
+
puts "Done with errors:"
|
|
102
|
+
@errors.each do |err, items|
|
|
103
|
+
puts ">>> #{err}:"
|
|
104
|
+
items.each do |item|
|
|
105
|
+
puts " - #{item}"
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
false
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def generate_checksums
|
|
114
|
+
checksum_data = Bloggit::Checksum.generate_from(cache_dir)
|
|
115
|
+
File.open( File.join(cache_dir, 'checksum.yml'), 'w' ) do |f|
|
|
116
|
+
f.write checksum_data.to_yaml
|
|
117
|
+
end
|
|
118
|
+
rescue
|
|
119
|
+
report_error('checksum.yml')
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Individual object generators...
|
|
123
|
+
|
|
124
|
+
def gen_post(post)
|
|
125
|
+
ctx = {
|
|
126
|
+
'post' => post,
|
|
127
|
+
'site' => @site
|
|
128
|
+
}
|
|
129
|
+
render_template :post, post.permalink, ctx
|
|
130
|
+
puts_if_verbose " - #{post.permalink}"
|
|
131
|
+
rescue
|
|
132
|
+
report_error(post.permalink || '??')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def gen_page(page)
|
|
136
|
+
ctx = {
|
|
137
|
+
'page' => page,
|
|
138
|
+
'site' => @site
|
|
139
|
+
}
|
|
140
|
+
render_template :page, "#{page.slug}.html", ctx
|
|
141
|
+
puts_if_verbose " - #{page.permalink}"
|
|
142
|
+
rescue
|
|
143
|
+
report_error(page.permalink || '??')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def gen_homepage(posts, opts={})
|
|
147
|
+
opts.posts = posts
|
|
148
|
+
opts.grouped_posts = opts.posts.group_by(&:publish_date)
|
|
149
|
+
opts.site = @site
|
|
150
|
+
path = opts.fetch(:path, 'index.html')
|
|
151
|
+
|
|
152
|
+
render_template :home, path, opts
|
|
153
|
+
puts_if_verbose " - #{path}"
|
|
154
|
+
rescue
|
|
155
|
+
report_error(path)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def gen_inline_archive(posts, opts={})
|
|
159
|
+
opts.posts = posts
|
|
160
|
+
opts.grouped_posts = opts.posts.group_by(&:publish_date)
|
|
161
|
+
opts.site = @site
|
|
162
|
+
opts.mode = :inline
|
|
163
|
+
path = opts.fetch(:path, 'index.html')
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
render_template :archive, path, opts
|
|
167
|
+
puts_if_verbose " - #{path}"
|
|
168
|
+
rescue
|
|
169
|
+
report_error(path)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def gen_year_archive(year, posts, opts={})
|
|
173
|
+
opts[:type] = :posts
|
|
174
|
+
opts[:mode] = :list
|
|
175
|
+
opts[:year] = year
|
|
176
|
+
opts[:posts] = posts
|
|
177
|
+
opts[:grouped_posts] = posts.group_by(&:post_month)
|
|
178
|
+
opts[:path] = @site.build_post_path( "#{year}/index.html" )
|
|
179
|
+
gen_archives(opts)
|
|
180
|
+
puts_if_verbose " - #{opts[:path]}"
|
|
181
|
+
rescue
|
|
182
|
+
report_error( opts[:path] )
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def gen_month_archive(year, month, posts, opts={})
|
|
186
|
+
opts[:type] = :posts
|
|
187
|
+
opts[:mode] = :inline
|
|
188
|
+
opts[:year] = year
|
|
189
|
+
opts[:month] = month
|
|
190
|
+
opts[:posts] = posts
|
|
191
|
+
opts[:path] = @site.build_post_path( "#{year}/#{month}/index.html" )
|
|
192
|
+
gen_archives(opts)
|
|
193
|
+
puts_if_verbose " - #{opts[:path]}"
|
|
194
|
+
rescue
|
|
195
|
+
report_error(opts[:path])
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def gen_tags_archive(tags, opts={})
|
|
199
|
+
opts.mode = :all_tags
|
|
200
|
+
opts.tags = tags
|
|
201
|
+
opts.site = @site
|
|
202
|
+
render_template :tag_archive, 'tags/index.html', opts
|
|
203
|
+
puts_if_verbose " - tags/index.html"
|
|
204
|
+
rescue
|
|
205
|
+
report_error("tags/index.html")
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
def gen_tag_archive(tag, opts={})
|
|
209
|
+
opts.mode = :single_tags
|
|
210
|
+
opts.tag = tag
|
|
211
|
+
opts.site = @site
|
|
212
|
+
render_template :tag_archive, "tags/#{tag.slug}.html", opts
|
|
213
|
+
puts_if_verbose " - tags/#{tag.slug}.html"
|
|
214
|
+
rescue
|
|
215
|
+
report_error("tags/#{tag.slug}.html")
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def gen_archives(opts={})
|
|
219
|
+
opts.reverse_merge! :type=>:posts, :mode=>:inline, :path=>'index.html', :site=>@site
|
|
220
|
+
render_template :archive, opts[:path], opts
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
def gen_news_feed(posts)
|
|
224
|
+
feed_type = @site.settings.syndication.fetch('type', 'rss')
|
|
225
|
+
limit = @site.settings.syndication.fetch('number_of_entries', 10)
|
|
226
|
+
target_posts = posts[0..limit]
|
|
227
|
+
File.open( File.join(cache_dir, @site.settings.syndication.filename), 'w') do |f|
|
|
228
|
+
case feed_type
|
|
229
|
+
when 'rss': gen_rss_feed(target_posts, f)
|
|
230
|
+
when 'atom': gen_atom_feed(target_posts, f)
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
puts_if_verbose " - #{site.settings.syndication.filename} (#{feed_type})"
|
|
234
|
+
rescue
|
|
235
|
+
report_error("#{site.settings.syndication.filename} (#{feed_type})")
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
def gen_atom_feed(posts, io_obj)
|
|
239
|
+
tmpl = Template.from_text('')
|
|
240
|
+
Template.folder_depth = 0
|
|
241
|
+
|
|
242
|
+
xml = Builder::XmlMarkup.new( :target=>io_obj, :indent=>2 )
|
|
243
|
+
#xml.instruct! 'xml-stylesheet', :href=>'/stylesheets/atom.css', :type=>'text/css'
|
|
244
|
+
|
|
245
|
+
xml.feed :xmlns=>'http://www.w3.org/2005/Atom' do
|
|
246
|
+
xml.div :xmlns=>'http://www.w3.org/1999/xhtml', :class=>'info' do
|
|
247
|
+
xml << <<-EOF
|
|
248
|
+
This is an Atom formatted XML site feed.
|
|
249
|
+
It is intended to be viewed in a Newsreader or syndicated to another site.
|
|
250
|
+
Please visit <a href="http://www.atomenabled.org/">atomenabled.org</a> for more info.
|
|
251
|
+
EOF
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
xml.title @site.title
|
|
255
|
+
xml.link :rel=>'self', :href=>@site.absolute_path_to(:feed)
|
|
256
|
+
xml.link :href=>@site.absolute_path_to(:home)
|
|
257
|
+
xml.id :href=>@site.absolute_path_to(:home)
|
|
258
|
+
xml.updated posts.first.publish_date.strftime("%a, %d %b %Y %H:%M:%S %z")
|
|
259
|
+
xml.author { xml.name @site.author }
|
|
260
|
+
posts.each do |post|
|
|
261
|
+
xml.entry do
|
|
262
|
+
xml.title post.title
|
|
263
|
+
xml.link :href=>@site.absolute_path_to(post)
|
|
264
|
+
xml.id atom_id_for(post)
|
|
265
|
+
xml.updated post.publish_date.strftime("%a, %d %b %Y %H:%M:%S %z")
|
|
266
|
+
xml.author { xml.name @site.author }
|
|
267
|
+
# xml.summary entry.summary
|
|
268
|
+
xml.content post.render_content(tmpl.render_binding), :type=>'html'
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
def gen_rss_feed(posts, io_obj)
|
|
275
|
+
tmpl = Template.from_text('')
|
|
276
|
+
Template.folder_depth = 0
|
|
277
|
+
|
|
278
|
+
xml = Builder::XmlMarkup.new( :target=>io_obj, :indent=>2 )
|
|
279
|
+
xml.instruct! :xml, :version=>"1.0"
|
|
280
|
+
xml.rss(:version=>"2.0"){
|
|
281
|
+
xml.channel{
|
|
282
|
+
xml.title( @site.title() )
|
|
283
|
+
xml.link( @site.absolute_path_to(:home) )
|
|
284
|
+
xml.description(site.subtitle)
|
|
285
|
+
xml.language('en-us')
|
|
286
|
+
for post in posts
|
|
287
|
+
xml.item do
|
|
288
|
+
xml.title(post.title)
|
|
289
|
+
xml.category(post.tags.join(', '))
|
|
290
|
+
xml.description(post.render_content(tmpl.render_binding))
|
|
291
|
+
xml.pubDate(post.publish_date.strftime("%a, %d %b %Y %H:%M:%S %z"))
|
|
292
|
+
xml.link(site.absolute_path_to(post))
|
|
293
|
+
xml.guid(site.absolute_path_to(post))
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
private
|
|
301
|
+
|
|
302
|
+
def puts_if_verbose(msg='')
|
|
303
|
+
puts(msg) if @v
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
def report_error(affected_item)
|
|
307
|
+
err_msg = $!.to_s
|
|
308
|
+
@errors[err_msg] ||= []
|
|
309
|
+
@errors[err_msg] << affected_item
|
|
310
|
+
puts_if_verbose " x #{affected_item}"
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
def create_folder(*folder_names)
|
|
314
|
+
folder_names.delete_if {|p| p=="" }
|
|
315
|
+
full_path = [cache_dir, folder_names].flatten
|
|
316
|
+
FileUtils.mkdir_p File.join(*full_path), :verbose=>false
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
def atom_id_for(post)
|
|
320
|
+
base_url = @site.settings.syndication.fetch('base_url', 'no-name.com').gsub('http://', '')
|
|
321
|
+
"tag:#{base_url},#{post.publish_date.strftime('%Y-%m-%d')}:#{post.permalink}"
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
def render_template(template, path, ctx={})
|
|
325
|
+
output = Template.render(template, File.dirname(path), ctx)
|
|
326
|
+
File.open( File.join(cache_dir, path), 'w') do |f|
|
|
327
|
+
f.write output
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
end
|