Ado::Manual::FiveMinutes - Start a personal blog in five minutes.
Within five minutes we will use Ado::Plugin::MarkdownRenderer and Ado::Control::Articles to create a personal blog.
Create a directory for 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 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 markdown_renderer.development.conf:
markdown_renderer.development.conf
{ #Do not convert files to HTML on every request #but reuse already produced html files. md_reuse_produced_html => 1, };
Refresh http://127.0.0.1:3000/articles/my_article.html. In ~/ado/public/articles You will find my_article.html. Congratulations! You created your first article with Ado without much ado.
~/ado/public/articles
my_article.html
Look at the source of Ado::Control::Articles to see how it works. Go to http://127.0.0.1:3000/ and play more or visit the links in the "SEE ALSO" section. Now you can fork the project on Github, improve menu.html.ep to automatically traverse the articles directory and generate the list of articles, then make a merge request. You just contributed to the project.
menu.html.ep
Ado::Manual, Ado, Mojolicious::Guides, "DEPLOYMENT" in Mojolicious::Guides::Cookbook, Ado::Command::generate::apache2htaccess
Copyright 2013-2015 Красимир Беров (Krasimir Berov).
This program is free software, you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License v3 (LGPL-3.0).
To install Ado, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ado
CPAN shell
perl -MCPAN -e shell install Ado
For more information on module installation, please visit the detailed CPAN module installation guide.