-
-
Save tsujp/e19862b690d90b255cba7399a5d94b4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# This wraps `bundle exec` to shorten invocation. It is a special Rakefile which | |
# defines, reads, and then executes Rake all at once. | |
require 'bundler/setup' | |
require 'pathname' | |
require 'rake' | |
require 'jekyll' | |
Jekyll::PluginManager.require_from_bundler | |
def jekyll_with_config | |
Jekyll::Configuration.new.read_config_file( | |
Pathname.pwd().join('jekyll.toml').realpath.to_s) | |
end | |
# Rake application to add tasks etc to. | |
rk = Rake.application | |
include Rake::DSL | |
rk.instance_eval do | |
# Configure base default Rake task to show available tasks. | |
Rake::TaskManager.record_task_metadata = true | |
task :default do | |
Rake::application.options.show_tasks = :tasks | |
self.options.show_task_pattern = // | |
self.display_tasks_and_comments() | |
end | |
# --- | |
desc 'Run Jekyll in development mode' | |
task :dev do | |
jek_opts = jekyll_with_config | |
jek_cfg = Jekyll::Command.configuration_from_options(jek_opts) | |
# Jekyll::Commands::Build.process(jek_opts) | |
# Jekyll::Commands::Serve.process(jek_opts) | |
thread = Thread.new do | |
Jekyll::Command.process_with_graceful_fail( | |
Jekyll::Commands::Serve, | |
jek_cfg, | |
Jekyll::Commands::Build, | |
Jekyll::Commands::Serve, | |
) | |
end | |
thread.abort_on_exception = true | |
Jekyll::Commands::Serve.mutex.synchronize do | |
unless Jekyll::Commands::Serve.running? | |
Jekyll::Commands::Serve.run_cond.wait(Jekyll::Commands::Serve.mutex) | |
end | |
end | |
end | |
desc 'Builds blog for deployment' | |
task :build do | |
puts 'asdsdaasd' | |
end | |
end | |
# Passes ARGV into the Rake application (preparing to run). | |
rk.init($0, ARGV) | |
# Invokes top level tasks (running). | |
rk.top_level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# General. | |
title = "Your awesome title" | |
email = "your-email@example.com" | |
description = "foo bar" | |
url = "" | |
twitter_username = "twitter_user" | |
github_username = "github_user" | |
# Build. | |
source = "src" | |
destination = "build" | |
theme = "minima" | |
plugins = [ | |
"jekyll-feed" | |
] | |
# Serve. | |
watch = true | |
serving = true | |
port = 4000 | |
livereload = true | |
livereload_port = 4044 | |
baseurl = "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment