initial commit
This commit is contained in:
commit
3be5ee1703
33 changed files with 2121 additions and 0 deletions
52
Rakefile
Normal file
52
Rakefile
Normal file
|
@ -0,0 +1,52 @@
|
|||
require "jekyll"
|
||||
require "time"
|
||||
|
||||
desc "create a new note"
|
||||
task :note do
|
||||
slug = "#{Date.today}-#{('a'..'z').to_a.repeated_permutation(1).to_a.sample(2).join}"
|
||||
|
||||
file = File.join(
|
||||
File.dirname(__FILE__),
|
||||
"_notes",
|
||||
slug + ".md"
|
||||
)
|
||||
|
||||
frontmatter = <<~EONOTE
|
||||
---
|
||||
layout: default
|
||||
title: Note
|
||||
date: "#{DateTime.now.strftime("%Y-%m-%d %H:%M")}"
|
||||
---
|
||||
|
||||
EONOTE
|
||||
File.write(file, frontmatter)
|
||||
|
||||
system("#{ENV['EDITOR']} #file}")
|
||||
end
|
||||
|
||||
desc "build site"
|
||||
task :build do
|
||||
Jekyll::Commands::Build.process({})
|
||||
end
|
||||
|
||||
desc "clean site"
|
||||
task :clean do
|
||||
Jekyll::Commands::Clean.process({})
|
||||
end
|
||||
|
||||
desc "serve local site"
|
||||
task :serve => [:build] do
|
||||
Jekyll::Commands::Serve.process({
|
||||
incremental: true,
|
||||
livereload: true,
|
||||
skip_initial_build: false,
|
||||
open_url: true,
|
||||
})
|
||||
end
|
||||
|
||||
desc "deploy site"
|
||||
task :deploy => [:build] do
|
||||
sh "rsync -az --delete ./_site srv.muhh.lol:/var/www/htdocs/muhh.lol/"
|
||||
end
|
||||
|
||||
task :default => [:clean, :build, :serve]
|
Loading…
Add table
Add a link
Reference in a new issue