App-Dapper
view release on metacpan or search on metacpan
```
#### [%- Chomp One -%]
Delete any whitespace up to the adjacent newline.
```
Quick.
[%- "Brown." -%]
Fox.
```
Result:
```
Quick.
Brown.
Fox.
```
#### [%= Chomp Collapse =%]
Collapse adjacent whitespace to a single space.
```
Quick.
[%= "Brown." =%]
Fox.
```
Result:
```
Quick. Brown. Fox.
```
#### [%~ Chomp Greedy ~%]
Remove all adjacent whitespace.
```
Quick.
[%~ "Brown." ~%]
Fox.
```
Result:
```
Quick.Brown.Fox.
```
## Dumping
The `dump` directive inserts a Data::Dumper printout of the variable or
expression. If no argument is passed it will dump the entire contents of the
current variable stash (with private keys removed). The output also includes the
current file and line number that the DUMP directive was called from. Example:
[% dump %] # dump everything
[% dump site %] # dump everything in the site
[% dump page %] # dump everything in the current page
# Publishing for Search Engines and AI
Dapper writes the files that help search engines, feed readers and AI tools
find and understand your site. Most need `url` in `_config.yml`, so that
links can be absolute.
## Sitemap
With `url` set, every build writes `/sitemap.xml`, listing every HTML page
(except a `404.html`, and pages with `sitemap: false`), with the date each
was last changed (`updated`, or `date`). Turn it off with `sitemap: false`
in `_config.yml`.
## Feed
`feed` in `_config.yml` turns on an Atom feed:
feed:
category: blog # leave out for every page with a category
path: /feed.xml # the default
limit: 20 # the default
title: My Blog # the default is the site's name
`feed: true` is a feed of every page with a category, with the defaults.
Each entry has the post's title, link, dates, summary and full content. If
a page in the source directory already writes the same file, it is used
instead.
## Redirects
When a page moves, keep its old address working with a redirect:
redirects:
/old-page/: /new-page/
/2019/announcement.html: /news/announcement/
in `_config.yml`, or the same pairs in `_data/redirects.yml` (which the MCP
server's `rename_page` tool keeps up to date). Dapper writes a small page at
each old address that sends browsers and search engines to the new one. If a
page still exists at an old address, the page wins, with a warning, and
`dapper check` reports redirects that lead nowhere.
## SEO tags
Put `[% page.seo %]` in your layout's `<head>`:
<head>
<meta charset="utf-8">
<title>[% page.title | html %]</title>
[% page.seo %]
</head>
( run in 0.653 second using v1.01-cache-2.11-cpan-c32d3c3b8f1 )