Textfi - simple blog tool written with Rails
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
config
db
lib
log
public change icon and minor fix for similar items. Aug 29, 2018
spec
test
vendor/assets
.gitignore
Gemfile
LICENSE
README.md
Rakefile
config.ru

README.md

Textfi

Textfi is simple blog tool written with Rails. current version works with Rails 4.2.

website http://textfi.com or https://github.com/yoosee/textfi

Installation

Initial install and Setup

First pull from github, then run bundle install. ruby and bundle should be installed.

% git clone https://github.com/yoosee/textfi.git
% cd textfi
% bundle install --path vendor/bundle --without development test

Setup Rails for production. It requires secret_key_base (config/secret.yml) which could be generated by following command.

% bundle exec rake secret

then setup environment value like below with the generated secret_key_base value.

export RAILS_ENV=production
export SECRET_KEY_BASE='<your_secret_key_base_here>'

Setup Database (Postgresql)

It's configured working with postgresql in Production. Please setup DB with table name 'textfi' and put configurations to environment values like below. For more details or customization, please see and edit config/database.yml.

export RAILS_PGSQL_USER=textfi
export RAILS_PGSQL_PASSWORD='<your_db_password_here>'

Run db:migrate when Databace configuration finished.

% rake db:migrate

Setup Web servers

Unicorn can be started by rake task which exists in lib/tasks/unicorn.rake. if you want to restart or stop, please replace 'start' with 'restart' or 'stop'.

% bundle exec rake unicorn:start

Setup Nginx or other HTTPD and connect it to Unicorn.

After the installation, access to http(s)://<your-base-url>/setup for registering first User and Blog, then login.

Basic Usage of writing Articles.

After logged in, click 'New Article' in 'Admin' dropdown to start writing an article. It will be visible from the internet when its status set to 'published'. Until then it'll be appeared in 'Drafts'.

Markdown

Article should be written in Markdown format. It supports PHP extension format of fenced_code_blocks, tables, etc.

Image upload and use in markdown

You can Drag & Drop image to the browser area for uploading images. When upload completed, you can see (id:N) on the image which can be used in markdown like ![Image Alt](id:N). You can review uploaded images from 'Media' link in dropdown menu.

Package dependencies

You need to install following applications/packages.

  • imagemagick - used by paperclip for converting image resize.
  • python-pygments - used by albino for colorizing code syntax.

External library dependencies (included in Gemfile and /vendor/assets)

Following libraries are used for the application. Those are already included or in Gemfile, no need to install individually.

  • paperclip - image uploader/handler in Rails.

  • Dropzone - Drag & Drop enabled image uploader.

  • acts-as-taggable-on - tag utility in Rails.

  • bootstrap-tagsinput - add Ajax capability to tag management.

Known issues (or Todo list)

  • There's no role & privilege control between User and Blog. It's all flat for now.
  • Several design components haven't yet been configurable (e.g. Blog image, CSS, HTML template, favicon.ico, etc.)
  • Blog distenguished by hostname, not baseurl itself.
  • Image size from Medium is not configurable.
  • Some JavaScript and CSS have loading issue (taggable, etc.)