Update the website: Difference between revisions
No edit summary |
(gitorious replaced by notabug) |
||
(13 intermediate revisions by 4 users not shown) | |||
Line 3: | Line 3: | ||
= First time = |
= First time = |
||
== Easy version == |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
Don't have commit access? Then you should probably make a clone and put it up somewhere. |
Don't have commit access? Then you should probably make a clone and put it up somewhere. |
||
git clone <nowiki>https://notabug.org/mediagoblin/mediagoblin-website.git</nowiki> |
|||
⚫ | |||
⚫ | |||
make virtualenv |
|||
Next, to build the site and test it in your browser, run: |
|||
make |
|||
⚫ | |||
== Harder version == |
|||
First, do a git checkout: |
|||
https://notabug.org/mediagoblin/mediagoblin-website.git |
|||
Don't have commit access? Then you should probably make a clone and put it up somewhere. |
|||
git clone <nowiki>https://notabug.org/mediagoblin/mediagoblin-website.git</nowiki> |
|||
Next, switch to the "draft" branch, or make a local clone of that if you haven't already. |
Next, switch to the "draft" branch, or make a local clone of that if you haven't already. |
||
Line 16: | Line 41: | ||
git merge origin/master |
git merge origin/master |
||
First of all you will need to [http://docs.getpelican.com/en/latest/getting_started.html#installing-pelican install Pelican] to generates the site and [http://pythonpaste.org/deploy/ Paste] to serve it locally for testing purposes. The recommended way to do this is inside virtualenv. |
|||
⚫ | |||
Okay, make sure you have virtualenv installed (is it on your path? If not you might need to install it via your package manager.) |
|||
⚫ | |||
Set up the virtualenv |
|||
Install pyblosxom |
|||
virtualenv ~/virtualenvs/pelican |
|||
./bin/easy_install pyblosxom |
|||
cd ~/virtualenvs/pelican |
|||
⚫ | |||
Set up Pelican and Paste |
|||
Activate the virtualenv and see if it starts up: |
|||
pip install pelican typogrify PasteDeploy |
|||
⚫ | |||
./compile.sh && ./testhttpserver.py |
|||
Asssuming you have a copy of the repo in yout virtualenv's folder, you can now build the site and test it in your browser: |
|||
⚫ | |||
cd mediagoblin-website |
|||
⚫ | |||
make html && paster serve blog.ini |
|||
That's it! If all is successful, it should give you a url like http://localhost:5000/ |
|||
Press ctrl-c to kill the server. To deactivate the virtualenv simply type "deactivate". |
|||
⚫ | |||
= Layout of the repository = |
= Layout of the repository = |
||
* ''' |
* '''content/''' -- new blogposts go here. Usually we use restructured text. Copy an old file and mime it. |
||
* '''plugins/''' -- Pelican plugins. |
|||
⚫ | |||
* ''' |
* '''static/''' -- images and stuff goes in here. Look around and you'll see. |
||
* ''' |
* '''theme/template/''' -- site's template "look and feel" described here. |
||
⚫ | |||
= Making and committing changes = |
= Making and committing changes = |
||
Line 49: | Line 80: | ||
git pull |
git pull |
||
Add files, make changes. To test them, activate the virtualenv, recompile, start the server... you'll then be able to visit http://localhost: |
Add files, make changes. To test them, activate the virtualenv, recompile, start the server... you'll then be able to visit http://localhost:5000/ in your browser. |
||
. ../bin/activate |
|||
make html && paster serve blog.ini |
|||
./compile.sh && ./testhttpserver.py |
|||
Commit to the draft branch when things look good. (This might be more complex if you don't have commit access.. if you're a guest contributor, ask for help in the channel if you get stuck.) |
Commit to the draft branch when things look good. (This might be more complex if you don't have commit access.. if you're a guest contributor, ask for help in the channel if you get stuck.) |
||
Line 59: | Line 90: | ||
git status |
git status |
||
# Stage changes that you intend to commit |
# Stage changes that you intend to commit |
||
git add file1. |
git add file1.rst file2.html # replace with real filepaths here |
||
# Commit! You'll be prompted by your text editor |
# Commit! You'll be prompted by your text editor |
||
git commit -m "Describe your changes here" |
git commit -m "Describe your changes here" |
Latest revision as of 09:50, 14 January 2016
Okay, updating mediagoblin.org! Well, obviously not everyone has permission to do this, so depending on whether or not you have commit access affects whether or not you'll send a branch for review, pretty much the same as how you do with normal git contributions.
First time
Easy version
First, do a git checkout:
https://notabug.org/mediagoblin/mediagoblin-website.git
Don't have commit access? Then you should probably make a clone and put it up somewhere.
git clone https://notabug.org/mediagoblin/mediagoblin-website.git
Okay, Make sure you have virtualenv installed (is it on your path? If not you might need to install it via your package manager.) Set up the virtualenv
make virtualenv
Next, to build the site and test it in your browser, run:
make
That's it! If all is successful, it should give you a url like http://localhost:5000/
Harder version
First, do a git checkout:
https://notabug.org/mediagoblin/mediagoblin-website.git
Don't have commit access? Then you should probably make a clone and put it up somewhere.
git clone https://notabug.org/mediagoblin/mediagoblin-website.git
Next, switch to the "draft" branch, or make a local clone of that if you haven't already.
git branch draft origin/draft git checkout draft # merge in any stray commits from master git merge origin/master
First of all you will need to install Pelican to generates the site and Paste to serve it locally for testing purposes. The recommended way to do this is inside virtualenv.
Okay, make sure you have virtualenv installed (is it on your path? If not you might need to install it via your package manager.)
Set up the virtualenv
virtualenv ~/virtualenvs/pelican cd ~/virtualenvs/pelican . bin/activate
Set up Pelican and Paste
pip install pelican typogrify PasteDeploy
Asssuming you have a copy of the repo in yout virtualenv's folder, you can now build the site and test it in your browser:
cd mediagoblin-website make html && paster serve blog.ini
That's it! If all is successful, it should give you a url like http://localhost:5000/
If that works, you should be able to visit that URL in your browser and it'll look like http://mediagoblin.org/
Layout of the repository
- content/ -- new blogposts go here. Usually we use restructured text. Copy an old file and mime it.
- plugins/ -- Pelican plugins.
- static/ -- images and stuff goes in here. Look around and you'll see.
- theme/template/ -- site's template "look and feel" described here.
- theme/templates/pages/ -- various non-blog pages of the site. Join page, about us, etc.
Making and committing changes
Make sure you're in the draft branch:
git checkout draft git pull
Add files, make changes. To test them, activate the virtualenv, recompile, start the server... you'll then be able to visit http://localhost:5000/ in your browser.
. ../bin/activate make html && paster serve blog.ini
Commit to the draft branch when things look good. (This might be more complex if you don't have commit access.. if you're a guest contributor, ask for help in the channel if you get stuck.)
# See what files need to be committed here git status # Stage changes that you intend to commit git add file1.rst file2.html # replace with real filepaths here # Commit! You'll be prompted by your text editor git commit -m "Describe your changes here" # Push live git push
Going live
Are you ready to go live? Are you sure? It's probably a good idea to run by Will or Chris in the channel before doing this.
If you're ready, commit and push to the master branch. Changes to the master branch are periodically auto-updated on the server.
git checkout master git pull git merge draft git push