App-Dapper

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


    # Initialize a new website in the current directory
    $d->init();

    # Build the site
    $d->build();

    # Serve the site locally at http://localhost:8000
    $d->serve();

After installing Dapper, you can find documentation for this module with the
perldoc command.

    perldoc App::Dapper

# Appendix B: Debugging

With templating, it's easy to outsmart yourself and forget what variables are 
assigned to which collection and how that collection should be used in a 
template. Here is a way to debug that makes use of the `json` template filter 
built in to Dapper. The resulting page that we'll create displays all of the 
varialbes that are available for you to use.  

First, create a debug page in your `_source` directory:

    $ echo "" > _source/debug/index.html

Then, edit the file and fill it with this content:

```html
---
name: Debug
layout: plain
---

<!DOCTYPE html>
<html lang="en">
<head>
<title>Dapper Debug</title>
<style type="text/css" media="screen">
    #editor {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
</style>
</head>
<body>

<div id="editor">[% dump site | json(1)%]</div>

<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"
    type="text/javascript" charset="utf-8"></script>
<script>
    var editor = ace.edit("editor");
    editor.setTheme("ace/theme/text_mate");
    editor.getSession().setMode("ace/mode/json");
    editor.setReadOnly(true);
    window.setTimeout(function() {
        editor.getSession().foldAll(2,editor.session.getLength());
    }, 100);
</script>
</body>
</html>
```

Create a plain layout template:

    $ echo "[% page.content %]" > _layout/plain.html

Then, build your site and view the content locally at http://localhost:8000/debug/

# Appendix C: Internals

There are two importatn aspects of Dapper internals that are important
to understand. The first is that source files are rendered using the
templating system once, and then again after being combined with
a layout. This means that layout variables and directives can be used in source
files.

The second important thing to understand about Dapper internals is that
after all of the source files are rendered to output, Dapper does a
copy operation which copies things like binary files, images, or other
files that need to be transferred into the output directory but do not
need to be processed by Markdown or the templating system. The rules for what to 
copy are simple: everything is copied except for those things that match the
site.ignore list. By default, the following ignore list is used:

```
ignore :
    - "^\."
    - "^_"
    - "^dapper$"
```

More files and regular expression patterns may be specified in the project
configuration file. For instance, if you have a folder that holds your
design files and is called `design`, you might not want to have that copied
into the output directory. In this case, you would add the following lines
to your `_config.yml` file:

```
ignore :
    - "^design$"
```

# Author

Dapper was written by Mark Benson
[markbenson@vanilladraft.com](mailto:markbenson@vanilladraft.com).

# License and Copyright

The MIT License (MIT)

Copyright (c) 2002-2014 Mark Benson

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 4.088 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-f5108d614456 )