昨天写的帖子居然显示成 1910 年 >< 那时候还清朝呢 。。。
昨天写的帖子居然显示成 1910 年 >< 那时候还清朝呢 。。。
Using Nginx as a frontend for web apps has several advantages:
Steps to setup Nginx with Bamboo
http {
...
server {
listen 80;
server_name jinjing.funkymic.com;
location ~ ^/(theme|plugin|images|dl|media)/ {
root /home/jinjing/scm/git/haskell/jinjing-blog/public;
}
...
}
}
All it does is to let Nginx serve several sub paths under the blog's public path, e.g. public/theme.
http {
...
gzip on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 2;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_disable “MSIE [1-6].(?!.*SV1)”;
gzip_types
text/plain
text/html
text/xml
text/javascript
text/css
application/json
application/x-javascript
application/xml
application/xml+rss
;
...
server {
...
location / {
proxy_pass http://localhost:3000;
}
}
That's it.
I also use an in-house cache middleware to cache any response from the blog. Whenever I update a post, I remove the cache database. It's not ideal, but good enough for my stupid blog.
With this setup, there's no space leak, no file handles leaks and performance can be squeezed to above 350 requests/sec.
把手头能测的浏览器全测了:
就是没 IE,干脆不找了,肯定是乱的。
这个主题和原来的页面结构一样,不过内部是纯 HTML5 了,评论被阉割了,先这样。。
典型的没事找事。
I just released the second bamboo plugin: Photo!
It's a port of the previous photo-album plugin, I changed the syntax to be XML compatible, and the plugin now works at the middleware level.
Crap, I should have started my K-on project. I was extremely annoyed when I found that the current bamboo does not have this photo plugin capability, so here it is, another sleepless night.
The photo plugin, as the highlighting plugin, also uses the HXT library. Despite the complexity of HXT, I think it's a fairly good library: The abstraction is beautiful and working with it is a pleasure, though there was a steep learning curve for using the arrow abstraction.
Example:
< plugin
type="photo"
name="09-07-05 Project K on"
/>
I just separated bamboo into
So the engine can have multiple front-end, bamboo is also more lightweight :)
/==============================\
| code : 1436 |
| comment : 106 |
|------------------------------|
| ratio: |
| comment/code : 0.07 |
\==============================/
As a result, when bamboo is bootstrapped by bamboo-launcher, the launcher imports both bamboo and bamboo-theme-blueprint, and download the template db directory accordingly.
Some attention to software engineering makes bamboo -Wall -fno-warn-orphans clean.
A note on using theme, there are 3 parts from a theme:
site.txt:theme_name, you then put js and css config options inside db/config/theme/theme_name.txt, see db/config/theme/blueprint.txt for example. The reason to have a theme resource field in site.txt is to allow the theme to be configured without re-compililation, which might take some time. However, a theme is not required to use the resource field.db/public/theme/theme_name, e.g. db/public/theme/blueprint.So a theme is about both the code, that generates html, and static resources, referred from html. There could be a better approach, but I think separating code and data should be a pleasant experience.
The same applies to developing a theme, you need to provide both the code and data.
Finally the theme interface:
1 | |
I uploaded the newest bamboo to hackage, it is now in a very good shape to extend and customized.
I'm planing to do the following:
The last thing was what motivated me to do the rewrite, yes fakebook!
I'm going to rewrite Bamboo, here is what I have in mind: