Skip to content

Commit

Permalink
added scenario setup content builder via jekyll plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
styson committed Mar 5, 2016
1 parent 01a271d commit d098d1f
Show file tree
Hide file tree
Showing 157 changed files with 107 additions and 8,337 deletions.
Binary file removed .jekyll-metadata
Binary file not shown.
9 changes: 9 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
url: "http://vasl.info"
baseurl: ""

defaults:
-
scope:
path: ""
values:
layout: test
2 changes: 1 addition & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<meta name="author" content="">
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
<link rel="icon" href="./favicon.ico" type="image/x-icon">
<title>VASL - Download Scenarios</title>
<title>{% if page.title %} {{ page.title }} | {% endif %}</title>
<link rel="stylesheet" href="./css/bootstrap.min.css">
<link href="./css/vasl_styles.css" rel="stylesheet">
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html>
{% include head.html %}
{% include header.html %}
<body>
<div id="navbar"></div>
<div class="container-fluid">
Expand Down
57 changes: 57 additions & 0 deletions _plugins/setup_generator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
require 'jekyll/document'

module Jekyll

# Recover from strange exception when starting server without --auto
class SitemapFile < StaticFile
def write(dest)
true
end
end

class SitemapGenerator < Generator
priority :lowest

# Config defaults
FILE_NAME = "/setups/scen.html"

# Goes through setup files and generates listing
def generate(site)
# Configuration
sitemap_config = site.config['sitemap'] || {}

# create destination directory if it doesn't exist yet
Dir::mkdir(site.dest) if !File.directory? site.dest
$fileHtml = File.new(File.join(site.dest, FILE_NAME), "w+")

traverse(File.join(site.dest, "/setups"))

$fileHtml.close()

# Keep the file from being cleaned by Jekyll
site.static_files << Jekyll::SitemapFile.new(site, site.dest, "/", FILE_NAME)
end

def process(path)
if File.directory?(path)
dir = File.basename(path)
level = path.count('/') - 4
h = "h" + level.to_s
$fileHtml.puts "<"+h+">" + dir + "</"+h+">" if dir != "Enhanced"
else
$fileHtml.puts "<p><a href='"+path+"'>" + File.basename(path, ".vsav") + "</a></p>"
end
end

def traverse(path='.')
Dir.entries(path).each do |name|
next if name == '.' or name == '..'

path2 = path + '/' + name
process(path2) if File.basename(path2) != "scen.html"

traverse(path2) if File.ftype(path2) == "directory"
end
end
end
end
36 changes: 36 additions & 0 deletions css/setup_styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#setups h1,
#setups h2,
#setups h3,
#setups h4,
#setups h5,
#setups h6 {
margin: 5px 0;
}

#setups h1 {
margin-left: 0;
}

#setups h2 {
margin-left: 10px;
}

#setups h3 {
margin-left: 20px;
}

#setups h4 {
margin-left: 30px;
}

#setups h5 {
margin-left: 40px;
}

#setups h6 {
margin-left: 50px;
}

#setups p {
margin: 0;
}
99 changes: 0 additions & 99 deletions old/scan.php

This file was deleted.

68 changes: 0 additions & 68 deletions old/scenarios.php

This file was deleted.

4 changes: 0 additions & 4 deletions old/setups/app-info.json

This file was deleted.

Loading

0 comments on commit d098d1f

Please sign in to comment.