forked from bitcoin-dot-org/Bitcoin.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site Docs & Previews: Update Site Building/Previewing Docs
* New plugin: remove-html-extension falls back to /foo.html when /foo isn't found in `jekyll serve` mode. * New Makefile target: `make preview` runs bundle exec jekyll serve * Updated site docs to describe installing all required dependencies. Fully tested using a new install of Ubuntu Server 14.04.1
- Loading branch information
Showing
5 changed files
with
169 additions
and
48 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This file is licensed under the MIT License (MIT) available on | ||
# http://opensource.org/licenses/MIT. | ||
|
||
# remove-html-extensions is a temporary workaround to allow the built-in | ||
# Jekyll server to serve files like /foo.html as /foo | ||
# This functonality is already part of Jekyll 3.0.0beta and this plugin | ||
# can be removed when we upgrade that far | ||
|
||
require 'webrick' | ||
include WEBrick | ||
|
||
## Code starting here taken from https://github.com/jekyll/jekyll/commit/e99a9e5821a7ba16ce42a1f5de378012f22acae0 MIT license | ||
|
||
# Custom WEBrick FileHandler servlet for serving "/file.html" at "/file" | ||
# when no exact match is found. This mirrors the behavior of GitHub Pages | ||
# and many static web server configs. | ||
class FileHandler < ::WEBrick::HTTPServlet::FileHandler | ||
def search_file(req, res, basename) | ||
if file = super | ||
file | ||
else | ||
super(req, res, "#{basename}.html") | ||
end | ||
end | ||
end | ||
|
||
## End copied code | ||
|
||
## Horribly hackish and produces a warning, but it works and avoids us | ||
## having to modify Jekyll on every end-user system | ||
WEBrick::HTTPServlet::FileHandler = FileHandler |