Scipt to launch jekyll server inside tmux session

Script to launch Jekyll server inside tmux

Scipt to launch jekyll server inside tmux session

I modified the scipt from blog.htbaa.com. It’s very simple and easy.

The script creates tmux session with you username that are two vertical panels. Other side the script goes to blog folder and launches the service.

The value of this scipt that you can create new blog posts while the server is running. When you edit some file the site will be regrenerated and you will see the output.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#!/bin/bash
SESSION=$USER

tmux -2 new-session -d -s $SESSION

# Setup for launching jekyll server
tmux new-window -t $SESSION:1 -n 'Logs'
tmux split-window -h
tmux select-pane -t 0
tmux send-keys "cd /home/tiki/blog" C-m
tmux send-keys "jekyll serve" C-m
tmux select-pane -t 1

After that creating the script I modified the scipt to be excecuable.

1
chmod +x tmux_scipt
Built with Hugo
Theme Stack designed by Jimmy