Commit | Line | Data |
---|---|---|
179bf9bc ZR |
1 | README version for LibrePlanet 2017 |
2 | ||
3 | Heads up: to edit the Web site, you'll need a basic-to-intermediate understanding of HTML and git. | |
fcf95e6d | 4 | |
60bc0202 | 5 | ##### SECTION 1: DEVELOPMENT WORKFLOW ##### |
fcf95e6d | 6 | |
60bc0202 | 7 | The actual LIVE site, visible at libreplanet.org/YEAR, is served from the "stable" branch of the git repository using a git hook. There is also a development branch called "master" which we use to preview edits on the Web. The master branch is served to the Web at http://wiki-dev0.libreplanet.org/YEAR and publicly visible, but not linked to. |
fcf95e6d | 8 | |
60bc0202 ZR |
9 | Full workflow to make, test and deploy an edit |
10 | ----------------- | |
fcf95e6d | 11 | |
12268ed4 | 12 | * Check out the master branch and make sure it is up to date with origin/master by doing: |
60bc0202 | 13 | * git checkout master |
179bf9bc | 14 | * git pull |
12268ed4 | 15 | * Is this a large edit or a small edit? If it is small, edit, work in master. If this is a large edit that will take longer than a day, make a new branch based on the master branch and work there. |
60bc0202 ZR |
16 | * Make your edits. (See instructions for editing content below.) |
17 | * Optionally, test them on your computer with a local development environment. (See instructions below for setting up your development environment). | |
12268ed4 | 18 | * If you are working on your own branch created for your edit, merge, your branch into master by doing: |
60bc0202 ZR |
19 | * git checkout master |
20 | * git merge BRANCHNAME | |
12268ed4 | 21 | * Push master by doing: |
60bc0202 ZR |
22 | * git push |
23 | * Review the edited version of the site at http://wiki-dev0.libreplanet.org/YEAR. You can share this with others. | |
12268ed4 | 24 | * When you are satisfied, merge master into stable and then push stable by doing: |
60bc0202 ZR |
25 | * git checkout stable |
26 | * git merge master | |
27 | * git push | |
179bf9bc | 28 | * Your edits are now live and visible at libreplanet.org/YEAR |
60bc0202 ZR |
29 | |
30 | ##### SECTION 2: EDITING INSTRUCTIONS ##### | |
31 | ||
12268ed4 ZR |
32 | To change content on existing pages, simply use your favorite text editor. |
33 | ||
60bc0202 | 34 | This site is built with [Bootstrap 3.3.5](https://github.com/twbs/bootstrap/releases/download/v3.3.5/bootstrap-3.3.5-dist.zip) and [jQuery 1.11.1](http://code.jquery.com/jquery-1.11.3.js) but you do not need to understand either of these technologies to make minor content edits to the site. |
fcf95e6d | 35 | |
36 | Creating a New Page | |
37 | ------------------- | |
38 | ||
60bc0202 | 39 | *Boilerplate* |
fcf95e6d | 40 | |
41 | Add the following to your new page (it should remain commented out, as that is the syntax for SSI): | |
42 | ||
43 | ``` | |
44 | <!--#include virtual="/2017/includes/header.html"--> | |
45 | <!--#include virtual="/2017/includes/banner.html"--> | |
46 | <!--#include virtual="/2017/includes/sidebar.html"--> | |
47 | <!--#include virtual="/2017/includes/footer.html"--> | |
48 | <!--#include virtual="/2017/includes/close.html"--> | |
49 | ``` | |
50 | ||
51 | This will include the header, banner, sidebar, footer and closing tags | |
52 | saving you from duplicating HTML. | |
53 | ||
54 | If JS is needed for a page, then create a file, containing the JS | |
55 | includes, in `/2017/includes/` & use SSI to include it in the page. | |
56 | ||
57 | Use `/2017/includes/boilerplate.html` to start a new page. | |
58 | ||
60bc0202 | 59 | *Add Your Markup* |
fcf95e6d | 60 | |
61 | Add HTML markup in-between the sidebar and footer includes. | |
62 | ||
60bc0202 | 63 | *Enable SSI* |
fcf95e6d | 64 | |
65 | Files that contain include directives must be marked as executable | |
66 | otherwise Apache will not parse them. (The directive `XBitHack on` in the .conf file pasted above enables this behavior). | |
67 | ||
68 | To mark a file as executable, run: | |
69 | ||
70 | ``` | |
71 | chmod +x foo.html | |
72 | ``` | |
73 | ||
74 | Replace `foo.html` with the desired file name. | |
75 | ||
7ba5343a | 76 | Modifying top-right corner |
77 | -------------------------- | |
78 | ||
79 | In the `/2017/includes/banner.html` find the `...#top-right-desktop | |
80 | start...` section. | |
81 | ||
60bc0202 | 82 | *For register now* |
7ba5343a | 83 | |
84 | Include `register-now.html` | |
85 | ||
86 | <!-- #top-right-desktop start --> | |
87 | <!--#include virtual="/2017/includes/register-now.html"--> | |
88 | <!-- #top-right-desktop end --> | |
89 | ||
60bc0202 | 90 | *For join LP list form* |
7ba5343a | 91 | |
92 | Include `join-list.html` | |
93 | ||
94 | <!-- #top-right-desktop start --> | |
95 | <!--#include virtual="/2017/includes/join-list.html"--> | |
96 | <!-- #top-right-desktop end --> | |
97 | ||
fcf95e6d | 98 | |
60bc0202 ZR |
99 | ##### SECTION 3: SETTING UP A LOCAL DEVELOPMENT ENVIRONMENT ##### |
100 | ||
101 | Apache is required in order to replicate the appearance of the website | |
102 | on the live and staging servers on your machine. If you don't want to | |
103 | install Apache, you can still work on the site, you just won't be able | |
104 | to see what it looks like until you push to the remote. | |
105 | ||
106 | Modifying Apache's configuration files and running its executables | |
107 | typically requires root access. So, you will most likely need to run | |
108 | the commands below as the root user using `sudo`. | |
109 | ||
110 | *Enable server-side include module* | |
111 | ||
112 | ``` | |
113 | a2enmod include | |
114 | ``` | |
115 | ||
116 | If this doesn't work, you may not have Apache installed. Install the | |
117 | package apache2 from your package manager. | |
118 | ||
119 | *Create virtual host* | |
120 | ||
121 | Create a new file called libreplanet (libreplanet.conf for Apache 2.4) in `/etc/apache2/sites-available` with the following contents: | |
122 | ||
123 | ``` | |
124 | <VirtualHost *:80> | |
125 | RewriteEngine on | |
126 | ServerName local-dev.libreplanet.org | |
127 | ServerAdmin webmaster@localhost | |
128 | DocumentRoot /local-path/path-to-site | |
129 | <Directory /local-path/path-to-site/> | |
130 | Options Indexes FollowSymLinks MultiViews | |
131 | AllowOverride All | |
132 | Require all granted | |
133 | Order deny,allow | |
134 | deny from none | |
135 | allow from all | |
136 | SSILegacyExprParser on | |
137 | Options +Includes | |
138 | XBitHack on | |
139 | </Directory> | |
140 | ErrorLog /home/owner/libreplanet-static/logs/error.log | |
141 | CustomLog /home/owner/libreplanet-static/access.log combined | |
142 | </VirtualHost> | |
143 | ``` | |
144 | ||
145 | Replace all instances of `/path/to/libreplanet-static` with the full path to the root directory of your local | |
146 | git repository. | |
147 | ||
148 | *Enable virtual host* | |
149 | ||
150 | ``` | |
151 | a2ensite your-virtual-host | |
152 | ``` | |
153 | ||
154 | Replace `your-virtual-host` with the name of virtual host file you made (in this case, libreplanet). | |
fcf95e6d | 155 | |
60bc0202 | 156 | *Restart Apache* |
fcf95e6d | 157 | |
158 | ``` | |
60bc0202 | 159 | service apache2 restart |
fcf95e6d | 160 | ``` |
161 | ||
60bc0202 | 162 | *Edit your hosts file* |
fcf95e6d | 163 | |
60bc0202 ZR |
164 | Edit your system's `/etc/hosts` file and add the following to the bottom: |
165 | ||
166 | ``` | |
167 | 127.0.0.1 lp2017.libreplanet.org | |
168 | ``` | |
fcf95e6d | 169 | |
60bc0202 | 170 | *Test* |
fcf95e6d | 171 | |
60bc0202 ZR |
172 | Visit <http://lp2017.libreplanet.org/2017> in your web browser. If |
173 | everything is configured properly, you will see the LibrePlanet 2017 | |
174 | site, complete with header, sidebar, and footer. |