Ado

 view release on metacpan or  search on metacpan

lib/Ado/Manual/FiveMinutes.pod  view on Meta::CPAN

=encoding utf8

=head1 NAME

Ado::Manual::FiveMinutes - Start a personal blog in five minutes.

=head1 FIVE MINUTES

Within five minutes we will use L<Ado::Plugin::MarkdownRenderer> and
L<Ado::Control::Articles> to create a personal blog.

Create a directory for L<Ado> and install it in it.

  mkdir ~/ado
  curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -l ~/ado -n Ado

Start Ado in development mode.

  cd ~/ado
  morbo -w ./lib -w ./site_templates -w templates  bin/ado

You should see:

  Server available at http://127.0.0.1:3000

Open a new terminal window and create a markdown file that will contain your first
article. Or edit one of the already existing sample files there.

  touch ~/ado/public/articles/my_article.md
  vim ~/ado/public/articles/my_article.md

Eventually add a link to the newly created file (but with .html extension) to
the menu containing links to the articles which are "published". Copy the menu
template so it is not overwritten when you upgrade Ado.


  mkdir -p ~/ado/site_templates/articles
  cp ~/ado/templates/articles/menu.html.ep ~/ado/site_templates/articles/

  #edit ~/ado/site_templates/articles/menu.html.ep

  <a href="/articles/hello.html" class="item">История</a>
  <a href="/articles/ala/bala.html" class="item">FooBar</a>
  <!-- Add the next line to the templte. -->
  <a href="/articles/my_article.html" class="item">My Article</a>

Go to L<http://127.0.0.1:3000/articles/my_article.html>. Nice!

Enable caching of articles. The generated HTML will be stored as plain static
files which will be served automatically on every next request.

  touch ~/ado/etc/plugins/markdown_renderer.development.conf

Add the following code to C<markdown_renderer.development.conf>:

  {
      #Do not convert files to HTML on every request
      #but reuse already produced html files.
      md_reuse_produced_html => 1,
  };



( run in 0.900 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )