Browse Source

handle sites with an index file in the root

- adds an example "flat" site with, for now, a single index in root for
    testing purposes
  - wrt-render-all handles default entry instead of just using "new"
  - EntryStore::all_renderable() correctly filters out paths ending in
    "/index" instead of "index", which if nothing else corrects a subtle
    bug that would have gotten in the way of naming something "windex"
  - WRT::handle() will return the contents of a root-level "index"
master v7.1.0
Brennen Bearnes 1 year ago
parent
commit
76c0e88d8b
78 changed files with 1216 additions and 29 deletions
  1. +6
    -0
      Changes
  2. +6
    -5
      README.md
  3. +0
    -0
      example/blog/archives/1952/2/13
  4. +0
    -0
      example/blog/archives/2012
  5. +0
    -0
      example/blog/archives/2013/1/index
  6. +0
    -0
      example/blog/archives/2013/2
  7. +0
    -0
      example/blog/archives/2013/foo.txt
  8. +0
    -0
      example/blog/archives/2013/index
  9. +0
    -0
      example/blog/archives/2014/1/1/index
  10. +0
    -0
      example/blog/archives/2014/1/1/test_entry
  11. +0
    -0
      example/blog/archives/2014/1/2/index
  12. +0
    -0
      example/blog/archives/2014/1/2/tag.something.prop
  13. +0
    -0
      example/blog/archives/icon_test/dir/index
  14. +0
    -0
      example/blog/archives/icon_test/dir/index.icon.png
  15. +0
    -0
      example/blog/archives/icon_test/dir/subentry
  16. +0
    -0
      example/blog/archives/icon_test/dir/subentry.icon.png
  17. +0
    -0
      example/blog/archives/icon_test/textfile
  18. +0
    -0
      example/blog/archives/icon_test/textfile.icon.png
  19. +0
    -0
      example/blog/archives/image_test/index
  20. +0
    -0
      example/blog/archives/image_test/machin_stderr.png
  21. +0
    -0
      example/blog/archives/include_test/index
  22. +0
    -0
      example/blog/archives/noexpand_test/do_not_expand_me
  23. +0
    -0
      example/blog/archives/noexpand_test/index
  24. +0
    -0
      example/blog/archives/noexpand_test/wrt-noexpand.prop
  25. +0
    -0
      example/blog/archives/prop_value_test/foo.prop
  26. +0
    -0
      example/blog/archives/tags_test/tag.animals.platypus.prop
  27. +0
    -0
      example/blog/archives/tags_test/tag.topics.example.prop
  28. +0
    -0
      example/blog/files/include_me
  29. +39
    -0
      example/blog/public/1952/2/13/index.html
  30. +39
    -0
      example/blog/public/1952/2/index.html
  31. +40
    -0
      example/blog/public/1952/index.html
  32. +34
    -0
      example/blog/public/2012/index.html
  33. +30
    -0
      example/blog/public/2013/1/index.html
  34. +30
    -0
      example/blog/public/2013/2/index.html
  35. +44
    -0
      example/blog/public/2013/index.html
  36. +42
    -0
      example/blog/public/2014/1/1/index.html
  37. +39
    -0
      example/blog/public/2014/1/1/test_entry/index.html
  38. +47
    -0
      example/blog/public/2014/1/2/index.html
  39. +0
    -0
      example/blog/public/2014/1/2/tag-something.prop
  40. +60
    -0
      example/blog/public/2014/1/index.html
  41. +42
    -0
      example/blog/public/2014/index.html
  42. +73
    -0
      example/blog/public/all/index.html
  43. +34
    -0
      example/blog/public/feed
  44. +34
    -0
      example/blog/public/feed.xml
  45. +48
    -0
      example/blog/public/icon_test/dir/index.html
  46. BIN
      example/blog/public/icon_test/dir/index.icon.png
  47. BIN
      example/blog/public/icon_test/dir/subentry.icon.png
  48. +42
    -0
      example/blog/public/icon_test/dir/subentry/index.html
  49. +52
    -0
      example/blog/public/icon_test/index.html
  50. BIN
      example/blog/public/icon_test/textfile.icon.png
  51. +41
    -0
      example/blog/public/icon_test/textfile/index.html
  52. +49
    -0
      example/blog/public/image_test/index.html
  53. BIN
      example/blog/public/image_test/machin_stderr.png
  54. +40
    -0
      example/blog/public/include_test/index.html
  55. +70
    -0
      example/blog/public/index.html
  56. +38
    -0
      example/blog/public/noexpand_test/do_not_expand_me/index.html
  57. +38
    -0
      example/blog/public/noexpand_test/index.html
  58. +0
    -0
      example/blog/public/noexpand_test/wrt-noexpand.prop
  59. +0
    -0
      example/blog/templates/default
  60. +0
    -0
      example/blog/wrt.json
  61. +3
    -0
      example/flat_site/pages/index
  62. +30
    -0
      example/flat_site/templates/default
  63. +17
    -0
      example/flat_site/wrt.json
  64. +18
    -4
      lib/App/WRT.pm
  65. +6
    -3
      lib/App/WRT/EntryStore.pm
  66. +28
    -0
      lib/App/WRT/FileIO.pm
  67. +6
    -2
      lib/App/WRT/Renderer.pm
  68. +2
    -2
      t/bin-wrt-feed.t
  69. +2
    -2
      t/bin-wrt-ls.t
  70. +2
    -2
      t/bin-wrt-render-all.t
  71. +1
    -1
      t/eval_perl.t
  72. +24
    -0
      t/root_index.t
  73. +1
    -1
      t/wrt.t
  74. +14
    -2
      t/wrt_entrystore.t
  75. +2
    -2
      t/wrt_fileio.t
  76. +1
    -1
      t/wrt_markup.t
  77. +1
    -1
      t/wrt_renderer.t
  78. +1
    -1
      t/wrt_util.t

+ 6
- 0
Changes View File

@ -1,5 +1,11 @@
Revision history for App::WRT
v7.1.0 2020-04-18
- Add some handling for sites with an index file in the root
- wrt-render-all now uses the configured default for root of site instead
of "new"
v7.0.0 2020-04-04
- Add a full tagging system


+ 6
- 5
README.md View File

@ -14,9 +14,11 @@ wrt can be found at:
- [metacpan.org as App::WRT](https://metacpan.org/pod/App::WRT) - latest CPAN release
- https://code.p1k3.com/gitea/brennen/wrt - latest code
I have been using some version of this code to publish
[p1k3](https://p1k3.com/) since 2001, and have written [various posts about
it](https://p1k3.com/topics/wrt/) over the years.
I have been using some version of this code to publish [p1k3][p1k3] since 2001,
and have written [various posts about it][p1k3-wrt] over the years.
[p1k3]: https://p1k3.com/
[p1k3-wrt]: https://p1k3.com/topics/wrt/
installation and use
====================
@ -49,7 +51,7 @@ Starting a new site once installed:
mkdir project && cd project
wrt init
# Edit an entry for January 1, 2019:
# Create an entry for January 1, 2019:
mkdir -p archives/2019/1/
nano archives/2019/1/1
@ -93,4 +95,3 @@ PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/

example/archives/1952/2/13 → example/blog/archives/1952/2/13 View File


example/archives/2012 → example/blog/archives/2012 View File


example/archives/2013/1/index → example/blog/archives/2013/1/index View File


example/archives/2013/2 → example/blog/archives/2013/2 View File


example/archives/2013/foo.txt → example/blog/archives/2013/foo.txt View File


example/archives/2013/index → example/blog/archives/2013/index View File


example/archives/2014/1/1/index → example/blog/archives/2014/1/1/index View File


example/archives/2014/1/1/test_entry → example/blog/archives/2014/1/1/test_entry View File


example/archives/2014/1/2/index → example/blog/archives/2014/1/2/index View File


example/archives/2014/1/2/tag.something.prop → example/blog/archives/2014/1/2/tag.something.prop View File


example/archives/icon_test/dir/index → example/blog/archives/icon_test/dir/index View File


example/archives/icon_test/dir/index.icon.png → example/blog/archives/icon_test/dir/index.icon.png View File


example/archives/icon_test/dir/subentry → example/blog/archives/icon_test/dir/subentry View File


example/archives/icon_test/dir/subentry.icon.png → example/blog/archives/icon_test/dir/subentry.icon.png View File


example/archives/icon_test/textfile → example/blog/archives/icon_test/textfile View File


example/archives/icon_test/textfile.icon.png → example/blog/archives/icon_test/textfile.icon.png View File


example/archives/image_test/index → example/blog/archives/image_test/index View File


example/archives/image_test/machin_stderr.png → example/blog/archives/image_test/machin_stderr.png View File


example/archives/include_test/index → example/blog/archives/include_test/index View File


example/archives/noexpand_test/do_not_expand_me → example/blog/archives/noexpand_test/do_not_expand_me View File


example/archives/noexpand_test/index → example/blog/archives/noexpand_test/index View File


example/archives/noexpand_test/wrt-noexpand.prop → example/blog/archives/noexpand_test/wrt-noexpand.prop View File


example/archives/prop_value_test/foo.prop → example/blog/archives/prop_value_test/foo.prop View File


example/archives/tags_test/tag.animals.platypus.prop → example/blog/archives/tags_test/tag.animals.platypus.prop View File


example/archives/tags_test/tag.topics.example.prop → example/blog/archives/tags_test/tag.topics.example.prop View File


example/files/include_me → example/blog/files/include_me View File


+ 39
- 0
example/blog/public/1952/2/13/index.html View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::1952/2/13</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>1952/2/13</h1>
<article><div class="entry"><p>I still miss you.</p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/1952/" title="1952">1952</a> /
<a href="https://example.com/1952/2/" title="2">2</a> /
<a href="https://example.com/1952/2/13/" title="13">13</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 39
- 0
example/blog/public/1952/2/index.html View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::1952/2</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>1952/2</h1>
<article><div class="entry"><p>I still miss you.</p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/1952/" title="1952">1952</a> /
<a href="https://example.com/1952/2/" title="2">2</a> /
<a href="https://example.com/1952/2/13/" title="13">13</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 40
- 0
example/blog/public/1952/index.html View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::1952</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>1952</h1>
<article><div class="entry"><h3>1952</h3>
<table><tr><td class="datelink"><a href="https://example.com/1952/2/">February</a></td>
<td class="datelink"><small>( <a href="https://example.com/1952/2/13/">13</a>
)</small></td></tr>
<tr><td>1 entry</td></tr></table>
</div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 34
- 0
example/blog/public/2012/index.html View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::2012</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>2012</h1>
<article><div class="entry"><p>I'm a year which is just a flatfile.</p>
</div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 30
- 0
example/blog/public/2013/1/index.html View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::2013/1</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>2013/1</h1>
<p>I'm a month which has an index file.</p>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 30
- 0
example/blog/public/2013/2/index.html View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::2013/2</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>2013/2</h1>
<p>I'm a month which is just a flatfile.</p>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 44
- 0
example/blog/public/2013/index.html View File

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::2013</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>2013</h1>
<article><div class="entry"><p>I'm an index file for an entire year.</p>
<p><em>more:</em> <a href="https://example.com/2013/1" title="1">1</a> <a href="https://example.com/2013/2" title="2">2</a></p>
<h3>2013</h3>
<table><tr><td class="datelink"><a href="https://example.com/2013/2/">February</a></td>
<td class="datelink"><small>( )</small></td></tr>
<tr><td class="datelink"><a href="https://example.com/2013/1/">January</a></td>
<td class="datelink"><small>( )</small></td></tr>
<tr><td>No entries</td></tr></table>
</div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 42
- 0
example/blog/public/2014/1/1/index.html View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::2014/1/1</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>2014/1/1</h1>
<article><div class="entry"><h1>Wednesday, January 1</h1>
<p>Test.</p>
<p class="centerpiece">+</p><p><em>more:</em> <a href="https://example.com/2014/1/1/test_entry" title="test_entry">test_entry</a></p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/1/" title="1">1</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 39
- 0
example/blog/public/2014/1/1/test_entry/index.html View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::2014/1/1/test_entry</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>2014/1/1/test_entry</h1>
<article><div class="entry"><p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/1/" title="1">1</a> /
<a href="https://example.com/2014/1/1/test_entry/" title="test_entry">test_entry</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 47
- 0
example/blog/public/2014/1/2/index.html View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::2014/1/2</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>2014/1/2</h1>
<article><div class="entry"><h1>Thursday, January 2</h1>
<p>Test.</p>
<p class="centerpiece"></p>
<p>Test more.</p>
<p class="datelink">
<a href="https://example.com/topics/something">something</a> :: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/2/" title="2">2</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 0
- 0
example/blog/public/2014/1/2/tag-something.prop View File


+ 60
- 0
example/blog/public/2014/1/index.html View File

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::2014/1</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>2014/1</h1>
<article><div class="entry"><h1>Thursday, January 2</h1>
<p>Test.</p>
<p class="centerpiece"></p>
<p>Test more.</p>
<p class="datelink">
<a href="https://example.com/topics/something">something</a> :: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/2/" title="2">2</a>
</p></div></article>
<article><div class="entry"><h1>Wednesday, January 1</h1>
<p>Test.</p>
<p><em>more:</em> <a href="https://example.com/2014/1/1/test_entry" title="test_entry">test_entry</a></p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/1/" title="1">1</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 42
- 0
example/blog/public/2014/index.html View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::2014</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>2014</h1>
<article><div class="entry"><h3>2014</h3>
<table><tr><td class="datelink"><a href="https://example.com/2014/1/">January</a></td>
<td class="datelink"><small>( <a href="https://example.com/2014/1/1/">1</a>
<a href="https://example.com/2014/1/2/">2</a>
)</small></td></tr>
<tr><td>1 months</td>
<td>2 entries</td></tr></table>
</div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 73
- 0
example/blog/public/all/index.html View File

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::all</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<strong><a href="https://example.com/all/" title="all entries">all</a>
</strong>
<h1>all</h1>
<article><div class="entry"><h3>2014</h3>
<table><tr><td class="datelink"><a href="https://example.com/2014/1/">January</a></td>
<td class="datelink"><small>( <a href="https://example.com/2014/1/1/">1</a>
<a href="https://example.com/2014/1/2/">2</a>
)</small></td></tr>
<tr><td>1 months</td>
<td>2 entries</td></tr></table>
</div></article>
<article><div class="entry"><p>I'm an index file for an entire year.</p>
<p><em>more:</em> <a href="https://example.com/2013/1" title="1">1</a> <a href="https://example.com/2013/2" title="2">2</a></p>
<h3>2013</h3>
<table><tr><td class="datelink"><a href="https://example.com/2013/2/">February</a></td>
<td class="datelink"><small>( )</small></td></tr>
<tr><td class="datelink"><a href="https://example.com/2013/1/">January</a></td>
<td class="datelink"><small>( )</small></td></tr>
<tr><td>No entries</td></tr></table>
</div></article>
<article><div class="entry"><p>I'm a year which is just a flatfile.</p>
</div></article>
<article><div class="entry"><h3>1952</h3>
<table><tr><td class="datelink"><a href="https://example.com/1952/2/">February</a></td>
<td class="datelink"><small>( <a href="https://example.com/1952/2/13/">13</a>
)</small></td></tr>
<tr><td>1 entry</td></tr></table>
</div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 34
- 0
example/blog/public/feed View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>wrt::feed</title><subtitle>a test wrt site</subtitle><link href="https://example.com/"/><link href="https://example.com/feed" rel="self"/><icon>https://example.com/favicon.png</icon><author><name>Example Author</name></author><id>https://example.com/</id><generator>App::WRT.pm / XML::Atom::SimpleFeed</generator><updated>2019-04-14T16:38:40Z</updated><entry><title>Thursday, January 2</title><link href="https://example.com/2014/1/2"/><id>https://example.com/2014/1/2</id><content type="html">&lt;h1&gt;Thursday, January 2&lt;/h1&gt;
&lt;p&gt;Test.&lt;/p&gt;
&lt;p class=&#34;centerpiece&#34;&gt; ✨ &lt;/p&gt;
&lt;p&gt;Test more.&lt;/p&gt;
&lt;p class=&#34;datelink&#34;&gt;
&lt;a href=&#34;https://example.com/topics/something&#34;&gt;something&lt;/a&gt; :: &lt;a href=&#34;https://example.com/&#34;&gt;wrt&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/&#34; title=&#34;2014&#34;&gt;2014&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/1/&#34; title=&#34;1&#34;&gt;1&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/1/2/&#34; title=&#34;2&#34;&gt;2&lt;/a&gt;
&lt;/p&gt;</content><updated>2019-04-14T16:38:40Z</updated></entry><entry><title>Wednesday, January 1</title><link href="https://example.com/2014/1/1"/><id>https://example.com/2014/1/1</id><content type="html">&lt;h1&gt;Wednesday, January 1&lt;/h1&gt;
&lt;p&gt;Test.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;more:&lt;/em&gt; &lt;a href=&#34;https://example.com/2014/1/1/test_entry&#34; title=&#34;test_entry&#34;&gt;test_entry&lt;/a&gt;&lt;/p&gt;
&lt;p class=&#34;datelink&#34;&gt;
:: &lt;a href=&#34;https://example.com/&#34;&gt;wrt&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/&#34; title=&#34;2014&#34;&gt;2014&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/1/&#34; title=&#34;1&#34;&gt;1&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/1/1/&#34; title=&#34;1&#34;&gt;1&lt;/a&gt;
&lt;/p&gt;</content><updated>2018-05-26T15:34:13Z</updated></entry><entry><title>1952/2/13</title><link href="https://example.com/1952/2/13"/><id>https://example.com/1952/2/13</id><content type="html">&lt;p&gt;I still miss you.&lt;/p&gt;
&lt;p class=&#34;datelink&#34;&gt;
:: &lt;a href=&#34;https://example.com/&#34;&gt;wrt&lt;/a&gt; /
&lt;a href=&#34;https://example.com/1952/&#34; title=&#34;1952&#34;&gt;1952&lt;/a&gt; /
&lt;a href=&#34;https://example.com/1952/2/&#34; title=&#34;2&#34;&gt;2&lt;/a&gt; /
&lt;a href=&#34;https://example.com/1952/2/13/&#34; title=&#34;13&#34;&gt;13&lt;/a&gt;
&lt;/p&gt;</content><updated>2019-05-16T21:48:56Z</updated></entry></feed>

+ 34
- 0
example/blog/public/feed.xml View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>wrt::feed</title><subtitle>a test wrt site</subtitle><link href="https://example.com/"/><link href="https://example.com/feed" rel="self"/><icon>https://example.com/favicon.png</icon><author><name>Example Author</name></author><id>https://example.com/</id><generator>App::WRT.pm / XML::Atom::SimpleFeed</generator><updated>2019-04-14T16:38:40Z</updated><entry><title>Thursday, January 2</title><link href="https://example.com/2014/1/2"/><id>https://example.com/2014/1/2</id><content type="html">&lt;h1&gt;Thursday, January 2&lt;/h1&gt;
&lt;p&gt;Test.&lt;/p&gt;
&lt;p class=&#34;centerpiece&#34;&gt;&lt;/p&gt;
&lt;p&gt;Test more.&lt;/p&gt;
&lt;p class=&#34;datelink&#34;&gt;
&lt;a href=&#34;https://example.com/topics/something&#34;&gt;something&lt;/a&gt; :: &lt;a href=&#34;https://example.com/&#34;&gt;wrt&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/&#34; title=&#34;2014&#34;&gt;2014&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/1/&#34; title=&#34;1&#34;&gt;1&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/1/2/&#34; title=&#34;2&#34;&gt;2&lt;/a&gt;
&lt;/p&gt;</content><updated>2019-04-14T16:38:40Z</updated></entry><entry><title>Wednesday, January 1</title><link href="https://example.com/2014/1/1"/><id>https://example.com/2014/1/1</id><content type="html">&lt;h1&gt;Wednesday, January 1&lt;/h1&gt;
&lt;p&gt;Test.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;more:&lt;/em&gt; &lt;a href=&#34;https://example.com/2014/1/1/test_entry&#34; title=&#34;test_entry&#34;&gt;test_entry&lt;/a&gt;&lt;/p&gt;
&lt;p class=&#34;datelink&#34;&gt;
:: &lt;a href=&#34;https://example.com/&#34;&gt;wrt&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/&#34; title=&#34;2014&#34;&gt;2014&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/1/&#34; title=&#34;1&#34;&gt;1&lt;/a&gt; /
&lt;a href=&#34;https://example.com/2014/1/1/&#34; title=&#34;1&#34;&gt;1&lt;/a&gt;
&lt;/p&gt;</content><updated>2018-05-26T15:34:13Z</updated></entry><entry><title>1952/2/13</title><link href="https://example.com/1952/2/13"/><id>https://example.com/1952/2/13</id><content type="html">&lt;p&gt;I still miss you.&lt;/p&gt;
&lt;p class=&#34;datelink&#34;&gt;
:: &lt;a href=&#34;https://example.com/&#34;&gt;wrt&lt;/a&gt; /
&lt;a href=&#34;https://example.com/1952/&#34; title=&#34;1952&#34;&gt;1952&lt;/a&gt; /
&lt;a href=&#34;https://example.com/1952/2/&#34; title=&#34;2&#34;&gt;2&lt;/a&gt; /
&lt;a href=&#34;https://example.com/1952/2/13/&#34; title=&#34;13&#34;&gt;13&lt;/a&gt;
&lt;/p&gt;</content><updated>2019-05-16T21:48:56Z</updated></entry></feed>

+ 48
- 0
example/blog/public/icon_test/dir/index.html View File

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::icon_test/dir</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>icon_test/dir</h1>
<article><div class="entry"><h2><img src="https://example.com/icon_test/dir/index.icon.png"
width="48" height="58"
alt="" /></h2>
<p class="centerpiece">+</p><h2><img src="https://example.com/icon_test/dir/subentry.icon.png"
width="48" height="58"
alt="" /></h2>
<p><em>more:</em> <a href="https://example.com/icon_test/dir/subentry" title="subentry"><img src="https://example.com/icon_test/dir/subentry.icon.png"
width="48" height="58"
alt="subentry" /></a></p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/icon_test/" title="icon_test">icon_test</a> /
<a href="https://example.com/icon_test/dir/" title="dir">dir</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

BIN
example/blog/public/icon_test/dir/index.icon.png View File

Before After
Width: 48  |  Height: 58  |  Size: 1.7 KiB

BIN
example/blog/public/icon_test/dir/subentry.icon.png View File

Before After
Width: 48  |  Height: 58  |  Size: 1.7 KiB

+ 42
- 0
example/blog/public/icon_test/dir/subentry/index.html View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::icon_test/dir/subentry</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>icon_test/dir/subentry</h1>
<article><div class="entry"><h2><img src="https://example.com/icon_test/dir/subentry.icon.png"
width="48" height="58"
alt="" /></h2>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/icon_test/" title="icon_test">icon_test</a> /
<a href="https://example.com/icon_test/dir/" title="dir">dir</a> /
<a href="https://example.com/icon_test/dir/subentry/" title="subentry">subentry</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 52
- 0
example/blog/public/icon_test/index.html View File

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::icon_test</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>icon_test</h1>
<article><div class="entry"><p class="centerpiece">+</p><h2><img src="https://example.com/icon_test/dir/index.icon.png"
width="48" height="58"
alt="" /></h2>
<p><em>more:</em> <a href="https://example.com/icon_test/dir/subentry" title="subentry"><img src="https://example.com/icon_test/dir/subentry.icon.png"
width="48" height="58"
alt="subentry" /></a></p>
<p class="centerpiece">+</p><h2><img src="https://example.com/icon_test/textfile.icon.png"
width="48" height="58"
alt="" /></h2>
<p><em>more:</em> <a href="https://example.com/icon_test/dir" title="dir"><img src="https://example.com/icon_test/dir/index.icon.png"
width="48" height="58"
alt="dir" /></a> <a href="https://example.com/icon_test/textfile" title="textfile"><img src="https://example.com/icon_test/textfile.icon.png"
width="48" height="58"
alt="textfile" /></a></p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/icon_test/" title="icon_test">icon_test</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

BIN
example/blog/public/icon_test/textfile.icon.png View File

Before After
Width: 48  |  Height: 58  |  Size: 1.7 KiB

+ 41
- 0
example/blog/public/icon_test/textfile/index.html View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::icon_test/textfile</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>icon_test/textfile</h1>
<article><div class="entry"><h2><img src="https://example.com/icon_test/textfile.icon.png"
width="48" height="58"
alt="" /></h2>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/icon_test/" title="icon_test">icon_test</a> /
<a href="https://example.com/icon_test/textfile/" title="textfile">textfile</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 49
- 0
example/blog/public/image_test/index.html View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::image_test</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>image_test</h1>
<article><div class="entry"><h1>image test</h1>
<p>The following image tag should correctly point to machin_stderr.png from the
URL root, have dimensions, and use the provided alt/title text.</p>
<p>
<img src="https://example.com/image_test/machin_stderr.png"
width="900"
height="900"
alt="a test image"
title="a test image" />
</p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/image_test/" title="image_test">image_test</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

BIN
example/blog/public/image_test/machin_stderr.png View File

Before After
Width: 900  |  Height: 900  |  Size: 88 KiB

+ 40
- 0
example/blog/public/include_test/index.html View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::include_test</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>include_test</h1>
<article><div class="entry"><h1>wrt include test</h1>
<p>This content included from elsewhere.</p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/include_test/" title="include_test">include_test</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 70
- 0
example/blog/public/index.html View File

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::new</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<strong><a href="https://example.com/" title="newest entries">new</a>
</strong><a href="https://example.com/all/" title="all entries">all</a>
<h1>new</h1>
<article><div class="entry"><h1>Thursday, January 2</h1>
<p>Test.</p>
<p class="centerpiece"></p>
<p>Test more.</p>
<p class="datelink">
<a href="https://example.com/topics/something">something</a> :: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/2/" title="2">2</a>
</p></div></article>
<article><div class="entry"><h1>Wednesday, January 1</h1>
<p>Test.</p>
<p class="centerpiece">+</p><p><em>more:</em> <a href="https://example.com/2014/1/1/test_entry" title="test_entry">test_entry</a></p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/1/" title="1">1</a>
</p></div></article>
<article><div class="entry"><p>I still miss you.</p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/1952/" title="1952">1952</a> /
<a href="https://example.com/1952/2/" title="2">2</a> /
<a href="https://example.com/1952/2/13/" title="13">13</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 38
- 0
example/blog/public/noexpand_test/do_not_expand_me/index.html View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::noexpand_test/do_not_expand_me</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>noexpand_test/do_not_expand_me</h1>
<article><div class="entry"><p>SHOULD NOT DISPLAY</p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/noexpand_test/" title="noexpand_test">noexpand_test</a> /
<a href="https://example.com/noexpand_test/do_not_expand_me/" title="do_not_expand_me">do_not_expand_me</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 38
- 0
example/blog/public/noexpand_test/index.html View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<title>wrt::noexpand_test</title>
<meta name="keywords" content="some test stuff" />
<meta name="description" content="a test wrt site" />
<meta name="author" content="Example Author" />
<link rel="stylesheet" href="https://example.com/css/p1k3.css" />
<link rel="icon" type="image/x-png" href="https://example.com/favicon.png" />
</head>
<body>
<a href="https://example.com/" title="newest entries">new</a>
<a href="https://example.com/all/" title="all entries">all</a>
<h1>noexpand_test</h1>
<article><div class="entry"><p>SHOULD DISPLAY</p>
<p><em>more:</em> <a href="https://example.com/noexpand_test/do_not_expand_me" title="do_not_expand_me">do_not_expand_me</a></p>
<p class="datelink">
:: <a href="https://example.com/">wrt</a> /
<a href="https://example.com/noexpand_test/" title="noexpand_test">noexpand_test</a>
</p></div></article>
<p><small><em>public domain</em></small></p>
</body>
</html>

+ 0
- 0
example/blog/public/noexpand_test/wrt-noexpand.prop View File


example/templates/default → example/blog/templates/default View File


example/wrt.json → example/blog/wrt.json View File


+ 3
- 0
example/flat_site/pages/index View File

@ -0,0 +1,3 @@
<h1>a static site</h1>
<p>I am the front page.</p>

+ 30
- 0
example/flat_site/templates/default View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>${title_prefix}::${title}</title>
<meta name="keywords" content="keywords here" />
<meta name="description" content="${description}" />
<meta name="author" content="${author}" />
<link rel="stylesheet" href="${stylesheet_url}" />
<link rel="icon" type="image/x-png" href="${favicon_url}" />
<link rel=alternate type="application/atom+xml" title="${title_prefix} atom feed" href="${url_root}${feed_alias}" />
<link rel=feed type="application/atom+xml" title="${title_prefix} atom feed" href="${url_root}${feed_alias}" />
<link rel="alternate" title="${title_prefix} JSON feed" type="application/json" href="${url_root}${feed_alias}.json" />
</head>
<body>
<perl>
return $self->link_bar();
</perl>
<h1>${title}</h1>
${content}
${page_navigation}
<p><small><em>${license}</em></small></p>
</body>
</html>

+ 17
- 0
example/flat_site/wrt.json View File

@ -0,0 +1,17 @@
{
"entry_dir": "./pages",
"publish_dir": "./public",
"title_prefix": "a test wrt site",
"template": "default",
"description": "a wrt site",
"url_root": "https://example.com/",
"image_url_root": "https://example.com/",
"favicon_url": "https://example.com/favicon.png",
"template_dir": "./templates",
"stylesheet_url": "https://example.com/css/wrt.css",
"author": "Your Name Here",
"entry_descriptions": {
"new": "newest entries",
"all": "all entries"
}
}

+ 18
- 4
lib/App/WRT.pm View File

@ -542,7 +542,7 @@ sub populate_metadata_cache {
=item display($entry1, $entry2, ...)
Return a string containing the given entries, which are in the form of
date/entry strings. If no parameters are given, default to default_entry().
date/entry strings. If no parameters are given, default to C<default_entry>.
display() expands aliases ("new" and "all", for example) as necessary, collects
entry content and metadata from the pre-rendered HTML caches, and wraps
@ -561,8 +561,14 @@ sub display {
return $self->{overlay} if defined $self->{overlay};
# If no entries are defined, fall back to the default:
$entries[0] //= $self->{default_entry};
# If no entries are defined, either...
if ($self->{entries}->is_extant('index')) {
# Fall back to the existing index file:
$entries[0] = 'index';
} else {
# Or use the default:
$entries[0] //= $self->{default_entry};
}
# Title and navigation for template:
$self->{page_navigation} = '';
@ -587,6 +593,13 @@ sub display {
. '</div>'
} @entries;
# TODO: There may be an optimization to be had below in only running
# line_parse() against the template when the source is stashed. This would
# also lead to confusing weirdness if the template contained any special
# markup besides an <include> or relied on any side effects of embedded Perl
# code. For now, I'm leaving it alone.
# Evaluate the template much like an entry:
return $self->line_parse(
$self->eval_perl($self->{template_source}),
$self->{template_path}
@ -609,12 +622,13 @@ sub handle {
my ($self, $entry) = @_;
for ($entry) {
if ($_ eq 'index' ) { return entry(@_); }
if (m'^[\d/]+[[:lower:]_/]+$') { return entry_stamped(@_, 'index'); }
if (m'^\d+/\d{1,2}/\d{1,2}$' ) { return entry_stamped(@_, 'all'); }
if (m'^\d+/\d{1,2}$' ) { return month(@_); }
if (m'^\d+$' ) { return year(@_); }
if (m'^[[:lower:]_]' ) { return entry_stamped(@_, 'index'); }
}
}
}
=item expand_alias($option)


+ 6
- 3
lib/App/WRT/EntryStore.pm View File

@ -178,17 +178,20 @@ sub all {
=item all_renderable()
Returns a list of all source paths which are considered "renderable".
Returns a list of all existing source paths which are considered "renderable".
A path should match C<$RENDERABLE_EXPR> and not be an index file.
=cut
sub all_renderable() {
my ($self) = shift;
return grep {
(index($_, 'index', -5) == -1)
(index($_, '/index', -6) == -1)
&&
m/$RENDERABLE_EXPR/
} @{ $self->{entries} }; }
} @{ $self->{entries} };
}
=item dates_by_depth($depth)


+ 28
- 0
lib/App/WRT/FileIO.pm View File

@ -43,6 +43,34 @@ sub new {
bless $self, $class;
}
=item is_dir($path)
=cut
sub is_dir {
return -d $_[0];
}
=item is_regular_file($path)
=cut
sub is_regular_file {
return -f $_[0];
}
=item exists($path)
=cut
sub exists {
return -e $_[0];
}
=item dir_list($dir, $sort_order, $pattern)
Return a $sort_order sorted list of files matching regex $pattern in a


+ 6
- 2
lib/App/WRT/Renderer.pm View File

@ -93,8 +93,12 @@ sub render {
}
}
# Handle the front page and Atom feed:
$self->write("${publish_dir}/index.html", $self->{wrt}->display('new'));
# Handle the front page. With no entries given, display() will use the
# configured default, which is probably "new" unless the user has changed it.
$self->write(
"${publish_dir}/index.html",
$self->{wrt}->display()
);
# Handle feed formats:
my $feed_alias = $self->{wrt}->{feed_alias};


+ 2
- 2
t/bin-wrt-feed.t View File

@ -10,8 +10,8 @@ use lib 'lib';
use Encode;
use Test::More tests => 2;
chdir 'example';
require_ok('../bin/wrt-feed');
chdir 'example/blog';
require_ok('../../bin/wrt-feed');
my $output_string;
my $output = sub {


+ 2
- 2
t/bin-wrt-ls.t View File

@ -10,8 +10,8 @@ use lib 'lib';
use Encode;
use Test::More tests => 6;
chdir 'example';
require_ok('../bin/wrt-ls');
chdir 'example/blog';
require_ok('../../bin/wrt-ls');
my $output_string;
my $output = sub {


+ 2
- 2
t/bin-wrt-render-all.t View File

@ -11,8 +11,8 @@ use Encode;
use Test::More tests => 3;
use App::WRT::Mock::FileIO;
chdir 'example';
require_ok('../bin/wrt-render-all');
chdir 'example/blog';
require_ok('../../bin/wrt-render-all');
my $output_string;
my $output = sub {


+ 1
- 1
t/eval_perl.t View File

@ -7,7 +7,7 @@ use lib 'lib';
use Test::Simple tests => 1; # last test to print
use App::WRT;
chdir 'example';
chdir 'example/blog';
my $w = App::WRT::new_from_file('wrt.json');
# 'configuration';


+ 24
- 0
t/root_index.t View File

@ -0,0 +1,24 @@
#!/usr/bin/env perl
use strict;
use warnings;
use lib 'lib';
use Data::Dumper;
use Test::More tests => 2;
use App::WRT;
# Check that we can handle a site with an "index" file in the archive root.
chdir 'example/flat_site';
ok(
my $w = App::WRT::new_from_file('wrt.json'),
"got WRT object for a site with root index"
);
ok(
$w->display() =~ m/front page/,
'front page contains index contents'
);

+ 1
- 1
t/wrt.t View File

@ -15,7 +15,7 @@ use Test::More tests => 19;
require_ok('App::WRT');
chdir 'example';
chdir 'example/blog';
# configuration


+ 14
- 2
t/wrt_entrystore.t View File

@ -6,10 +6,10 @@ use warnings;
use lib 'lib';
use Data::Dumper;
use Test::More tests => 32;
use Test::More tests => 34;
use App::WRT;
chdir 'example';
chdir 'example/blog';
my $es = App::WRT::EntryStore->new('archives');