Almost-minimal filesystem based blog.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

242 lines
7.6 KiB

cache rendered html; extract titles; all as utf-8 This stashes the HTML version of every entry in memory and uses Mojo::DOM to extract headers from the markup for use as titles. Titles are displayed in $self->{page_navigation}, now available inside templates as ${page_navigation}. In order to keep Mojo::DOM from choking on other input, it uses the open pragma to open everything as UTF-8 by default, which also eliminates a whole class of character encoding bugs and removes some fiddling with Encode::decode() from feed_print(). This is all obviously a more memory-intensive, but caching the markup turns out to have the side effect of making it much faster to render even a large site, probably as much as anything because the HTML in question is only getting generated once per entry instead of (potentially) 2-3 times. This commit isn't very atomic. In the process of roughing it out and testing it, I made a small pile of minor but potentially breaking changes: - Removed entry_map from settings and hardcoded handling of various types of entry as some if-statements instead. - Removed embedded_perl flag in settings - was always turned on in practice, and wasn't very coherent since templating would have broken without it. - bin/wrt-display - now handles the "feed" alias correctly - EntryStore: now supports retrieving values for properties with prop_value() - this isn't currently used, but it seems like a reasonable extension of the property idea. - Added `wrt ls --with-titles`. - Added dependency versions to Build.PL. - Refactored Markup's line_parse() a little. - Refactored some tests to give cleaner / more useful output. - Renamed default template file to "default".
4 years ago
cache rendered html; extract titles; all as utf-8 This stashes the HTML version of every entry in memory and uses Mojo::DOM to extract headers from the markup for use as titles. Titles are displayed in $self->{page_navigation}, now available inside templates as ${page_navigation}. In order to keep Mojo::DOM from choking on other input, it uses the open pragma to open everything as UTF-8 by default, which also eliminates a whole class of character encoding bugs and removes some fiddling with Encode::decode() from feed_print(). This is all obviously a more memory-intensive, but caching the markup turns out to have the side effect of making it much faster to render even a large site, probably as much as anything because the HTML in question is only getting generated once per entry instead of (potentially) 2-3 times. This commit isn't very atomic. In the process of roughing it out and testing it, I made a small pile of minor but potentially breaking changes: - Removed entry_map from settings and hardcoded handling of various types of entry as some if-statements instead. - Removed embedded_perl flag in settings - was always turned on in practice, and wasn't very coherent since templating would have broken without it. - bin/wrt-display - now handles the "feed" alias correctly - EntryStore: now supports retrieving values for properties with prop_value() - this isn't currently used, but it seems like a reasonable extension of the property idea. - Added `wrt ls --with-titles`. - Added dependency versions to Build.PL. - Refactored Markup's line_parse() a little. - Refactored some tests to give cleaner / more useful output. - Renamed default template file to "default".
4 years ago
cache rendered html; extract titles; all as utf-8 This stashes the HTML version of every entry in memory and uses Mojo::DOM to extract headers from the markup for use as titles. Titles are displayed in $self->{page_navigation}, now available inside templates as ${page_navigation}. In order to keep Mojo::DOM from choking on other input, it uses the open pragma to open everything as UTF-8 by default, which also eliminates a whole class of character encoding bugs and removes some fiddling with Encode::decode() from feed_print(). This is all obviously a more memory-intensive, but caching the markup turns out to have the side effect of making it much faster to render even a large site, probably as much as anything because the HTML in question is only getting generated once per entry instead of (potentially) 2-3 times. This commit isn't very atomic. In the process of roughing it out and testing it, I made a small pile of minor but potentially breaking changes: - Removed entry_map from settings and hardcoded handling of various types of entry as some if-statements instead. - Removed embedded_perl flag in settings - was always turned on in practice, and wasn't very coherent since templating would have broken without it. - bin/wrt-display - now handles the "feed" alias correctly - EntryStore: now supports retrieving values for properties with prop_value() - this isn't currently used, but it seems like a reasonable extension of the property idea. - Added `wrt ls --with-titles`. - Added dependency versions to Build.PL. - Refactored Markup's line_parse() a little. - Refactored some tests to give cleaner / more useful output. - Renamed default template file to "default".
4 years ago
v6.0.0: expand EntryStore, test more, cache harder This commit is something of a hairball, the result of evenings-and-weekends hacking building up a set of changes that got out of hand in parallel. If I had the energy to spare, I would break it apart into semantically-related changes, but I don't - and I suppose all this crap being rolled together is at least reflective of how the code was written. These changes are really half-finished, at best. Eventual goals: - App::WRT shouldn't directly touch the filesystem - App::WRT::EntryStore should model the entry archive completely - App::WRT::Renderer should say what to write to the publication directory - This one's a maybe: Filesystem interaction should pass through App::WRT::FileIO or something like it so that EntryStore and Renderer can be more usefully tested, with mocked writes (maybe) I do think this represents an inflection point in the long, silly life of this program: It includes a handful of new tests, and a number of the code changes were in turn easy to make because the test suite begins to model the code in a useful way. It's less and less necessary to run wrt against the p1k3.com archives to be sure that I haven't trashed something. Breaking changes to note: - Will no longer render HTML for nonexistent entries - Months and years which are flatfiles or contain an index are handled differently, albeit less brokenly - EntryStore includes index files in its overall list of entries (this seems to break less than I thought), which trickles out to bin/wrt-ls Overall changes herein: - App::WRT::Date - Move month_name() in here from App::WRT, add tests. - App::WRT::EntryStore - Hash file types for entries (directory or flatfile) - Use keys of file type hash for complete list of entries. - has_prop($entry, $property) - is_dir($entry), is_file($entry), is_extant($entry) - parent_of($entry) - has_index($entry) - Make EntryStore cache whether a file is a flatfile or a directory, as well as its existence, in a single hash. - Include index flatfiles in @source_files for use by has_index() - Various tests. - App::WRT::FileIO - Still duplicates a bunch of shit from Util, so that needs sorted. - App::WRT::Renderer - Convert to a proper class. - Add experimental FileIO class to use in Renderer (imperfect, tricky, still thinking about this). The idea is to separate out the concerns of reading and writing the filesystem. - App::WRT - Refactor display() and improve tests - Use "@entries" instead of "@options" for clarity - Handle entry names that might evaluate as false - Test running display() without any params - Rename expand_option() -> expand_alias(), refactor - Use EntryStore::has_prop() to detect wrt-noexpand.prop - year(), month(), entry() partially rewritten to use EntryStore - year() should handle months which are a flatfile - Refactor icon_markup() to use is_file() / is_dir() / is_extant(), add tests. - Add subtitle to feeds - bin/wrt-ls is now a "modulino" with tests - bin/display errors on non-existent entries - Build.PL - Remove bogus XML::Feed dependency
5 years ago
  1. Revision history for App::WRT
  2. v8.1.0 2023-05-24
  3. - Add url_rel
  4. v8.0.0 2022-09-26
  5. - Add experimental filters feature
  6. - Revise license to explicitly GPL 2 or 3
  7. - Update various dependency versions
  8. v7.1.2 2020-07-24
  9. - Alphabetically sort sub-entries
  10. v7.1.1 2020-07-23
  11. - Add a date_published to JSON Feed output
  12. v7.1.0 2020-04-18
  13. - Add some handling for sites with an index file in the root
  14. - wrt-render-all now uses the configured default for root of site instead
  15. of "new"
  16. v7.0.0 2020-04-04
  17. - Add a full tagging system
  18. - Cache HTML for every entry in the archive for a speedup in rendering large sites
  19. - Extract headers from rendered HTML with Mojo::DOM and cache
  20. - Use extracted headers to title pages, navigation links, and feed entries
  21. - Handle feed_alias in wrt-display
  22. - Remove entry_map from configuration and hardcode the default's assumptions
  23. about blog entry layout
  24. - Remove embedded_perl from configuration - now always look for embedded
  25. Perl, since this is required for templates. This feature may be
  26. deprecated in a future release.
  27. - Warn on HTML parsing errors (usually character encoding issues)
  28. - Rename default template from "basic" to "default"
  29. - Add JSON Feed support, improve Atom feed performance
  30. - Add wrt-repl for debugging
  31. - Add feed links to default template produced by wrt-init
  32. - Add wrt-feed for printing feeds
  33. v6.3.1 2019-06-23
  34. - Generalize iso_date() test for epoch to include all timezones
  35. v6.3.0 2019-06-22
  36. - Move get_date() from App::WRT::Util to App::WRT::Date
  37. - Make App::WRT::FileIO and ::Util less redundant
  38. - Add App::WRT::Mock::FileIO for faking writes in tests
  39. - Make bin/wrt-render-all testable, add t/bin-wrt-render-all.t
  40. v6.2.4 2019-05-28
  41. - Replace README.pod with a concise README.md
  42. v6.2.3 2019-05-16
  43. - bin/wrt-display: correctly expand new, fulltext, all
  44. v6.2.2 2019-05-16
  45. - EntryStore: stash sorted list of all entries as found
  46. v6.2.1 2019-05-16
  47. - bin/wrt-help
  48. - list more subcommands
  49. - fix display of utility name
  50. v6.2.0 2019-05-16
  51. - EntryStore: Add methods for further slicing entry list:
  52. - Days by month or year
  53. - Months by year
  54. - Immediate children and parents of entries
  55. - basename($entry)
  56. v6.1.0 2019-05-16
  57. - Add bin/wrt-help and bin/wrt-version
  58. - Includes -h, --help, -v, --version, -v aliases.
  59. v6.0.0 2019-05-06
  60. - App::WRT::Date
  61. - Move month_name() in here from App::WRT, add tests.
  62. - App::WRT::EntryStore:
  63. - Hash file types for entries (directory or flatfile)
  64. - Use keys of file type hash for complete list of entries.
  65. - has_prop($entry, $property)
  66. - is_dir($entry), is_file($entry), is_extant($entry)
  67. - parent_of($entry)
  68. - has_index($entry)
  69. - Make EntryStore cache whether a file is a flatfile or a directory, as
  70. well as its existence, in a single hash.
  71. - Include index flatfiles in @source_files for use by has_index()
  72. - Various tests.
  73. - App::WRT::FileIO
  74. - Still duplicates a bunch of shit from Util, so that needs sorted.
  75. - App::WRT::Renderer
  76. - Convert to a proper class.
  77. - Add experimental FileIO class to use in Renderer (imperfect,
  78. tricky, still thinking about this). The idea is to separate out the
  79. concerns of reading and writing the filesystem.
  80. - App::WRT
  81. - Refactor display() and improve tests
  82. - Use "@entries" instead of "@options" for clarity
  83. - Handle entry names that might evaluate as false
  84. - Test running display() without any params
  85. - Rename expand_option() -> expand_alias(), refactor
  86. - Use EntryStore::has_prop() to detect wrt-noexpand.prop
  87. - year(), month(), entry() partially rewritten to use EntryStore
  88. - year() should handle months which are a flatfile
  89. - Refactor icon_markup() to use is_file() / is_dir() / is_extant(),
  90. add tests.
  91. - Add subtitle to feeds
  92. - bin/wrt-ls is now a "modulino" with tests
  93. - bin/display errors on non-existent entries
  94. v5.0.0 2019-04-14
  95. - Add bin/wrt-ls for listing entries in current archive
  96. - Add bin/wrt-config for displaying configuration info
  97. - Allow header tags with attributes
  98. - Minor documentation cleanup
  99. - Bump XML::Atom::SimpleFeed to 0.900; remove wrt-fcgi
  100. - Concatenation instead of variable interpolation in HTML::tag()
  101. - Remove hardcoded "public" from renderer directory path copying
  102. - Remove unused feed_url param from wrt-init and example dir
  103. - Remove an extraneous JSON->convert_blessed(1) call
  104. - WRT::entry(): fix glitch with contents list for binfile_expr matches
  105. - Correctly encode feed output - see https://p1k3.com/2018/5/28/
  106. - Add App::WRT::Util::file_get_contents();
  107. - Optionally cache included files in-memory
  108. - Add EntryStore, a class for wrapping various methods for finding entry lists
  109. - Refactor display()
  110. - Use Carp for errors
  111. - Remove old LaTeX markup stuff
  112. - Add this Changes file
  113. v5.0.0-alpha 2018-04-19
  114. - Use 5 most recent entries for home page instead of latest month
  115. - Remove accessor methods for instance variables / configuration
  116. - Give absolute paths to imgsize() so it chills out on Cwd::getcwd() calls
  117. - Remove local_path(), recent_month(), month_before, and feed_print_latest()
  118. - Stop using a() in entry_markup()
  119. - Cache get_date_entries_by_depth() results
  120. - Swap out state vars for stashing things on $self in get_all_source_files()
  121. - Add get_date_entries_by_depth()
  122. - Tweak link_bar() behavior to retain link for current page
  123. v4.3.0 2018-04-06
  124. - Render feed for last feed_length day entries instead of for latest month
  125. - Switch example config from p1k3.com to example.com urls
  126. - feed_print() now takes a list of entries instead of a month
  127. v4.2.2 2018-02-10
  128. - Fix --config option to wrt-display & wrt-render-all
  129. - Remove year list from linkbar
  130. v4.2.1 2017-11-18
  131. - Change url_root default to /
  132. - Add url_root to topic link generator
  133. v4.2.0 2017-11-18
  134. - Improved documentation in shell utilities
  135. - Make a copy of %default before blessing
  136. - Document MethodSpit
  137. - Document the overlay option, add an accessor method for it
  138. - Use a logging callback to WRT::Renderer::render()
  139. - Miscellaneous test cleanup
  140. - Add publish_dir to example wrt.json
  141. - Improve documentation
  142. - Add $wrt->feed_alias and a .xml copy of same
  143. v4.1.0 2017-11-15
  144. - Add wrt-init for creating a skeleton project directory
  145. - Die on missing template file
  146. v4.0.1 2017-11-14
  147. - Fix App::WRT::Markup require of WRT::Image
  148. - Remove an unused dependency on Imager
  149. v4.0.0 2017-11-14
  150. - Rename WRT to App::WRT
  151. - Add a license info
  152. - Strip unused image size code from WRT::Image
  153. - Add publish_dir config value, ensure that dir exists when rendering
  154. - Add rendering tests
  155. v3.5.0 2017-11-13
  156. - wrt-render-all now handles /, /all, and /feed
  157. - Migrate wrt wrapper utilities to posix shell
  158. v3.4.2 2017-06-21
  159. - Add [0-9] to acceptable sub-entry characters
  160. v3.3.1 2017-06-19
  161. - Die on attempting to include a directory
  162. - Include datestamps in feed
  163. v3.3.0 2017-04-03
  164. - Add topic list to entries
  165. - List topics in datestamp
  166. - Clean up addprop output
  167. - Allow `-` in entry names, use .prop for properties
  168. - Simplify datestamps
  169. - Add wrt-noexpand property
  170. - Remove a sorta-extraneous trailing slash on contents
  171. v3.0.0 2016-10-12
  172. - Split wrt utility into git-style subcommands
  173. - Support for includes, change root_dir semantics, add entry_dir
  174. - addprop and findprop subcommands for dealing with entry properties
  175. v2.0.0 2016-08-09
  176. - Now called "wrt" instead of "display"
  177. - Extract http_header stuff from WRT module
  178. - Switch to wrt.json for configuration
  179. - Add XML::Feed and CGI::Fast to dependencies
  180. - Make wrt.fcgi work, more or less
  181. - Escape braces in variable interpolation regexp
  182. - Add --stdin flag