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.

34 lines
880 B

17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 years ago
17 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".
5 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>${title_prefix}::${title}</title>
  5. <meta name="keywords" content="some test stuff" />
  6. <meta name="description" content="${description}" />
  7. <meta name="author" content="${author}" />
  8. <link rel="stylesheet" href="${stylesheet_url}" />
  9. <link rel="icon" type="image/x-png" href="${favicon_url}" />
  10. <link rel=alternate type="application/atom+xml" title="${title_prefix} atom feed" href="${url_root}${feed_alias}" />
  11. <link rel=feed type="application/atom+xml" title="${title_prefix} atom feed" href="${url_root}${feed_alias}" />
  12. <link rel="alternate" title="${title_prefix} JSON feed" type="application/json" href="${url_root}${feed_alias}.json" />
  13. </head>
  14. <body>
  15. <perl>
  16. return $self->link_bar();
  17. </perl>
  18. <h1>${title}</h1>
  19. ${content}
  20. <p><small><em>${license}</em></small></p>
  21. <p>${page_navigation}</p>
  22. </body>
  23. </html>