Computer Science
Algorithm
Data Processing
Digital Life
Distributed System
Distributed System Infrastructure
Machine Learning
Operating System
Android
Linux
MacOS
Tizen
Windows
iOS
Programming Language
C++
Erlang
Go
Scala
Scheme
Type System
Software Engineering
Storage
UI
Flutter
Javascript
Virtualization
Life
Life in Guangzhou (2013)
Recent Works (2013)
东京之旅 (2014)
My 2017 Year in Review (2018)
My 2020 in Review (2021)
十三年前被隔离的经历 (2022)
A Travel to Montreal (2022)
My 2022 in Review (2023)
Travel Back to China (2024)
Projects
Bard
Blog
Comment And Search Are Available (2012)
RSS Brain
Scala2grpc
Comment Everywhere (2013)
Fetch Popular Erlang Modules by Coffee Script (2013)
Psychology
耶鲁大学心理学导论 (2012)
Thoughts
Chinese
English

Comment And Search Are Available

Posted on 20 Nov 2012, tagged blogdisqusgoogle

As you can see, my blog are able to comment and search now!

Comment

I always think comment is very important for a blog. You can know how helpful or is there some issues in your article. Disqus is a great tool to put comment on a website. It is neat and powerful as you can see. It may be a little slow in China. But consider of my blog are mostly written in English, it is not a big deal.

The search engine I am using is Google custom search engine. Isn’t it awesome I have google’s technology on my blog? It is easy to use, too. The badness of this choice is google may take some time to put the website’s content into its index. And google is even not available in China sometimes.

Scripts to Make Life Easy

As I put the website on github page, I don’t want to upload the jekyll directory. Just the static site is enough. So I must copy the site to git repository, add, commit and then push it. It is a boring work. I write two scripts to make it easy. I don’t know if there is some other way to do this, but I’m OK with it.

update.sh: generate static site and upload to github.

#!/bin/bash

BASE_DIR=`pwd`
J_DIR="./jekyll"
GIT_DIR="./wb14123.github.com"

cd $J_DIR
jekyll
cd $BASE_DIR
rm -r $GIT_DIR/*
cp -r $J_DIR/_site/* $GIT_DIR/
cd $GIT_DIR
git add -A .
git commit -m "Changed at $(date)"
git push origin master
exit $?

newpost.sh: use vim to open a new post with current time and some meta information.

#!/bin/bash

if [ $# -lt 1 ]
then
    echo "newpost: You need to specify the post name."
    exit 1
fi

POST_NAME=$1
POST_DATE=`date +%Y-%m-%d`
POST_DIR="./jekyll/_posts"
FILE_NAME=`echo "$POST_DIR/$POST_DATE-$POST_NAME.md" | sed "s/ /-/g"`

echo "
---
layout: post
title: $POST_NAME
categories: misc
tags: []
---
" > $FILE_NAME

vim $FILE_NAME