fix bug: blog preview not working, also fix some code formatting