`hugo sever`用のタスクを追加

diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..99233bd
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,3 @@
+#!/usr/bin/env rake
+
+Dir['tasks/**/*.rake'].each { |path| load path }
diff --git a/tasks/demo.rake b/tasks/demo.rake
new file mode 100755
index 0000000..d10863b
--- /dev/null
+++ b/tasks/demo.rake
@@ -0,0 +1,12 @@
+#!/usr/bin/env rake
+
+require 'socket'
+
+desc 'Generate the HTML demo pages including drafts'
+task :demo do
+  ip = Socket.getifaddrs.select{|x|
+    x.name == "ens160" and x.addr.ipv4?
+  }.first.addr.ip_address
+
+  sh "hugo server --buildDrafts -w --bind #{ip} -b #{ip} --disableFastRender"
+end
This commit is contained in:
Kazuhiro MUSASHI 2022-12-30 17:46:04 +09:00
parent f2a644a066
commit 6ab93a3d2d
2 changed files with 15 additions and 0 deletions

3
Rakefile Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env rake
Dir['tasks/**/*.rake'].each { |path| load path }

12
tasks/demo.rake Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env rake
require 'socket'
desc 'Generate the HTML demo pages including drafts'
task :demo do
ip = Socket.getifaddrs.select{|x|
x.name == "ens160" and x.addr.ipv4?
}.first.addr.ip_address
sh "hugo server --buildDrafts -w --bind #{ip} -b #{ip} --disableFastRender"
end