2016: customized date-place styling.
[libreplanet-static.git] / 2016 / README.md
CommitLineData
2359eb53 1LibrePlanet 2016
2================
3
4This is the static HTML site for LibrePlanet 2016. Read on for
5instructions on how to setup your development environment.
6
7The repository has a master (development) branch and a stable
8(live) branch. To work on it, you'll edit your checkout of the
9master branch until you are satisfied, push it to the master
10branch on the Web server (<http://wiki-dev0.libreplanet.org>),
11make sure it works well and make sure it works well. Then
12you'll copy it over to your checkout of the stable branch,
13then push that to the stable branch on the Web server
14(<http://libreplanet.org>).
15
16Setting Up Apache
17-----------------
18
19Apache is required in order to replicate the appearance of the website
20on the live and staging servers on your machine. If you don't want to
21install Apache, you can still work on the site, you just won't be able
22to see what it looks like until you push to the remote.
23
24Modifying Apache's configuration files and running its executables
25typically requires root access. So, you will most likely need to run
26the commands below as the root user using `sudo`.
27
28### Enable server-side include module
29
30```
31a2enmod include
32```
33
34If this doesn't work, you may not have Apache installed. Install the
35package apache2 from your package manager.
36
37### Create virtual host
38
83c0371e 39Create a new file called libreplanet (libreplanet.conf for Apache 2.4) in `/etc/apache2/sites-available` with the following contents:
2359eb53 40
41```
42<VirtualHost *:80>
43 ServerName lp2016.libreplanet.org
44 DocumentRoot /path/to/libreplanet-static
45
46 <Directory />
47 Options FollowSymLinks
48 AllowOverride All
49 </Directory>
50 <Directory /path/to/libreplanet-static>
51 Options Indexes FollowSymLinks MultiViews
52 Options +Includes
53 XBitHack on
54 AllowOverride All
55 Order allow,deny
83c0371e 56 # Directive needed in Apache 2.4
2359eb53 57 allow from all
58 </Directory>
59
60 ErrorLog ${APACHE_LOG_DIR}/error.log
61 LogLevel warn
62 CustomLog ${APACHE_LOG_DIR}/access.log combined
63</VirtualHost>
64```
65
66Replace all instances of `/path/to/libreplanet-static` with the full path to the root directory of your local
67git repository.
68
69### Enable virtual host
70
71```
72a2ensite your-virtual-host
73```
74
75Replace `your-virtual-host` with the name of virtual host file you made (in this case, libreplanet).
76
77### Restart Apache
78
79```
80service apache2 restart
81```
82
83### Edit your hosts file
84
85Edit your system's `/etc/hosts` file and add the following to the bottom:
86
87```
88127.0.0.1 lp2016.libreplanet.org
89```
90
91### Test
92
93Visit <http://lp2016.libreplanet.org/2016> in your web browser. If
94everything is configured properly, you will see the LibrePlanet 2016
95site, complete with header, sidebar, and footer.
96
97Creating a New Page
98-------------------
99
100### Boilerplate
101
102Add the following to your new page (it should remain commented out, as that is the syntax for SSI):
103
104```
105<!--#include virtual="/server/2016/header.html"-->
106<!--#include virtual="/server/2016/banner.html"-->
107<!--#include virtual="/server/2016/sidebar.html"-->
108<!--#include virtual="/server/2016/footer.html"-->
109<!--#include virtual="/server/2016/close.html"-->
110```
111
112This will include the header, banner, sidebar, footer and closing tags
113saving you from duplicating HTML.
114
115If JS is needed for a page, then create a file, containing the JS
116includes, in `/server/2016/` & use SSI to include it in the page.
117
118Use `/server/2016/boilerplate.html` to start a new page.
119
120### Add Your Markup
121
122Add HTML markup in-between the sidebar and footer includes.
123
124### Enable SSI
125
126Files that contain include directives must be marked as executable
127otherwise Apache will not parse them. The directive `XBitHack on`
128enables this behavior.
129
130To mark a file as executable, run:
131
132```
133chmod +x foo.html
134```
135
136Replace `foo.html` with the desired file name.
137
138Schedule Markup
139---------------
140
141### Program Day
142
143 <article id="DAY-program" class="program-day"> <!-- DAY program start -->
144 <header class="program-day-header">
145 <hgroup>
146 <h2>Saturday, March DD
147 <a class="btn btn-default btn-xs" role="button"
148 data-toggle="collapse" aria-expanded="false"
149 aria-controls="DAY-timeslots"
150 href="#DAY-timeslots">
151 &#x2193;
152 </a>
153 </h2>
154 </hgroup>
155 </header>
156 <div class="collapse in" id="DAY-timeslots"> <!-- DAY-timeslots start -->
157 <!-- Time slots come here. See next section (Time slot) -->
158 </div> <!-- DAY-timeslots end -->
159 </article>
160
161Replace `DAY` by the day of the program (`sat` / `sun`).
162
163### Time slot
164
165#### sessions
166
167 <article id="DAY-tsM" class="program-timeslot"> <!-- DAY-tsM start -->
168 <header class="program-timeslot-header">
169 <hgroup>
170 <h2>TIME - Timeslot Description
171 <a class="btn btn-default btn-xs" role="button"
172 data-toggle="collapse" aria-expanded="false"
173 aria-controls="DAY-tsM-sessions"
174 href="#DAY-tsM-sessions">
175 &#x2193;
176 </a>
177 </h2>
178 </hgroup>
179 </header>
180 <div class="collapse in"
181 id="DAY-tsM-sessions"> <!-- DAY-tsM-sessions start -->
182 <!-- Sessions come here. See next section (Session). -->
183 </div> <!-- DAY-tsM-sessions end -->
184 </article> <!-- DAY-tsM end -->
185
186Replace `DAY` by the day of the program (`sat`/`sun`) and `M` by time
187slot number.
188
189#### break
190
191 <article id="DAY-ts-bM"
192 class="program-timeslot-break"> <!-- DAY-ts-bM start -->
193 <header class="program-timeslot-break-header">
194 <hgroup>
195 <h2>TIME: Break</h2>
196 </hgroup>
197 </header>
198 </article> <!-- DAY-ts-bM end -->
199
200Replace `DAY` by the day of the program (`sat`/`sun`) and `M` by break
201number.
202
203### Session
204
205 <section id="DAY-tsM-sN"
206 class="program-session"> <!-- DAY-tsM-sN start -->
207 <header class="program-session-header">
208 <h2>Session Heading</h2>
209 </header>
210 <!-- Session "always visible" Content -->
211 <button class="btn btn-default btn-xs" role="button"
212 data-toggle="collapse" aria-expanded="false"
213 aria-controls="DAY-tsM-sN-collapse"
214 data-target="#DAY-tsM-sN-collapse">
215 Details
216 </button>
217 <div class="collapse in" id="DAY-tsM-sN-collapse">
218 <!-- Session Collapsible Content -->
219 </div>
220 </section> <!-- DAY-tsM-sN end -->
221
222Replace `DAY` by the day of the program (`sat`/`sun`), `M` by the time slot number and `N` by the session number.
223
224Deploying to Staging/Live Servers
225---------------------------------
226
227A system of git hooks automates deployment to the staging and live
228servers. When you push to the `master` branch, the site is deployed
229to <http://wiki-dev0.libreplanet.org/2016>. When you push to the
230`stable` branch, the site is deployed to <http://libreplanet.org>.
231
232When you're happy with the state of the master branch and want to
233deploy live, do the following:
234
235```
236git checkout stable
237git merge master
238git push
239```
240
241This merges the master branch with the stable branch, updates the
242remote repository on the git server, and triggers a deploy to
243<http://libreplanet.org>.
244
245CSS and JavaScript
246------------------
247
248This site is built with:
249
250* [Bootstrap 3.3.5](https://github.com/twbs/bootstrap/releases/download/v3.3.5/bootstrap-3.3.5-dist.zip)
251* [jQuery 1.11.1](http://code.jquery.com/jquery-1.11.3.js)