sunday evening
[libreplanet-static.git] / 2015 / README.md
index fcb5433ab3d2ea5397a44e4921ed58616aee0e41..0c884a5b268b3abda02aed09e4e388c4702333af 100644 (file)
 LibrePlanet 2015
 ================
 
+This is the static HTML site for LibrePlanet 2015.  Read on for
+instructions on how to setup your development environment.
+
+The repository has a master (development) branch and a stable
+(live) branch. To work on it, you'll edit your checkout of the
+master branch until you are satisfied, push it to the master
+branch on the Web server (<http://wiki-dev0.libreplanet.org>),
+make sure it works well and make sure it works well. Then
+you'll copy it over to your checkout of the stable branch,
+then push that to the stable branch on the Web server
+(<http://libreplanet.org>).
+
 Setting Up Apache
 -----------------
 
-* Enable server-side include module
-  ```
-  a2enmod include
-  ```
+Apache is required in order to replicate the appearance of the website
+on the live and staging servers on your machine. If you don't want to
+install Apache, you can still work on the site, you just won't be able
+to see what it looks like until you push to the remote.
+
+Modifying Apache's configuration files and running its executables
+typically requires root access.  So, you will most likely need to run
+the commands below as the root user using `sudo`.
+
+### Enable server-side include module
+
+```
+a2enmod include
+```
+
+If this doesn't work, you may not have Apache installed. Install the
+package apache2 from your package manager.
+
+### Create virtual host
+
+Create a new file called libreplanet in `/etc/apache2/sites-available` with the following contents:
+
+```
+<VirtualHost *:80>
+    ServerName lp2015.libreplanet.org
+       DocumentRoot /path/to/libreplanet-static
+
+       <Directory />
+               Options FollowSymLinks
+               AllowOverride All
+    </Directory>
+       <Directory /path/to/libreplanet-static>
+               Options Indexes FollowSymLinks MultiViews
+        Options +Includes
+        XBitHack on
+               AllowOverride All
+               Order allow,deny
+               allow from all
+       </Directory>
+
+       ErrorLog ${APACHE_LOG_DIR}/error.log
+       LogLevel warn
+       CustomLog ${APACHE_LOG_DIR}/access.log combined
+</VirtualHost>
+```
+
+Replace all instances of `/path/to/libreplanet-static` with the full path to the root directory of your local
+git repository.
+
+### Enable virtual host
+
+```
+a2ensite your-virtual-host
+```
+
+Replace `your-virtual-host` with the name of virtual host file you made (in this case, libreplanet).
+
+### Restart Apache
+
+```
+service apache2 restart
+```
+
+### Edit your hosts file
+
+Edit your system's `/etc/hosts` file and add the following to the bottom:
+
+```
+127.0.0.1 lp2015.libreplanet.org
+```
+
+### Test
 
-* Create virtual host
-  *WRITEME*
+Visit <http://lp2015.libreplanet.org/2015> in your web browser.  If
+everything is configured properly, you will see the LibrePlanet 2015
+site, complete with header, sidebar, and footer.
 
-Using Server-side Includes
---------------------------
+Creating a New Page
+-------------------
+
+### Boilerplate
+
+Add the following to your new page (it should remain commented out, as that is the syntax for SSI):
+
+```
+<!--#include virtual="/server/2015/header.html"-->
+<!--#include virtual="/server/2015/banner.html"-->
+<!--#include virtual="/server/2015/sidebar.html"-->
+<!--#include virtual="/server/2015/footer.html"-->
+<!--#include virtual="/server/2015/close.html"-->
+```
+
+This will include the header, banner, sidebar, footer and closing tags
+saving you from duplicating HTML.
+
+If JS is needed for a page, then create a file, containing the JS
+includes, in `/server/2015/` & use SSI to include it in the page.
+
+Use `/server/2015/boilerplate.html` to start a new page.
+
+### Add Your Markup
+
+Add HTML markup in-between the sidebar and footer includes.
+
+### Enable SSI
 
 Files that contain include directives must be marked as executable
 otherwise Apache will not parse them.  The directive `XBitHack on`
 enables this behavior.
+
+To mark a file as executable, run:
+
+```
+chmod +x foo.html
+```
+
+Replace `foo.html` with the desired file name.
+
+Deploying to Staging/Live Servers
+---------------------------------
+
+A system of git hooks automates deployment to the staging and live
+servers.  When you push to the `master` branch, the site is deployed
+to <http://wiki-dev0.libreplanet.org/2015>.  When you push to the
+`stable` branch, the site is deployed to <http://libreplanet.org>.
+
+When you're happy with the state of the master branch and want to
+deploy live, do the following:
+
+```
+git checkout stable
+git merge master
+git push
+```
+
+This merges the master branch with the stable branch, updates the
+remote repository on the git server, and triggers a deploy to
+<http://libreplanet.org>.
+
+CSS and JavaScript
+------------------
+
+This site is built with:
+
+* [Bootstrap 3.2.0](https://github.com/twbs/bootstrap/releases/download/v3.2.0/bootstrap-3.2.0-dist.zip)
+* [jQuery 1.11.1](http://code.jquery.com/jquery-1.11.1.js)