Compare commits
No commits in common. "95fd30239ee8324a0fb23d70cd6ccd2c4e081ad1" and "a2285097fe0b16a7d892e2035583ca2eb37c643f" have entirely different histories.
95fd30239e
...
a2285097fe
19
README.md
19
README.md
@ -1,4 +1,5 @@
|
||||
# bob
|
||||

|
||||
|
||||
Bob is a small static generator, for those who wants to maintain a personal
|
||||
website or blog, all from the command line.
|
||||
@ -9,14 +10,26 @@ It only is designed in bash script, and should work perfectly fine on any Unix
|
||||
like machine.
|
||||
|
||||
```
|
||||
git clone https://git.simonpetit.top
|
||||
git clone https://github.com/SiwonP/bob.git
|
||||
cd bob
|
||||
sudo make install
|
||||
make install
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
To write a post, create a markdown file in the `drafts` folder whose name will
|
||||
For a start, to generate an empty blog, type in the following in the directory
|
||||
where you want to put your blog in and follow the guide.
|
||||
|
||||
```
|
||||
bob init
|
||||
```
|
||||
|
||||
It will create an `index.html` at the root of your folder, a `bases` folder in
|
||||
which you will store all the posts you want to publish and a `posts` folder
|
||||
where the resulting posts in html will be stored, and a `drafts` folder where to
|
||||
put drafts of posts before publishing them.
|
||||
|
||||
To write a post, create a markdown file in the `bases` folder whose name will
|
||||
also be its title, and convert it to an html file, type the following command
|
||||
from the root :
|
||||
|
||||
|
4
bob
4
bob
@ -82,8 +82,8 @@ publish()
|
||||
post=$(awk -f ${BOB_LIB}/markdown.awk ./drafts/$1.md)
|
||||
template="${BOB_LIB}/template/post.html"
|
||||
escaped_post=$(echo "$post" | sed 's/&/\\&/g')
|
||||
# awk -v content="$post" '{gsub(/{{article}}/, content); print}' "$template" > "./posts/$1.html"
|
||||
awk -v content="$escaped_post" '{gsub(/\{\{article\}\}/, content); print}' "$template" > "./posts/$1.html"
|
||||
# awk -v content="$post" '{gsub(/{{article}}/, content); print}' "$template" > "./posts/$1.html"
|
||||
awk -v content="$escaped_content" '{gsub(/\{\{article\}\}/, content); print}' "template" > "./posts/$1.html"
|
||||
mv ./drafts/$1.md ./drafts/published/$1.md
|
||||
|
||||
update_index
|
||||
|
Loading…
Reference in New Issue
Block a user