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,102 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'webrick'
|
|
3
|
+
require 'markaby'
|
|
4
|
+
require 'erb'
|
|
5
|
+
|
|
6
|
+
include WEBrick
|
|
7
|
+
|
|
8
|
+
class Action < HTTPServlet::AbstractServlet
|
|
9
|
+
attr_reader :req, :res, :content_type
|
|
10
|
+
def do_GET(req, res)
|
|
11
|
+
@req = req; @res = res
|
|
12
|
+
@content_type = "text/html"
|
|
13
|
+
@res.body = get
|
|
14
|
+
@res['Content-Type'] = @content_type
|
|
15
|
+
end
|
|
16
|
+
def do_POST(req, res)
|
|
17
|
+
@req = req; @res = res
|
|
18
|
+
@content_type = "text/html"
|
|
19
|
+
@res.body = post
|
|
20
|
+
@res['Content-Type'] = @content_type
|
|
21
|
+
end
|
|
22
|
+
def get; "GET not defined"; end
|
|
23
|
+
def post; "POST not defined"; end
|
|
24
|
+
def render(template, binding=binding)
|
|
25
|
+
source = IO.read(File.join(File.dirname(__FILE__), 'client', 'templates', "#{template}.rhtml"))
|
|
26
|
+
puts "Rendering #{source}"
|
|
27
|
+
ERB.new(source).result(binding)
|
|
28
|
+
end
|
|
29
|
+
def site
|
|
30
|
+
Bloggit::Server.active_site
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class Main < Action
|
|
36
|
+
def get
|
|
37
|
+
render('main')
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class Json < Action
|
|
42
|
+
def get
|
|
43
|
+
# Get the URI, somehow...
|
|
44
|
+
#path_parser = Regexp.new("/(\w+)(?:/)()")
|
|
45
|
+
|
|
46
|
+
path_parts = req.path_info.to_s.split('/')
|
|
47
|
+
path_parts.shift # The first is probably always blank, unless no data type was sent... ?
|
|
48
|
+
|
|
49
|
+
case path_parts.shift
|
|
50
|
+
when "posts"
|
|
51
|
+
@count = site.all_posts.length
|
|
52
|
+
@data = site.all_posts.to_json
|
|
53
|
+
|
|
54
|
+
when "pages"
|
|
55
|
+
@count = site.all_pages.length
|
|
56
|
+
@data = site.all_pages.to_json
|
|
57
|
+
|
|
58
|
+
when "settings"
|
|
59
|
+
@count = 0
|
|
60
|
+
@data = "[]"
|
|
61
|
+
|
|
62
|
+
else
|
|
63
|
+
@count = 0
|
|
64
|
+
@data = "[]"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
@content_type = 'text/javascript'
|
|
68
|
+
render('json')
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class Bloggit::Server
|
|
74
|
+
class << self
|
|
75
|
+
attr_reader :active_site
|
|
76
|
+
|
|
77
|
+
def run
|
|
78
|
+
site = Dir.getwd.ends_with?('.blog') ? Bloggit::Site.from_file(Dir.getwd) : nil
|
|
79
|
+
raise "Not a valid Bloggit site!" if site.nil?
|
|
80
|
+
@active_site = site
|
|
81
|
+
|
|
82
|
+
s = HTTPServer.new(
|
|
83
|
+
:Port => 3322,
|
|
84
|
+
:DocumentRoot => File.join(File.dirname(__FILE__), 'client')
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
s.mount( "/main", Main )
|
|
88
|
+
s.mount( "/json", Json )
|
|
89
|
+
|
|
90
|
+
# s.mount_proc("/hello"){|req, res|
|
|
91
|
+
# res['Content-Type'] = "text/html"
|
|
92
|
+
# res.body = "<HTML>hello</HTML>"
|
|
93
|
+
# }
|
|
94
|
+
trap("INT"){ s.shutdown }
|
|
95
|
+
s.start
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if __FILE__ == $0
|
|
101
|
+
Bloggit::Server.run()
|
|
102
|
+
end
|
data/lib/bloggit/site.rb
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# See Bloggit::Site
|
|
2
|
+
module Bloggit
|
|
3
|
+
|
|
4
|
+
# = Site
|
|
5
|
+
#
|
|
6
|
+
# A site is stored as a collection of folders and files with the following
|
|
7
|
+
# layout:
|
|
8
|
+
#
|
|
9
|
+
# Site.blog/ - Bundle
|
|
10
|
+
# posts/ - All the Posts stored as text files prefixed with data info YYMMDD-slug
|
|
11
|
+
# pages/ - Static Pages
|
|
12
|
+
# media/ - All images, movies, sound files, etc.,
|
|
13
|
+
# templates/ - Templates for rendering the site
|
|
14
|
+
# cache/ - The latest rendered output
|
|
15
|
+
# settings.yml - Site-wide settings
|
|
16
|
+
# Rakefile - Defines tasks for generating cache, and publishing it
|
|
17
|
+
#
|
|
18
|
+
class Site
|
|
19
|
+
attr_accessor :settings, :pages, :posts, :media, :templates
|
|
20
|
+
attr_reader :base_path, :all_pages, :all_posts
|
|
21
|
+
|
|
22
|
+
def initialize(base_path, ignore_media=false)
|
|
23
|
+
@base_path = base_path
|
|
24
|
+
|
|
25
|
+
# Read settings.yml from folder...
|
|
26
|
+
@settings = YAML::load( File.open(File.join(base_path, 'settings.yml'), 'r') )
|
|
27
|
+
|
|
28
|
+
Tag.reset!
|
|
29
|
+
|
|
30
|
+
# Load Pages...
|
|
31
|
+
@pages = []
|
|
32
|
+
@page_hsh = {}
|
|
33
|
+
@inactive_pages = []
|
|
34
|
+
Dir[ File.join(base_path, 'pages', '*.page') ].each do |page_path|
|
|
35
|
+
page = Page.from_file(page_path, self)
|
|
36
|
+
if page.is_publishable?
|
|
37
|
+
@pages << page
|
|
38
|
+
@page_hsh[page.slug] = page
|
|
39
|
+
else
|
|
40
|
+
@inactive_pages << page
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
@all_pages = @pages + @inactive_pages
|
|
44
|
+
|
|
45
|
+
@pages.sort! {|a,b| a.title <=> b.title }
|
|
46
|
+
@all_pages.sort! {|a,b| a.title <=> b.title }
|
|
47
|
+
|
|
48
|
+
# Load Posts...
|
|
49
|
+
@posts = []
|
|
50
|
+
@inactive_posts = []
|
|
51
|
+
@post_hsh = {}
|
|
52
|
+
Dir[ File.join(base_path, 'posts', '*.post') ].each do |post_path|
|
|
53
|
+
post = Post.from_file(post_path, self)
|
|
54
|
+
if post.is_publishable?
|
|
55
|
+
@posts << post
|
|
56
|
+
@post_hsh[post.slug] = post
|
|
57
|
+
else
|
|
58
|
+
@inactive_posts << post
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
@all_posts = @posts + @inactive_posts
|
|
62
|
+
|
|
63
|
+
@posts.sort! {|a,b| a.publish_date <=> b.publish_date }.reverse!
|
|
64
|
+
@all_posts.sort! {|a,b| a.publish_date <=> b.publish_date }.reverse!
|
|
65
|
+
|
|
66
|
+
# Load Media... (?)
|
|
67
|
+
@media = {}
|
|
68
|
+
Dir[ File.join(base_path, 'media', '**', '*') ].each do |media_path|
|
|
69
|
+
unless FileTest.directory?(media_path)
|
|
70
|
+
media_item = Media.from_file(media_path, self)
|
|
71
|
+
@media[ media_item.relative_path ] = media_item
|
|
72
|
+
end
|
|
73
|
+
end unless ignore_media
|
|
74
|
+
|
|
75
|
+
# Load Templates... (?)
|
|
76
|
+
#@templates = []
|
|
77
|
+
|
|
78
|
+
# Load plugins
|
|
79
|
+
Plugin.init(self)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def blog_path
|
|
83
|
+
@settings.site.fetch('blog_root', '')
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def home_page
|
|
87
|
+
@settings.site.fetch('homepage', 'blog')
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def tags
|
|
91
|
+
Tag.tag_list.values.sort {|a,b| a.name <=> b.name }
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def has_tags?
|
|
95
|
+
!Tag.tag_list.nil?
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def get_page_by_slug(slug)
|
|
99
|
+
@page_hsh[slug]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def get_post_by_slug(slug)
|
|
103
|
+
@post_hsh[slug]
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def latest_posts(limit=nil)
|
|
107
|
+
limit = @settings.syndication.fetch('number_of_entries', 10) if limit.nil?
|
|
108
|
+
@posts[0..limit]
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def absolute_path_to(obj)
|
|
112
|
+
case obj.class.to_s
|
|
113
|
+
when 'Bloggit::Post'
|
|
114
|
+
build_path(obj.permalink)
|
|
115
|
+
|
|
116
|
+
when 'Bloggit::Page'
|
|
117
|
+
build_path(obj.permalink)
|
|
118
|
+
|
|
119
|
+
when 'Bloggit::Tag'
|
|
120
|
+
build_path(obj.permalink)
|
|
121
|
+
|
|
122
|
+
when 'Bloggit::Media'
|
|
123
|
+
build_path(obj.permalink)
|
|
124
|
+
|
|
125
|
+
when 'Symbol'
|
|
126
|
+
case obj
|
|
127
|
+
when :feed: build_path( @settings.syndication.filename )
|
|
128
|
+
when :home: build_path( 'index.html' )
|
|
129
|
+
when :blog: build_path( build_post_path('index.html') )
|
|
130
|
+
end
|
|
131
|
+
else
|
|
132
|
+
puts "Can't build a path for #{obj}/#{obj.class}"
|
|
133
|
+
'?type=unknown'
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def plugin_settings(plugin_name)
|
|
138
|
+
@settings.plugins.fetch(plugin_name.to_s, {})
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def method_missing(name, *args)
|
|
142
|
+
if @settings.site.has_key?(name.to_s)
|
|
143
|
+
@settings.site[name.to_s]
|
|
144
|
+
else
|
|
145
|
+
puts "Site: #{name}?"
|
|
146
|
+
super(name, *args)
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def build_post_path(path)
|
|
151
|
+
base_path = ''
|
|
152
|
+
if blog_path != ''
|
|
153
|
+
base_path = blog_path
|
|
154
|
+
base_path += '/' unless base_path.ends_with?('/')
|
|
155
|
+
end
|
|
156
|
+
base_path + path
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
private
|
|
160
|
+
|
|
161
|
+
def build_path(*segs)
|
|
162
|
+
base_url = @settings.syndication.fetch('base_url', '')
|
|
163
|
+
segs.unshift(base_url)
|
|
164
|
+
segs.join('/')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
class << self
|
|
168
|
+
protected :new
|
|
169
|
+
|
|
170
|
+
def from_file(path, ignore_media=false)
|
|
171
|
+
path = File.expand_path(path)
|
|
172
|
+
raise "Path must be a directory" unless FileTest.directory? path
|
|
173
|
+
Site.new(path, ignore_media)
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
def create(path)
|
|
177
|
+
# Create folder structure and initial files...
|
|
178
|
+
path = File.expand_path(path)
|
|
179
|
+
raise "Path must be a directory" unless FileTest.directory? path
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
data/lib/bloggit/tag.rb
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# See Bloggit::Tag
|
|
2
|
+
module Bloggit
|
|
3
|
+
# = Tag
|
|
4
|
+
class Tag
|
|
5
|
+
attr_accessor :name, :pages, :posts
|
|
6
|
+
|
|
7
|
+
def initialize(tag_name)
|
|
8
|
+
@name = tag_name
|
|
9
|
+
@pages = []
|
|
10
|
+
@posts = []
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def has_pages?
|
|
14
|
+
@pages.length > 0
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def has_posts?
|
|
18
|
+
@posts.length > 0
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def slug
|
|
22
|
+
@name.to_slug
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def permalink
|
|
26
|
+
"tags/#{slug}.html"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def add_page(page)
|
|
30
|
+
@pages << page
|
|
31
|
+
@pages.sort! {|a,b| a.title <=> b.title }.reverse!
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def add_post(post)
|
|
35
|
+
@posts << post
|
|
36
|
+
@posts.sort! {|a,b| a.publish_date <=> b.publish_date }.reverse!
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
class << self
|
|
40
|
+
private :new
|
|
41
|
+
attr_reader :tag_list
|
|
42
|
+
|
|
43
|
+
def reset!
|
|
44
|
+
@tag_list = {}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def register_page(tag, page)
|
|
48
|
+
@tag_list ||= {}
|
|
49
|
+
@tag_list[tag] = new(tag) unless @tag_list.has_key? tag
|
|
50
|
+
@tag_list[tag].add_page page
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def register_post (tag, post)
|
|
55
|
+
@tag_list ||= {}
|
|
56
|
+
@tag_list[tag] = new(tag) unless @tag_list.has_key? tag
|
|
57
|
+
@tag_list[tag].add_post post
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Some rake tasks for generating the site HTML and publishing to a local and/or remote location
|
|
2
|
+
require 'rake'
|
|
3
|
+
require 'bloggit'
|
|
4
|
+
|
|
5
|
+
task :default=>:generate
|
|
6
|
+
|
|
7
|
+
desc "Generate static HTML in cache"
|
|
8
|
+
task :generate=>[:cleanup] do
|
|
9
|
+
# Generate the HTML site and structure under cache/
|
|
10
|
+
site = Bloggit::Site.from_file('.') #File.dirname( __FILE__ )
|
|
11
|
+
gen = Bloggit::Generator.new(site, true)
|
|
12
|
+
gen.generate_cache
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
desc "Upload cache to target location"
|
|
16
|
+
task :upload do
|
|
17
|
+
# Copy/SFTP/FTP site from cache/ to target location defined in settings.yml (?)
|
|
18
|
+
site = Bloggit::Site.from_file('.') #File.dirname( __FILE__ )
|
|
19
|
+
pub = Bloggit::Publisher.new(site, true)
|
|
20
|
+
pub.upload
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "Generates website and uploads it to the target location"
|
|
24
|
+
task :publish=>[:generate, :upload] do
|
|
25
|
+
puts "Finished"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
desc "Removes site cache"
|
|
29
|
+
task :cleanup do
|
|
30
|
+
# Kill the files/folders under cache/
|
|
31
|
+
site = Bloggit::Site.from_file('.', true) #File.dirname( __FILE__ )
|
|
32
|
+
pub = Bloggit::Generator.new(site, true)
|
|
33
|
+
pub.cleanup_cache
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
task :clean=>:cleanup do; end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
require 'rake'
|
|
2
|
+
|
|
3
|
+
namespace :scm do
|
|
4
|
+
|
|
5
|
+
desc "Adds missing files into SCM, interactively"
|
|
6
|
+
task :add do
|
|
7
|
+
scm_processor(:add)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
desc "Reverts and Removes deleted files from SCM, interactively"
|
|
11
|
+
task :remove do
|
|
12
|
+
scm_processor(:remove)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
desc "Looks for added files, then removed ones"
|
|
16
|
+
task :all do
|
|
17
|
+
scm_processor(:add, "No files to add")
|
|
18
|
+
scm_processor(:remove, "No files to remove")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
SVN = ENV['SCM'] || 'svk'
|
|
24
|
+
|
|
25
|
+
def propset(prop, value, *targets)
|
|
26
|
+
sh %(#{SVN} propset #{prop} "#{value}" #{targets.join(' ')})
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def add(dir)
|
|
30
|
+
sh %(#{SVN} add #{dir})
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def remove(file)
|
|
34
|
+
sh %(#{SVN} revert #{file})
|
|
35
|
+
sh %(#{SVN} delete #{file})
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def stat
|
|
39
|
+
`#{SVN} stat`
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def project_name
|
|
43
|
+
File.basename(File.expand_path(RAILS_ROOT))
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def scm_processor(mode, no_targets_msg="Nothing to do")
|
|
47
|
+
raise "Requires mode :add or :remove" if mode.nil? or ![:add,:remove].include?(mode)
|
|
48
|
+
re = (mode == :add) ? [ /^\?/, /^\?\s*/ ] : [ /^\!/, /^\!\s*/ ]
|
|
49
|
+
files = stat.select{ |e| re[0] =~ e}.collect{|e| e.sub(re[1], '').chomp }
|
|
50
|
+
puts
|
|
51
|
+
if files.length == 0
|
|
52
|
+
puts no_targets_msg
|
|
53
|
+
else
|
|
54
|
+
files.map {|f| puts " #{f}"}
|
|
55
|
+
print "\n#{mode.to_s.capitalize} all of these? (y/n/i) : "
|
|
56
|
+
affected_files = 0
|
|
57
|
+
if STDIN.gets =~ /^(y|i)/i
|
|
58
|
+
case $1.downcase
|
|
59
|
+
when 'y'
|
|
60
|
+
(mode == :add) ? add(files.join(' ')) : files.map { |f| remove(f) }
|
|
61
|
+
affected_files = files.length
|
|
62
|
+
when 'i'
|
|
63
|
+
puts "\n[Interactive Mode]\n"
|
|
64
|
+
files.each do |file|
|
|
65
|
+
print "#{mode.to_s.capitalize} '#{file}'? (y/n) : "
|
|
66
|
+
if /^y/i =~ STDIN.gets
|
|
67
|
+
(mode == :add) ? add(file) : remove(file)
|
|
68
|
+
affected_files += 1
|
|
69
|
+
else
|
|
70
|
+
puts "Ignored"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
puts "\n#{affected_files} file(s) affected, #{files.length - affected_files} ignored"
|
|
76
|
+
end
|
|
77
|
+
puts
|
|
78
|
+
end
|