This blog is a static site implemented entirely using Scala.
Scala code and Sass scripts can be built with:
npm run build_production
# or
npm run build_dev
This will generate folder build
. The site only needs this folder and the
html files at project root to run.
Notes:
- This build is run by Grunt and build definitions are in
Gruntfile.js
. - We don't use sbt to build because it is too heavy, especially on laptops which doesn't have good specs.
- It is important that packages in
package.json
are declared independencies
section because Heroku will remove packages indevDependencies
before our build process completes.
To run, you can simply serve index.html
as a static site with a simple
http server like NPM http-server
Steps:
- push/merge/rebase to branch
master
- Travis CI will automatically build and push the result to branch
deploy
. - Heroku will automatically pull from this branch and deploy the app on its server.
- Use IntelliJ as an IDE for coding.
- Build the project.
- Assuming you are using http-server, serve the site with
http-server -p 3000 .
. - Type
localhost:3000
in your browser to see the site. After refresh, you should be able to see the updated site in your browser.
To have more control on how post content is displayed, I implement a parser that can work with my own customized Markdown syntax.
# H1
## H2
### H3
#### H4
##### H5
###### H6
**bold**
_italic_
Underscore syntax for bold text __bold__
and asterisk syntax for italic
text *italic*
are not supported.
Only unordered list is supported and there can be only 1 level for now.
- item 1
- item 2
Both inline and reference style are supported.
[inline link](google.com)
[reference link][ref]
[ref]: google.com
[cute dog](dog.jpg)
[cute dog][dog]
[dog]: dog.jpg
!youtube(https://youtu.be/Yifz3X_i-F8)
Both inline and block syntax are supported.
Inline `code` with backticks.
```scala
println("Hello world")
```
> line 1
> line 2