firebase data

This commit is contained in:
William Zhang 2018-02-28 15:52:20 -05:00
parent 20ba0ef914
commit 292b4593d1
11 changed files with 59 additions and 240 deletions

View File

@ -12,6 +12,8 @@ gem "jekyll", "3.5.2"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
gem "hash-joiner", "~> 0.0.7"
gem "json", "~> 2.1.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.

View File

@ -28,6 +28,11 @@ markdown: kramdown
plugins:
- jekyll-feed
jekyll_get:
- data: about
json: 'https://sgawebsite-e30e2.firebaseio.com/about.json'
- data: forms
json: 'https://sgawebsite-e30e2.firebaseio.com/forms.json'
# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.

View File

@ -1,98 +0,0 @@
{
"username" : "excomm",
"name": "SGA Executive Committee",
"description": "The Executive Committee (ExComm) is a integral sub-group of the SGA. Its members act as representatives of the student body. The members work with the officers to organize events and activities throughout to year. While several ExComm positions may have more specific roles, all are working towards the goals of the SGA. Applications to be on ExComm are released every June after Class Council elections have been completed.",
"members": [
{
"first": "MiJin",
"last": "Cho",
"year": 2019,
"title": "General Activities Coordinator",
"intro": ""
},
{
"first": "Michael",
"last": "Huang",
"year": 2020,
"title": "General Activities Coordinator",
"intro": ""
},
{
"first": "Rohan",
"last": "Kalra",
"year": 2020,
"title": "General Activities Coordinator",
"intro": ""
},
{
"first": "Michael",
"last": "Kyrychenko",
"year": 2020,
"title": "General Activities Coordinator",
"intro": ""
},
{
"first": "Jade",
"last": "Wang",
"year": 2018,
"title": "General Activities Coordinator",
"intro": ""
},
{
"first": "Liana",
"last": "Keesing",
"year": 2019,
"title": "Policy Specialist",
"intro": ""
},
{
"first": "Lulu",
"last": "Lin",
"year": 2018,
"title": "Policy Specialist",
"intro": ""
},
{
"first": "Afreen",
"last": "Mohideen",
"year": 2019,
"title": "Policy Specialist",
"intro": ""
},
{
"first": "Ethan",
"last": "Phillips",
"year": 2019,
"title": "Policy Specialist",
"intro": ""
},
{
"first": "Jahnavi",
"last": "Prabhala",
"year": 2018,
"title": "Policy Specialist",
"intro": ""
},
{
"first": "William",
"last": "Zhang",
"year": 2018,
"title": "Technology Specialist",
"intro": ""
},
{
"first": "Beyonce",
"last": "Andrades",
"year": 2020,
"title": "Technology Specialist",
"intro": ""
},
{
"first": "Katherine",
"last": "Du",
"year": 2018,
"title": "Technology Specialist",
"intro": ""
}
]
}

View File

@ -1,35 +0,0 @@
{
"username" : "officers",
"name": "SGA Officers",
"description": "",
"members": [
{
"first": "Nick",
"last": "Begotka",
"year": 2018,
"title": "",
"intro": ""
},
{
"first": "Sherry",
"last": "Xie",
"year": 2018,
"title": "",
"intro": ""
},
{
"first": "Shreya",
"last": "Chappidi",
"year": 2018,
"title": "",
"intro": ""
},
{
"first": "Sitara",
"last": "Uppalapati",
"year": 2019,
"title": "",
"intro": ""
}
]
}

View File

@ -1,49 +0,0 @@
{
"username" : "senators",
"name": "SGA Class Senators",
"description": "Jefferson's student government is divided into school-wide student government (SGA) and grade-level student government (Class Council). While the SGA organizes school-wide events and addresses school-wide concerns and issues, Class Councils represent their grade's needs and host fundraisers and events with the goal to raise money for both Prom and Graduation at the end of senior year. SGA Class Senators serve as Class Council members who are liaisons with the SGA.",
"members": [
{
"first": "Ashley",
"last": "Lin",
"year": 2018,
"title": "2018 Senator",
"intro": ""
},
{
"first": "Anna",
"last": "Lulushi",
"year": 2018,
"title": "2018 Senator",
"intro": ""
},
{
"first": "Laura",
"last": "Gersony",
"year": 2019,
"title": "2019 Senator",
"intro": ""
},
{
"first": "Sabria",
"last": "Kazmi",
"year": 2019,
"title": "2019 Senator",
"intro": ""
},
{
"first": "Divjot",
"last": "Bedi",
"year": 2020,
"title": "2020 Senator",
"intro": ""
},
{
"first": "Megan",
"last": "Dass",
"year": 2020,
"title": "2020 Senator",
"intro": ""
}
]
}

View File

@ -1,21 +0,0 @@
{
"username" : "sponsors",
"name": "SGA Sponsors",
"description": "The SGA Sponsors attend all SGA meetings and functions. They also provide invaluable guidance and feedback - whether through late night emails, frigid-cold morning meetings, lunch discussions, or anything in between.",
"members": [
{
"first": "Amanda",
"last": "Hurowitz",
"year": -1,
"title": "TJ Humanities",
"intro": ""
},
{
"first": "Marianne",
"last": "Razzino",
"year": -1,
"title": "TJ Mathematics",
"intro": ""
}
]
}

View File

@ -1,10 +0,0 @@
{
"username": "events",
"name": "Events",
"items": [
{
"name": "February Frenzy Volleyball Tournament 2018",
"link": "https://docs.google.com/document/d/1rjzg8tW_NH52lUESdEZMJRsc2Bd-lntKaFYqZ1srmOQ/edit"
}
]
}

View File

@ -1,10 +0,0 @@
{
"username": "general",
"name": "General",
"items": [
{
"name": "Feedback and Suggestions",
"link": "https://docs.google.com/forms/d/18KRo3RritoN6RddNvI-l2zZs1h_1mmVWWgRQGOk2vvQ/viewform"
}
]
}

40
_plugins/jekyll_get.rb Normal file
View File

@ -0,0 +1,40 @@
require 'json'
require 'hash-joiner'
require 'open-uri'
module Jekyll_Get
class Generator < Jekyll::Generator
safe true
priority :highest
def generate(site)
config = site.config['jekyll_get']
if !config
return
end
if !config.kind_of?(Array)
config = [config]
end
config.each do |d|
begin
target = site.data[d['data']]
source = JSON.load(open(d['json']))
if target
HashJoiner.deep_merge target, source
else
site.data[d['data']] = source
end
if d['cache']
data_source = (site.config['data_source'] || '_data')
path = "#{data_source}/#{d['data']}.json"
open(path, 'wb') do |file|
file << JSON.generate(site.data[d['data']])
end
end
rescue
next
end
end
end
end
end

View File

@ -27,17 +27,15 @@ orgs: ["officers", "excomm", "senators", "sponsors"]
</div>
</section>
<hr />
{% for org_name in site.data.about %}
{% assign name = page.orgs[forloop.index0] %}
{% assign org = site.data.about[name] %}
<section id="{{ org.username }}">
<h2>{{ org.name }}</h2>
{% for org in site.data.about %}
<section id="{{ org['username'] }}">
<h2>{{ org['name'] }}</h2>
{% for member in org.members %}
<div class="{{ org.username }}-intro">
{% assign year = member.year | downcase %}
{% assign first = member.first | slice: 0 %}
{% assign last = member.last | slice: 0,7 %}
{% if name != "sponsors" %}
{% if org['username'] != "sponsors" %}
{% capture filename %}img/people/{{ year }}{{ first }}{{ last }}.jpg{% endcapture %}
{% else %}
{% capture filename %}img/people/{{ first }}{{ last }}.jpg{% endcapture %}
@ -53,15 +51,15 @@ orgs: ["officers", "excomm", "senators", "sponsors"]
</div>
<div class="{{ org.username }}-text">
<span>{{ member.first }} {{ member.last }}</span>
{% if name != "sponsors" and name != "senators" %}
{% if org['username'] != "sponsors" and org['username'] != "senators" %}
<span>{{ year }}</span>
{% endif %}
{% if name != "officers" %}
{% if org['username'] != "officers" %}
<span>{{ member.title }}</span>
{% endif %}
{% if name == "officers" %}
{% if org['username'] == "officers" %}
<p>{{ member.intro }}</p>
{% endif %}
</div>

View File

@ -14,17 +14,14 @@ sections: ["general", "events", "elections"]
{% include header.html %}
<div id="wrapper" class="fluid">
<section id="forms">
{% for form_name in site.data.forms %}
{% assign name = page.sections[forloop.index0] %}
{% assign form = site.data.forms[name] %}
{% for form in site.data.forms %}
<div class="list">
<h2>{{ form.name }}</h2>
<h2>{{ form['name'] }}</h2>
<ul>
{% for item in form.items %}
{% for item in form['items'] %}
<li>
<a href="{{ item.link }}">
{{ item.name }}
<a href="{{ item['link'] }}">
{{ item['name'] }}
</a>
</li>
{% endfor %}