Git Product home page Git Product logo

tattoo's Introduction

#TATTOO!

##Demo

##Build & Install & Run

requirements

build & install

go get github.com/shellex/tattoo
go install github.com/shellex/tattoo

as a stand-alone server

cd to srv/ directory and run tattoo

with Fast-CGI

configure nginx (Fast-CGI)

add the following code to your nginx site config file to make it work:

location /static/ {
	expires 1d;
	root YOUR_BLOG_PATH;
	add_header Cache-Control  must-revalidate;
}
location /sys/static/ {
	expires 1d;
	root YOUR_BLOG_PATH;
	add_header Cache-Control  must-revalidate;
}
location / {
	root  YOUR_BLOG_PATH;
	expires 5m;
	add_header Cache-Control  must-revalidate;
	include fastcgi_params;
	fastcgi_param REQUEST_METHOD $request_method;
	fastcgi_param QUERY_STRING $query_string;
	fastcgi_param CONTENT_TYPE $content_type;
	fastcgi_param CONTENT_LENGTH $content_length;
	fastcgi_param GATEWAY_INTERFACE CGI/1.1;
	fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
	fastcgi_param REMOTE_ADDR $remote_addr;
	fastcgi_param REMOTE_PORT $remote_port;
	fastcgi_param SERVER_ADDR $server_addr;
	fastcgi_param SERVER_PORT $server_port;
	fastcgi_param SERVER_NAME $server_name;
	fastcgi_param SERVER_PROTOCOL $server_protocol;
	fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
	fastcgi_param PATH_INFO $fastcgi_script_name;
	fastcgi_pass 127.0.0.1:8887;
}

and then, run

./tattoo -fcgi

in srv/ directory.

Notes

The default configuration is currently hardcoded in conf.go; the admin user is "root" and the password is "42".

tattoo's People

Contributors

lyricat avatar salviati avatar xyproto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tattoo's Issues

[Question]

Greetings

As I can use it in a web hosting?

革命尚未成功,兄台仍需努力⋯

先说正题,程序还处于社会主义初级阶段,不少地方都比较粗糙。

做了一回小白鼠,摸索着go的写法,对现有的tag版本做了patch——主要目的是要兼容非独立域名模式下的各种URL的问题——水平有限,算是人肉列举被写死的地址有哪些吧(°_°)

请于此临时地址下载patch:http://static.snakevil.in/tattoo/assoc/patch.gz


然后扯远一点。我前些日子也在写一个类似的静态化的 md 的博客系统,中间碰着过年 & 玩游戏的时间都不够,就搁置了。如今看来, go 貌似不错,回头可以考虑从你这直接 fork 比较成型的版本。

说说我的思路,仅供参考:

  1. 使用 mercurial 来做文章的版本历史信息管理;

    不用 git 的原因是学习门槛太高,对于我老婆那样的想写博客又不懂技术的人而言,mercurial 了勉强接受,好歹还是在 windows 下, git 就完全无视了。

  2. 使用 mercurial hooks 在服务器端自动检出变更的文件;

  3. 使用 inotify-tools 监控检出文件所在目录,以更新静态化页面。

go1 环境 get 失败

14:26 [i4442 L0.16] # go get github.com/shellex/tattoo
# cd .; git clone https://github.com/shellex/tattoo /usr/local/go/src/pkg/github.com/shellex/tattoo
Cloning into /usr/local/go/src/pkg/github.com/shellex/tattoo...
fatal: https://github.com/shellex/tattoo/info/refs not found: did you run git update-server-info on the server?
package github.com/shellex/tattoo: exit status 128

import 路径的问题

您的用户名修改后,代码里还是import 原来的路径,需要修改成

github.com/lyricat/tattoo才行。

另外一些小建议

  1. 将所有用于生产的文件统一所在目录,如contrib

    目前什么文件都会直接在版本库的根目录产生,像我这样有洁癖的人很容易误删…

  2. 学习linux的软件文件生成规范

    bin/tattoo -> contrib/bin/tattoo
    settings.json -> contrib/etc/settings.json
    sys/static -> contrib/share/public
    sys/template -> contrib/var/theme/
    theme -> contrib/share/themes
    storage -> contrib/var/db

  3. 模板中会被更改的部分拆离到 contrib/var/theme 中

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.