2359eb53 |
1 | LibrePlanet 2016 |
2 | ================ |
3 | |
4 | This is the static HTML site for LibrePlanet 2016. Read on for |
5 | instructions on how to setup your development environment. |
6 | |
7 | The repository has a master (development) branch and a stable |
8 | (live) branch. To work on it, you'll edit your checkout of the |
9 | master branch until you are satisfied, push it to the master |
10 | branch on the Web server (<http://wiki-dev0.libreplanet.org>), |
11 | make sure it works well and make sure it works well. Then |
12 | you'll copy it over to your checkout of the stable branch, |
13 | then push that to the stable branch on the Web server |
14 | (<http://libreplanet.org>). |
15 | |
16 | Setting Up Apache |
17 | ----------------- |
18 | |
19 | Apache is required in order to replicate the appearance of the website |
20 | on the live and staging servers on your machine. If you don't want to |
21 | install Apache, you can still work on the site, you just won't be able |
22 | to see what it looks like until you push to the remote. |
23 | |
24 | Modifying Apache's configuration files and running its executables |
25 | typically requires root access. So, you will most likely need to run |
26 | the commands below as the root user using `sudo`. |
27 | |
28 | ### Enable server-side include module |
29 | |
30 | ``` |
31 | a2enmod include |
32 | ``` |
33 | |
34 | If this doesn't work, you may not have Apache installed. Install the |
35 | package apache2 from your package manager. |
36 | |
37 | ### Create virtual host |
38 | |
83c0371e |
39 | Create 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 | |
66 | Replace all instances of `/path/to/libreplanet-static` with the full path to the root directory of your local |
67 | git repository. |
68 | |
69 | ### Enable virtual host |
70 | |
71 | ``` |
72 | a2ensite your-virtual-host |
73 | ``` |
74 | |
75 | Replace `your-virtual-host` with the name of virtual host file you made (in this case, libreplanet). |
76 | |
77 | ### Restart Apache |
78 | |
79 | ``` |
80 | service apache2 restart |
81 | ``` |
82 | |
83 | ### Edit your hosts file |
84 | |
85 | Edit your system's `/etc/hosts` file and add the following to the bottom: |
86 | |
87 | ``` |
88 | 127.0.0.1 lp2016.libreplanet.org |
89 | ``` |
90 | |
91 | ### Test |
92 | |
93 | Visit <http://lp2016.libreplanet.org/2016> in your web browser. If |
94 | everything is configured properly, you will see the LibrePlanet 2016 |
95 | site, complete with header, sidebar, and footer. |
96 | |
97 | Creating a New Page |
98 | ------------------- |
99 | |
100 | ### Boilerplate |
101 | |
102 | Add 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 | |
112 | This will include the header, banner, sidebar, footer and closing tags |
113 | saving you from duplicating HTML. |
114 | |
115 | If JS is needed for a page, then create a file, containing the JS |
116 | includes, in `/server/2016/` & use SSI to include it in the page. |
117 | |
118 | Use `/server/2016/boilerplate.html` to start a new page. |
119 | |
120 | ### Add Your Markup |
121 | |
122 | Add HTML markup in-between the sidebar and footer includes. |
123 | |
124 | ### Enable SSI |
125 | |
126 | Files that contain include directives must be marked as executable |
127 | otherwise Apache will not parse them. The directive `XBitHack on` |
128 | enables this behavior. |
129 | |
130 | To mark a file as executable, run: |
131 | |
132 | ``` |
133 | chmod +x foo.html |
134 | ``` |
135 | |
136 | Replace `foo.html` with the desired file name. |
137 | |
138 | Schedule 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 | ↓ |
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 | |
161 | Replace `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 | ↓ |
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 | |
186 | Replace `DAY` by the day of the program (`sat`/`sun`) and `M` by time |
187 | slot 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 | |
200 | Replace `DAY` by the day of the program (`sat`/`sun`) and `M` by break |
201 | number. |
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 | |
222 | Replace `DAY` by the day of the program (`sat`/`sun`), `M` by the time slot number and `N` by the session number. |
223 | |
224 | Deploying to Staging/Live Servers |
225 | --------------------------------- |
226 | |
227 | A system of git hooks automates deployment to the staging and live |
228 | servers. When you push to the `master` branch, the site is deployed |
229 | to <http://wiki-dev0.libreplanet.org/2016>. When you push to the |
230 | `stable` branch, the site is deployed to <http://libreplanet.org>. |
231 | |
232 | When you're happy with the state of the master branch and want to |
233 | deploy live, do the following: |
234 | |
235 | ``` |
236 | git checkout stable |
237 | git merge master |
238 | git push |
239 | ``` |
240 | |
241 | This merges the master branch with the stable branch, updates the |
242 | remote repository on the git server, and triggers a deploy to |
243 | <http://libreplanet.org>. |
244 | |
245 | CSS and JavaScript |
246 | ------------------ |
247 | |
248 | This 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) |