Mako is a static-site generating RSS reader. Mako is also my son's name for milk.
I designed Mako with the following principals in mind:
To install Mako, do:
$ gem install mako_rss
Once the gem is installed, you'll need to generate a new Mako site. You can do this in 1 of 2 ways.
If you already have a directory that you want Mako to live in, run:
$ mako new
If you don't have a directory and want Mako to create on, run:
$ mako new path/to/directory
In your new Mako site, you'll see a directory structure like this:
.
βββ sample_subscriptions
| βββ subscriptions.json
| βββ subscriptions.txt
| βββ subscriptions.xml
βββ site
βββ themes
| βββ sass
| | βββ _fonts.scss
| | βββ _layout.scss
| | βββ _reboot.scss
| | βββ _utitilies.scss
| | βββ _variables.scss
| βββ simple.html.erb
| βββ simple.scss
βββ Gemfile
βββ config.yaml
Once Mako is installed and your Mako site has been created, the next step is to add your own feeds. Mako currently supports 3 formats:
In the sample_subscriptions
directory, you'll see an example of each format.
Whichever you choose, place the file in the root directory and be sure its name
is subscriptions
. The file extension (.xml
/.opml
, .json
, or .txt
)
will tell Mako what kind of subscription file you have.
If you already have imported your subscription file, and subsequently want to
subscribe to additional feeds, Mako has a handy subscribe
command to help you
out.
$ mako subscribe [url or urls]
It's generally best if you use the root URL of the site you would like to subscribe to, such as https://jonathanpike.net. Mako will look at the site, find a feed URL if it can, and add that URL to your subscription file. Easy!
Mako has very few configuration options. You can see all of them in the
comments in config.yaml
.
Once you've added your subscriptions, you can build your Mako site for the first
time. By default, Mako only builds the HTML portion of the site with the mako build
command. Since the CSS has not been generated, use the --with-sass
flag, like this:
$ mako build --with-sass
The built files will be present in the site
directory after the build
command has been run.
At present, Mako only displays the last 2 days worth of content from your feeds. If a feed has not been updated in the last 2 days, it will not be displayed on your Mako site. Similarly, articles that were published > 2 days in the past will not be displayed on your Mako site.
Mako comes with a simple theme of my own design (and own liking). Perhaps you want something different. Mako's themes are templated with ERB. You have access to the following convenience methods:
today
- Gives you the current date in Day, Date Month Year
format.last_updated
- Gives you the current date and time in day month year hour:minute:second
format.Within your template, you can access the feed data through the feeds
array.
The feeds
array contains feed
objects, which have the following attributes:
title
- a string of the feed title.url
- a string of the feed url.articles
- an array of the articles associated with the feed.To access the articles
within a feed
, you can use:
articles_desc
- sorts the array of articles by newest first.articles_asc
- sorts the array of articles by oldest first.articles
contain the following attributes:
title
- a string of the article title.url
- a string of the article url.published
- a Time
instance of the published date. Can also be accessed
by formatted_published
to get it as formatted string.summary
- a string of the article content.When in doubt, check out the implementation of my theme.
Bug reports and pull requests are welcome on GitHub at https://github.com/jonathanpike/mako.
The gem is available as open source under the terms of the MIT License.