jonathanpike / mako

A static-site generating RSS reader
MIT License
2 stars 0 forks source link

Mako πŸ₯› Build Status Coverage Status

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:

  1. RSS feeds are freely available, so reader software should be freely available.
  2. RSS feeds are part of the web, so reader software should be part of the web.

Installation

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.

  1. If you already have a directory that you want Mako to live in, run:

    $ mako new

  2. 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

Adding Feeds

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:

  1. OPML
  2. JSON
  3. Plain Text

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.

Subscribing to Additional Feeds

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!

Configuration

Mako has very few configuration options. You can see all of them in the comments in config.yaml.

Building your Site

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.

Themes

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:

Within your template, you can access the feed data through the feeds array. The feeds array contains feed objects, which have the following attributes:

To access the articles within a feed, you can use:

articles contain the following attributes:

When in doubt, check out the implementation of my theme.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jonathanpike/mako.

License

The gem is available as open source under the terms of the MIT License.