Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f02eec3
commit 44d867a
Showing
85 changed files
with
11,669 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# A sample Gemfile | ||
source "https://rubygems.org" | ||
source 'https://rubygems.org' | ||
|
||
gem 'awestruct', '~> 0.5.1' | ||
gem 'asciidoctor', '~> 0.1.1' | ||
gem 'haml', '~> 4.0.2' | ||
gem 'coffee-script' | ||
gem 'uglifier' | ||
gem 'htmlcompressor' | ||
gem 'redcarpet' | ||
gem 'RedCloth' | ||
gem 'awestruct', '~> 0.5.0' # Framework for creating static HTML sites | ||
gem 'uglifier', '~> 2.0.1' # Ruby wrapper for UglifyJS JavaScript compressor | ||
gem 'cssminify', '~> 1.0.2' # CSS compression using YUI compressor | ||
gem 'less', '~> 2.3.2' # Invoke the Less CSS compiler from Ruby | ||
gem 'therubyracer', '~> 0.11.4', :platforms => :ruby # Call JavaScript code and manipulate JavaScript objects from Ruby and vice versa | ||
gem 'rb-fsevent', '~> 0.9.3' # FSEvents API with Signals catching (without RubyCocoa) | ||
gem 'kramdown', '~> 1.0.1' # Kramdown works on all platforms, rdiscount only on mri | ||
gem 'therubyrhino', '~> 1.73', :platforms => :jruby # JavaScript on JRuby | ||
gem 'htmlcompressor', '~> 0.0.3' # Adds in HTML minification, helps remove the warning on awestruct startup | ||
|
||
gem 'asciidoctor', '~> 0.1.1' |
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,231 @@ | ||
# This file is a rake build file. The purpose of this file is to simplify | ||
# setting up and using Awestruct. It's not required to use Awestruct, though it | ||
# does save you time (hopefully). If you don't want to use rake, just ignore or | ||
# delete this file. | ||
# | ||
# If you're just getting started, execute this command to install Awestruct and | ||
# the libraries on which it depends: | ||
# | ||
# rake setup | ||
# | ||
# The setup task installs the necessary libraries according to which Ruby | ||
# environment you are using. If you want the libraries kept inside the project, | ||
# execute this command instead: | ||
# | ||
# rake setup[local] | ||
# | ||
# IMPORTANT: To install gems, you'll need development tools on your machine, | ||
# which include a C compiler, the Ruby development libraries and some other | ||
# development libraries as well. | ||
# | ||
# There are also tasks for running Awestruct. The build will auto-detect | ||
# whether you are using Bundler and, if you are, wrap calls to awestruct in | ||
# `bundle exec`. | ||
# | ||
# To run in Awestruct in development mode, execute: | ||
# | ||
# rake | ||
# | ||
# To clean the generated site before you build, execute: | ||
# | ||
# rake clean preview | ||
# | ||
# To deploy using the production profile, execute: | ||
# | ||
# rake deploy | ||
# | ||
# To get a list of all tasks, execute: | ||
# | ||
# rake -T | ||
# | ||
# Now you're Awestruct with rake! | ||
|
||
$use_bundle_exec = true | ||
$install_gems = ['awestruct -v "~> 0.5.0"', 'rb-inotify -v "~> 0.9.0"'] | ||
$awestruct_cmd = nil | ||
task :default => :preview | ||
|
||
desc 'Setup the environment to run Awestruct' | ||
task :setup, [:env] => :init do |task, args| | ||
next if !which('awestruct').nil? | ||
|
||
if File.exist? 'Gemfile' | ||
if args[:env] == 'local' | ||
require 'fileutils' | ||
FileUtils.remove_file 'Gemfile.lock', true | ||
FileUtils.remove_dir '.bundle', true | ||
system 'bundle install --binstubs=_bin --path=.bundle' | ||
else | ||
system 'bundle install' | ||
end | ||
else | ||
if args[:env] == 'local' | ||
$install_gems.each do |gem| | ||
msg "Installing #{gem}..." | ||
system "gem install --bindir=_bin --install-dir=.bundle #{gem}" | ||
end | ||
else | ||
$install_gems.each do |gem| | ||
msg "Installing #{gem}..." | ||
system "gem install #{gem}" | ||
end | ||
end | ||
end | ||
msg 'Run awestruct using `awestruct` or `rake`' | ||
# Don't execute any more tasks, need to reset env | ||
exit 0 | ||
end | ||
|
||
desc 'Update the environment to run Awestruct' | ||
task :update => :init do | ||
if File.exist? 'Gemfile' | ||
system 'bundle update' | ||
else | ||
system 'gem update awestruct' | ||
end | ||
# Don't execute any more tasks, need to reset env | ||
exit 0 | ||
end | ||
|
||
desc 'Build and preview the site locally in development mode' | ||
task :preview => :check do | ||
run_awestruct '-d' | ||
end | ||
|
||
desc 'Generate the site using the development profile' | ||
task :gen => :check do | ||
run_awestruct '-P development -g --force' | ||
end | ||
|
||
desc 'Push local commits to origin/master' | ||
task :push do | ||
system 'git push origin master' | ||
end | ||
|
||
#desc 'Generate the site and deploy to production' | ||
# TODO: This will need to be tweaked a bit for our site, we may need to shell out to a system command | ||
#task :deploy => [:check, :push] do | ||
#run_awestruct '-P production -g --force --deploy' | ||
#end | ||
|
||
#desc 'Generate site from Travis CI and, if not a pull request, publish site to production (GitHub Pages)' | ||
#task :travis => :check do | ||
## if this is a pull request, do a simple build of the site and stop | ||
#if ENV['TRAVIS_PULL_REQUEST'] == '1' || ENV['TRAVIS_PULL_REQUEST'] == 'true' | ||
#run_awestruct '-P production -g' | ||
#next | ||
#end | ||
|
||
#require 'yaml' | ||
|
||
## TODO use the Git library for these commands rather than system | ||
#repo = %x(git config remote.origin.url).gsub(/^git:/, 'https:') | ||
#system "git remote set-url --push origin #{repo}" | ||
#system 'git remote set-branches --add origin master' | ||
#system 'git fetch -q' | ||
##git_user = YAML.load_file('_config/git.yml') | ||
##system "git config user.name '#{git_user['name']}'" | ||
##system "git config user.email '#{git_user['email']}'" | ||
#system "git config user.name '#{ENV['GIT_NAME']}'" | ||
#system "git config user.email '#{ENV['GIT_EMAIL']}'" | ||
#system 'git config credential.helper "store --file=.git/credentials"' | ||
## CREDENTIALS assigned by a Travis CI Secure Environment Variable | ||
## see http://about.travis-ci.org/docs/user/build-configuration/#Secure-environment-variables for details | ||
#File.open('.git/credentials', 'w') {|f| f.write("https://#{ENV['GH_TOKEN']}:@github.com") } | ||
#set_pub_dates 'develop' | ||
#system 'git branch master origin/master' | ||
#run_awestruct '-P production -g --deploy' | ||
#File.delete '.git/credentials' | ||
#end | ||
|
||
desc 'Clean out generated site and temporary files' | ||
task :clean, :spec do |task, args| | ||
require 'fileutils' | ||
dirs = ['.awestruct', '.sass-cache', '_site'] | ||
if args[:spec] == 'all' | ||
dirs << '_tmp' | ||
end | ||
dirs.each do |dir| | ||
FileUtils.remove_dir dir unless !File.directory? dir | ||
end | ||
end | ||
|
||
# Perform initialization steps, such as setting up the PATH | ||
task :init do | ||
# Detect using gems local to project | ||
if File.exist? '_bin' | ||
ENV['PATH'] = "_bin#{File::PATH_SEPARATOR}#{ENV['PATH']}" | ||
ENV['GEM_HOME'] = '.bundle' | ||
end | ||
end | ||
|
||
desc 'Check to ensure the environment is properly configured' | ||
task :check => :init do | ||
if !File.exist? 'Gemfile' | ||
if which('awestruct').nil? | ||
msg 'Could not find awestruct.', :warn | ||
msg 'Run `rake setup` or `rake setup[local]` to install from RubyGems.' | ||
# Enable once the rubygem-awestruct RPM is available | ||
#msg 'Run `sudo yum install rubygem-awestruct` to install via RPM. (Fedora >= 18)' | ||
exit 1 | ||
else | ||
$use_bundle_exec = false | ||
next | ||
end | ||
end | ||
|
||
begin | ||
require 'bundler' | ||
Bundler.setup | ||
rescue LoadError | ||
$use_bundle_exec = false | ||
rescue StandardError => e | ||
msg e.message, :warn | ||
if which('awestruct').nil? | ||
msg 'Run `rake setup` or `rake setup[local]` to install required gems from RubyGems.' | ||
else | ||
msg 'Run `rake update` to install additional required gems from RubyGems.' | ||
end | ||
exit e.status_code | ||
end | ||
end | ||
|
||
# Execute Awestruct | ||
def run_awestruct(args) | ||
system "#{$use_bundle_exec ? 'bundle exec ' : ''}awestruct #{args}" | ||
end | ||
|
||
# A cross-platform means of finding an executable in the $PATH. | ||
# Respects $PATHEXT, which lists valid file extensions for executables on Windows | ||
# | ||
# which 'awestruct' | ||
# => /usr/bin/awestruct | ||
def which(cmd, opts = {}) | ||
unless $awestruct_cmd.nil? || opts[:clear_cache] | ||
return $awestruct_cmd | ||
end | ||
|
||
$awestruct_cmd = nil | ||
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] | ||
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| | ||
exts.each do |ext| | ||
candidate = File.join path, "#{cmd}#{ext}" | ||
if File.executable? candidate | ||
$awestruct_cmd = candidate | ||
return $awestruct_cmd | ||
end | ||
end | ||
end | ||
return $awestruct_cmd | ||
end | ||
|
||
# Print a message to STDOUT | ||
def msg(text, level = :info) | ||
case level | ||
when :warn | ||
puts "\e[31m#{text}\e[0m" | ||
else | ||
puts "\e[33m#{text}\e[0m" | ||
end | ||
end | ||
|
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 |
---|---|---|
@@ -1,12 +1,85 @@ | ||
# Default page title | ||
title: JBoss Community | ||
|
||
asciidoc: | ||
attributes: | ||
source-highlighter: coderay | ||
# Project id name | ||
project: example | ||
|
||
# Default minify settings | ||
css_minifier: disabled | ||
js_minifier: disabled | ||
html_minifier: disabled | ||
|
||
# Merge multiple JavaScript files to improve performance | ||
fileMerger: | ||
enabled: true | ||
outputFilePath: /javascripts/bootstrap-community.js | ||
paths: | ||
- /javascripts/_bootstrap-transition.js | ||
- /javascripts/_bootstrap-alert.js | ||
- /javascripts/_bootstrap-button.js | ||
- /javascripts/_bootstrap-carousel.js | ||
- /javascripts/_bootstrap-collapse.js | ||
- /javascripts/_bootstrap-dropdown.js | ||
- /javascripts/_bootstrap-modal.js | ||
- /javascripts/_bootstrap-tooltip.js | ||
- /javascripts/_bootstrap-popover.js | ||
- /javascripts/_bootstrap-scrollspy.js | ||
- /javascripts/_bootstrap-tab.js | ||
- /javascripts/_bootstrap-typeahead.js | ||
- /javascripts/_bootstrap-affix.js | ||
- /javascripts/_jbossorg-navbarfix.js | ||
- /javascripts/_jbossorg-misc.js | ||
|
||
# Cache hosted fonts, images and javascript | ||
wget: | ||
enabled: true | ||
rerunEach: 86400 # seconds | ||
timestampFilename: _wget-timestamp | ||
options: | ||
- --no-remove-listing | ||
- -q | ||
- -r | ||
- --no-parent | ||
- -N | ||
- --reject 'index.html*' | ||
- -e robots=off | ||
- --directory-prefix=cache | ||
urls: | ||
- http://static.jboss.org/theme/js/libs/jquery/jquery-1.9.1.js | ||
- http://static.jboss.org/theme/js/libs/jquery/jquery-1.9.1.min.js | ||
- http://static.jboss.org/theme/js/libs/html5/pre3.6/html5.min.js | ||
- http://static.jboss.org/theme/js/libs/prettify/188.0.0/prettify.min.js | ||
- http://static.jboss.org/theme/js/libs/holder/1.9/holder.js | ||
- http://static.jboss.org/theme/fonts/titilliumtext/ | ||
- http://static.jboss.org/theme/fonts/font-awesome/ | ||
- http://static.jboss.org/theme/images/common/ | ||
- http://static.jboss.org/images/example/ | ||
|
||
# Update resource URLs based on the profile | ||
profiles: | ||
development: | ||
jborg_fonts_url: /cache/static.jboss.org/theme/fonts | ||
jborg_images_url: /cache/static.jboss.org/theme/images | ||
jborg_js_url: /cache/static.jboss.org/theme/js | ||
project_images_url: /cache/static.jboss.org/images/example | ||
bootstrap_css_url: /stylesheets/bootstrap-community | ||
bootstrap_js_url: /javascripts/bootstrap-community | ||
production: | ||
minified: .min | ||
css_minifier: enabled | ||
js_minifier: enabled | ||
html_minifier: enabled | ||
jborg_fonts_url: http://static.jboss.org/theme/fonts | ||
jborg_images_url: http://static.jboss.org/theme/images | ||
jborg_js_url: http://static.jboss.org/theme/js | ||
project_images_url: http://static.jboss.org/images/example | ||
bootstrap_css_url: http://static.jboss.org/theme/css/bootstrap-community/2.3.1.0/bootstrap-community | ||
bootstrap_js_url: http://static.jboss.org/theme/js/libs/bootstrap-community/2.3.1.0/bootstrap-community | ||
base_url: http://undertow.io | ||
deploy: | ||
host: undertow@filemgmt.jboss.org | ||
path: /www_htdocs/undertow | ||
|
||
asciidoc: | ||
attributes: | ||
source-highlighter: coderay |
Oops, something went wrong.