break summary and reorg images for posts to appear nicer on overview
This commit is contained in:
@@ -13,7 +13,11 @@ tags:
|
||||
---
|
||||
_Note: This guide is also available [in FSFE’s wiki][1] now, and it will be the only version maintained. So please head over to the wiki if you’re planning to follow this guide._
|
||||
|
||||
Those who create, edit, and translate [FSFE websites][2] already know that the source files are XHTML files which are build with a XSLT processor, including a lot of custom stuff. One of the huge advantages from that is that we don’t have to rely on dynamic website processors and databases, on the other hand there are a few drawbacks as well: websites need a few minutes to be generated by the central build system, and it’s quite easy to mess up with the XML syntax. Now if an editor wants to create or edit a page, she needs to wait a few minutes until the build system has finished everytime she wants to test how the website looks like. So in this guide I will show how to build single websites on your own computer in a fraction of the FSFE’s system build time, so you’ll only need to commit your changes as soon as the file looks as you want it. All you need is a bit hard disk space and around one hour time to set up everything.
|
||||
Those who create, edit, and translate [FSFE websites][2] already know that the source files are XHTML files which are build with a XSLT processor, including a lot of custom stuff. One of the huge advantages from that is that we don’t have to rely on dynamic website processors and databases, on the other hand there are a few drawbacks as well: websites need a few minutes to be generated by the central build system, and it’s quite easy to mess up with the XML syntax.
|
||||
|
||||
<!--more-->
|
||||
|
||||
Now if an editor wants to create or edit a page, she needs to wait a few minutes until the build system has finished everytime she wants to test how the website looks like. So in this guide I will show how to build single websites on your own computer in a fraction of the FSFE’s system build time, so you’ll only need to commit your changes as soon as the file looks as you want it. All you need is a bit hard disk space and around one hour time to set up everything.
|
||||
|
||||
_The whole idea is based on what FSFE’s webmaster Paul Hänsch has coded and written. [On his blog][3] he explains the new build script. He explains how to build files locally, too. However, this guide aims to make it a bit easier and more verbose._
|
||||
|
||||
@@ -28,8 +32,8 @@ Firstly, clone a [git repository][4] which will give you most needed files and d
|
||||
In general, this is the directory structure I propose. In the following I’ll stick to this scheme. Please adapt all changes if your folder tree looks differently.
|
||||
|
||||
```
|
||||
trunk (~700 MB): ~/subversion/fsfe/fsfe-web/trunk/
|
||||
status (~150 MB): ~/subversion/fsfe/local-build/status/
|
||||
trunk (~700 MB): ~/subversion/fsfe/fsfe-web/trunk/
|
||||
status (~150 MB): ~/subversion/fsfe/local-build/status/
|
||||
fsfe.org (~1000 MB): ~/subversion/fsfe/local-build/fsfe.org/
|
||||
```
|
||||
|
||||
@@ -70,19 +74,19 @@ See? We use the build routine from `trunk` to launch building `trunk`. All statu
|
||||
After the long process has finished, navigate to the `trunk` directory and execute `svn status`. You may see a few files which are new:
|
||||
|
||||
```
|
||||
max@bistromath ~/s/f/f/trunk> svn status
|
||||
? about/printable/archive/printable.en.xml
|
||||
? d_day.en.xml
|
||||
? d_month.en.xml
|
||||
? d_year.en.xml
|
||||
? localmenuinfo.en.xml
|
||||
max@bistromath ~/s/f/f/trunk> svn status
|
||||
? about/printable/archive/printable.en.xml
|
||||
? d_day.en.xml
|
||||
? d_month.en.xml
|
||||
? d_year.en.xml
|
||||
? localmenuinfo.en.xml
|
||||
[...]
|
||||
```
|
||||
|
||||
These are leftover from the full website build. Because `trunk` is supposed to be your productive source directory where you also make commits to the FSFE SVN, let’s delete these files. You won’t need them anymore.
|
||||
|
||||
```bash
|
||||
rm about/printable/archive/printable.en.xml d_day.en.xml d_month.en.xml d_year.en.xml localmenuinfo.en.xml
|
||||
rm about/printable/archive/printable.en.xml d_day.en.xml d_month.en.xml d_year.en.xml localmenuinfo.en.xml
|
||||
rm tools/tagmaps/*.map
|
||||
```
|
||||
|
||||
@@ -136,11 +140,11 @@ From this moment on, you should be able to call `fsfe-preview` from anywhere in
|
||||
As output, you should see something like:
|
||||
|
||||
```
|
||||
[INFO] Using file /home/max/subversion/fsfe/fsfe-web/trunk/contribute/contribute.en.xhtml as source...
|
||||
[INFO] XHTML file detected. Going to build into /home/max/subversion/fsfe/local-build/fsfe.org/contribute/contribute.en.html ...
|
||||
[INFO] Starting webserver
|
||||
|
||||
[SUCCESS] Finished. File can be viewed at http://localhost:5080/contribute/contribute.en.html
|
||||
[INFO] Using file /home/max/subversion/fsfe/fsfe-web/trunk/contribute/contribute.en.xhtml as source...
|
||||
[INFO] XHTML file detected. Going to build into /home/max/subversion/fsfe/local-build/fsfe.org/contribute/contribute.en.html ...
|
||||
[INFO] Starting webserver
|
||||
|
||||
[SUCCESS] Finished. File can be viewed at http://localhost:5080/contribute/contribute.en.html
|
||||
```
|
||||
|
||||
Now open the mentioned URL `http://localhost:5080/contribute/contribute.en.html` and take a look whether your changes had an effect.
|
||||
@@ -164,7 +168,7 @@ The script detects whether the file has to be built with the XSLT processor (.xh
|
||||
Beware that all files you added in your session have to be processed with the script. For example, if you create a report with many images included and want to preview it, you will have to copy all these images to the output directory as well, and not only the XHTML file. For this, there is the `-copy` argument. This circumvents the whole XSLT build process and just plainly copies the given files (or folders). In this example, the workflow could look like the following: The first line copies some images, the second builds the corresponding XHTML file which makes use of these images:
|
||||
|
||||
```
|
||||
fsfe-preview --copy news/2016/graphics/report1.png news/2016/graphics/report2.jpg
|
||||
fsfe-preview --copy news/2016/graphics/report1.png news/2016/graphics/report2.jpg
|
||||
fsfe-preview news/2016/news-20161231-01.en.xhtml
|
||||
```
|
||||
|
||||
@@ -179,8 +183,8 @@ xmllint --noout work.en.xhtml
|
||||
If there’s no output (–noout), the file has a correct syntax and you’re ready to continue. But you may also see something like
|
||||
|
||||
```
|
||||
work.en.xhtml:55: parser error : Opening and ending tag mismatch: p line 41 and li
|
||||
</li>
|
||||
work.en.xhtml:55: parser error : Opening and ending tag mismatch: p line 41 and li
|
||||
</li>
|
||||
^
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user