Difference between revisions of "Howto: Make a genealogy website with Gramps"

From Gramps
Jump to: navigation, search
(Changes you can do - For more advanced Users)
(remove dead links)
(27 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
{{cleanup}}
 
{{cleanup}}
 
{{languages}}
 
{{languages}}
This is a Howto on how to make a genealogy website with GRAMPS 2.2.x. and the NarrativeWeb plugin.
+
This is a Howto on how to make a genealogy website with Gramps 2.2.x. and the NarrativeWeb plugin.
  
 
The website will be made with the narrative website report, of which the interface is described at: [[Generating Web pages]]. The goal is to offer a complete howto/tutorial on using this report, from conception, to uploading your genealogical website to an internet service provider (ISP).
 
The website will be made with the narrative website report, of which the interface is described at: [[Generating Web pages]]. The goal is to offer a complete howto/tutorial on using this report, from conception, to uploading your genealogical website to an internet service provider (ISP).
Line 10: Line 10:
 
== Before you start ==
 
== Before you start ==
  
You can easily generate a nice looking web site from within GRAMPS.
+
You can easily generate a nice looking web site from within Gramps.
  
 
Before you start you should have an idea about the data you want to have on the website. If you are not careful, and generate a webpage from your complete database, the amount of generated files can be '''huge''', as well as taking up a lot of space.
 
Before you start you should have an idea about the data you want to have on the website. If you are not careful, and generate a webpage from your complete database, the amount of generated files can be '''huge''', as well as taking up a lot of space.
Line 16: Line 16:
 
==How to limit the amount of data==
 
==How to limit the amount of data==
  
If you have a large database, it is wise to start with a [[filter]] to limit the number of persons: In the People view of GRAMPS, go to the View menu, and activate the Filter sidebar. Next, go to ''Edit menu--> Person Filter Editor'', and make a suitable filter. Read the [http://gramps-project.org/gramps-manual/2.2/en/ch03s10.html#tools-util-cfe help manual] if necessary. Once a filter is defined, you can test it in the People view, by selecting the filter in the Filter Sidebar, and clicking find. You can combine filters (yes, it helps if you have experience with  some basic and/or logic) until you have a selection of all the people you want on your website.
+
If you have a large database, it is wise to start with a [[filter]] to limit the number of people: In the People view of Gramps, go to the View menu, and activate the Filter sidebar. Next, go to {{man menu|Edit --> Person Filter Editor}} menu, and make a suitable filter. Read the [http://gramps-project.org/gramps-manual/2.2/en/ch03s10.html#tools-util-cfe help manual] if necessary. Once a filter is defined, you can test it in the People view, by selecting the filter in the Filter Sidebar, and clicking find. You can combine filters (yes, it helps if you have experience with  some basic and/or logic) until you have a selection of all the people you want on your website.
  
 
==Make a Home Page, Introduction Page, and more==
 
==Make a Home Page, Introduction Page, and more==
 
===What?===
 
===What?===
Before you use the plugin ''NarrativeWeb'', you should make some custom pages with the information not yet in GRAMPS:  
+
Before you use the plugin ''NarrativeWeb'', you should make some custom pages with the information not yet in Gramps:  
 
* a Home page: the starting page of the website
 
* a Home page: the starting page of the website
 
* Introduction Page: page where you can give an introduction of your research, ...
 
* Introduction Page: page where you can give an introduction of your research, ...
Line 27: Line 27:
 
* Publisher info: extra information on you, the publisher of the page, to appear on every page
 
* Publisher info: extra information on you, the publisher of the page, to appear on every page
  
Note that GRAMPS works with stylesheets, so the exact ordering, and look of the website is all contained in '''one''' file, the stylesheet, eg narrative.css. You should at this moment NOT concern yourself about style, only content, and some basic markup (paragraphs, italic/bold text, div sections, ...).
+
Note that Gramps works with stylesheets, so the exact ordering, and look of the website is all contained in '''one''' file, the stylesheet, eg narrative.css. You should at this moment NOT concern yourself about style, only content, and some basic markup (paragraphs, italic/bold text, div sections, ...).
  
 
===How?===
 
===How?===
Go to the Media View in GRAMPS, and click on the add icon. In the ''Select a media object'' dialog, you need to click on the option ''Internal Note'', and give a title, eg ''Home Page'', ''Footer'', ...
+
Go to the Media View in Gramps, and click on the add icon. In the ''Select a media object'' dialog, you need to click on the option ''Internal Note'', and give a title, eg ''Home Page'', ''Footer'', ...
 
Next, you select the new media object, and edit it (double click or Edit button). Everything you write in the Note tab of the media object, will appear on your webpage if you select this media object during the website generation.
 
Next, you select the new media object, and edit it (double click or Edit button). Everything you write in the Note tab of the media object, will appear on your webpage if you select this media object during the website generation.
 
   
 
   
If you know html, you can just type the text with the needed html codes. If you do not know html, consider making a page with a web editor like Bluefish, Quanta Plus, ... . These contain icons to dynamically create webpages. The html text created like this can then be copied in the note section of your ''Home Page'' GRAMPS media object.
+
If you know html, you can just type the text with the needed html codes. If you do not know html, consider making a page with a web editor like Bluefish, Quanta Plus, ... . These contain icons to dynamically create webpages. The html text created like this can then be copied in the note section of your ''Home Page'' Gramps media object.
  
 
Tip: if you are experienced with style, you can use specific div tags in your pages, and edit the style sheet to contain your custom tags.
 
Tip: if you are experienced with style, you can use specific div tags in your pages, and edit the style sheet to contain your custom tags.
Line 40: Line 40:
 
==Choosing the layout==
 
==Choosing the layout==
  
GRAMPS has some nice standard layout schemes. Those are kept in so-called cascading style sheets (.css files). In GRAMPS 2.2.x, six are supplied. You are free to edit these files (other lettertypes, other colours, ...).
+
Gramps has some nice standard layout schemes. Those are kept in so-called cascading style sheets (.css files). In Gramps 2.2.x, six are supplied. You are free to edit these files (other lettertypes, other colours, ...).
  
 
Whatever the style you choose, after generation, it will default to the ''narrative.css''  file which will be placed in the dir you indicate. If you have some experience with websites you can easily customise this one file and without changing the content files, your web pages will be completely changed to the form, colours, etc. that you specified. Do backup these changes, as you might easily regenerate your website and overwrite this file by error.
 
Whatever the style you choose, after generation, it will default to the ''narrative.css''  file which will be placed in the dir you indicate. If you have some experience with websites you can easily customise this one file and without changing the content files, your web pages will be completely changed to the form, colours, etc. that you specified. Do backup these changes, as you might easily regenerate your website and overwrite this file by error.
  
 
Examples of the 6 styles:
 
Examples of the 6 styles:
*Modern - See example [http://familiemalengier.be/ Malengier]
+
*Modern - TODO
 
*Business - TODO
 
*Business - TODO
 
*Certificate - TODO
 
*Certificate - TODO
*Antique - See example [http://ancestry.queervisions.com/ The Coy Yaeger Ancestry Project]
+
*Antique - TODO
 
*Tranquil - TODO
 
*Tranquil - TODO
 
*Sharp - TODO
 
*Sharp - TODO
  
If you make a nice custom style sheet, please share with other GRAMPS users. You can do this by adding a link to your webpage in the examples below and adding to your css file that its copyright is creative commons alike, or you can send it to the developers on: gramps-devel <at> lists.sourceforge.net
+
If you make a nice custom style sheet, please share with other Gramps users. You can do this by adding a link to your webpage in the examples below and adding to your css file that its copyright is creative commons alike, or you can send it to the developers on: gramps-devel <at> lists.sourceforge.net
  
 
==Generate the pages==
 
==Generate the pages==
  
In the Report menu, choose ''Web Page-->Narrative Web Site''.
+
In the Report menu, choose {{man menu|Web Page-->Narrative Web Site}}.
  
Chose a suitable directory where you want to generate your website locally. It is best to do this locally, and upload your website only afterwards.  
+
Choose a suitable directory where you want to generate your website locally. It is best to do this locally, and upload your website only afterwards.  
  
 
In the Report Options Tab, set the filter you created. Choose a '''GOOD''' title for your webpage. Choose file extension: html (the rest is for experienced users), Set character encoding to Unicode (only use other encoding if you have very specific reasons). Choose the style you want and set the copyright notice (use the footer for specific extra legalese necessary in your country). '''Think about copyright!'''  Ancestor graph generation relates to the how many ancestors will be visible on the people pages in a nice graph. Try different settings for this.
 
In the Report Options Tab, set the filter you created. Choose a '''GOOD''' title for your webpage. Choose file extension: html (the rest is for experienced users), Set character encoding to Unicode (only use other encoding if you have very specific reasons). Choose the style you want and set the copyright notice (use the footer for specific extra legalese necessary in your country). '''Think about copyright!'''  Ancestor graph generation relates to the how many ancestors will be visible on the people pages in a nice graph. Try different settings for this.
Line 64: Line 64:
 
In the Page Generation Tab, choose the internal notes you created, as related above. I suggest you suppress the GRAMPS ID, as visitors are not interested in this. Be careful with the option ''Include images and media objects''. '''Only choose this option if:
 
In the Page Generation Tab, choose the internal notes you created, as related above. I suggest you suppress the GRAMPS ID, as visitors are not interested in this. Be careful with the option ''Include images and media objects''. '''Only choose this option if:
 
# your site can be VERY big
 
# your site can be VERY big
# you extensively use the private marker on sensitive data'''. Many people have burnt themselves with this option, publishing private email conversations they stored for research reasons in GRAMPS, on the net without realising.
+
# you extensively use the private marker on sensitive data'''. Many people have burnt themselves with this option, publishing private email conversations they stored for research reasons in Gramps, on the net without realizing.
  
The Privacy Tab '''is one of the most important settings''' . Make it a habit to never include private data, and restrict the information on living people. I suggest you set the ''years to restrict from person's death'' to a '''minimum of 25 years'''! This will prevent grave mistakes having sour consequences. Many genealogists have found themselves in disputes due to publication of information on living people. You have been warned. Also take into account local legislation (very strict in eg Italy, France).  
+
The Privacy Tab '''is one of the most important settings''' . Make it a habit to never include private data, and restrict the information on living people. I suggest you set the ''years to restrict from person's death'' to a '''minimum of 25 years'''! This will prevent grave mistakes having sour consequences. Many genealogists have found themselves in disputes due to publication of information on living people. You have been warned. Also take into account local legislation (very strict in e.g. Italy, France).  
  
Now you just click ok and GRAMPS starts generating your web page : a lot of files and directories will be made, so this will take some time. But when it is completed you will be the proud owner of a complete structure ready to publish on the WWW.
+
Now you just click ok and Gramps starts generating your web page : a lot of files and directories will be made, so this will take some time. But when it is completed you will be the proud owner of a complete structure ready to publish on the WWW.
  
 
==Regeneration of your site==
 
==Regeneration of your site==
Every time you change your database you need to regenerate your site to see the changes. Although GRAMPS will regenerate the entire site, '''only the pages with changed data''' will be different. You therefore need not republish all the website to the internet again, but can limit yourself to only upload the changed pages. Specific tools to do this exist, like sitecopy. See further.
+
Every time you change your database you need to regenerate your site to see the changes. Although Gramps will regenerate the entire site, '''only the pages with changed data''' will be different. You therefore need not republish all the website to the internet again, but can limit yourself to only upload the changed pages. Specific tools to do this exist, like sitecopy. See further.
  
'''Limitation''': If you upgrade GRAMPS, changes might have happened to the website generation, meaning all pages will have changed. Investigate this before you upgrade, and consider the benefits of upgrading against this possible drawback.
+
'''Limitation''': If you upgrade Gramps, changes might have happened to the website generation, meaning all pages will have changed. Investigate this before you upgrade, and consider the benefits of upgrading against this possible drawback.
  
 
==Publishing==
 
==Publishing==
Line 82: Line 82:
 
First, check the size of your web page. Go to the directory where you stored the web site, and in a modern file browser, right-click and select properties. This normally allows to calculate the directory size. Write down this info, and check your webhosting contract. Above a certain size, you will need to pay extra. Investigate before you burn yourself! If your site is too large, you can make a filter which produces a smaller website, or disable images, or split your site in pieces, and host it with different providers.
 
First, check the size of your web page. Go to the directory where you stored the web site, and in a modern file browser, right-click and select properties. This normally allows to calculate the directory size. Write down this info, and check your webhosting contract. Above a certain size, you will need to pay extra. Investigate before you burn yourself! If your site is too large, you can make a filter which produces a smaller website, or disable images, or split your site in pieces, and host it with different providers.
  
There are some free providers around: eg Lycos , but there are maybe better alternatives. Also GRAMPS offers '''free''' hosting of family website. Check out [[GRAMPS:Webhosting|webhosting by the GRAMPS project]].
+
There are some free providers around: eg Lycos , but there are maybe better alternatives.
  
 
===Transfer your files===
 
===Transfer your files===
*[[sitecopy]]: This is generally the best option. Only changed pages are uploaded to the server hosting your website. You can install sitecopy with every distribution via the package manager. Read the manual, it is self-explanatory: type in a console <code>man sitecopy</code> (or in konqueror type address <code>man:sitecopy</code>).
+
*[[sitecopy]]: This is generally the best option. Only changed pages are uploaded to the server hosting your website. You can install sitecopy with every distribution via the package manager. Read the manual, it is self-explanatory: type in a console <code>man sitecopy</code> (or in konqueror type address <code>man:sitecopy</code>). Windows or Mac OS  users could try [http://filezilla-project.org/ FileZilla client].
 
*rsync : This is for advanced linux users. It is a better solution than sitecopy, but you need full access to the webhost, which normal users normally not have. Rsync only uploads the changes to a file, whereas sitecopy uploads the entire file.
 
*rsync : This is for advanced linux users. It is a better solution than sitecopy, but you need full access to the webhost, which normal users normally not have. Rsync only uploads the changes to a file, whereas sitecopy uploads the entire file.
*ftp/ssh: You can also use a wide range of ftp clients to upload your site. The easiest for new users is in GNOME/KDE, go to Remote Places, and click to add a new remote place. Choose the settings for your provider (ftp/ssh, login, password), and now you can drag and drop files in Nautilius/Konqueror, like on your own PC. You can also use one of the many specific ftp applications, like gFTP (it should be in the repositories of your distribution). Basically you transfer all the files to the server and that's it. However : as you have probably seen, you created with "NarrativeWeb" an awefull lot of directories and files, so transferring the vast amount of files will take some time! If you update your site often, consider learning sitecopy!
+
*ftp/ssh: You can also use a wide range of ftp clients to upload your site. The easiest for new users is in GNOME/KDE, go to Remote Places, and click to add a new remote place. Choose the settings for your provider (ftp/ssh, login, password), and now you can drag and drop files in Nautilius/Konqueror, like on your own PC. You can also use one of the many specific ftp applications, like gFTP (it should be in the repositories of your distribution). Basically you transfer all the files to the server and that's it. However : as you have probably seen, you created with "NarrativeWeb" an awful lot of directories and files, so transferring the vast amount of files will take some time! If you update your site often, consider learning sitecopy!
  
 
== Examples of websites==
 
== Examples of websites==
Feel free to add your with GRAMPS generated website here. Please, remove missing links if you encounter those. Style is one of the GRAMPS styles, or custom.
+
Feel free to add your with Gramps generated website here. Please, remove missing links if you encounter those. Style is one of the Gramps styles, or custom.
  
 
{|{{prettytable}} align="center"
 
{|{{prettytable}} align="center"
 
|- bgcolor="#8DA7D6" align="center"  
 
|- bgcolor="#8DA7D6" align="center"  
 
|'''Site'''||'''Style'''||'''Language'''||'''Comment'''
 
|'''Site'''||'''Style'''||'''Language'''||'''Comment'''
|-
 
|[http://familiemalengier.be/ Malengier] ||Modern || Dutch 
 
 
|-
 
|-
 
|[http://users.telenet.be/frederik.de.richter/stamvaders.html De Richter]||Custom made ||Dutch || version 2.2.6
 
|[http://users.telenet.be/frederik.de.richter/stamvaders.html De Richter]||Custom made ||Dutch || version 2.2.6
|-
 
|[http://ancestry.queervisions.com/ The Coy Yaeger Ancestry Project] ||Antique || English || version 2.2.6
 
 
|-
 
|-
 
|[http://family.dave.org.uk/ Cross Family Tree]||Basic (Ash)||English||version 3.04  
 
|[http://family.dave.org.uk/ Cross Family Tree]||Basic (Ash)||English||version 3.04  
 +
|-
 +
|[http://www.xs4all.nl/~bosharst/gramps/ Van den Bos - Van der Harst]||Basic (Spruce)||Dutch||version 3.3.1-1
 +
|-
 +
|[http://arakiel.co.uk/tree/ Arakiel & Families of The Marches]||Basic (Ash)||English||version 3.2.0-1
 
|}
 
|}
  
 
== Comparison with other programs==
 
== Comparison with other programs==
There are two types of genealogy websites: static and dynamic. Static pages are ideal if you are limited with webspace, or want full control over your data. You have a genealogical database on your PC, and you select the data you want on a website, you upload this, and you are finished. GRAMPS website generation belongs in this category.
+
There are two types of genealogy websites: static and dynamic. Static pages are ideal if you are limited with webspace, or want full control over your data. You have a genealogical database on your PC, and you select the data you want on a website, you upload this, and you are finished. Gramps website generation belongs in this category.
  
 
Dynamic websites have all the genealogical data on a server, and dynamically offer webpages, typically with javascript. This normally requires more disk space, however due to compression of the data, this might not be too bad. Dynamic websites are a great tool to collaborate on genealogical research with other people, as you normally have the option to change the data from within the website. For example, [http://www.phpgedview.net/ PhpGedview] is an open source project offering exactly this. A possible disadvantage is that for this too work, your service provider must offer you sufficient bandwith, or otherwise serving pages can be slow.
 
Dynamic websites have all the genealogical data on a server, and dynamically offer webpages, typically with javascript. This normally requires more disk space, however due to compression of the data, this might not be too bad. Dynamic websites are a great tool to collaborate on genealogical research with other people, as you normally have the option to change the data from within the website. For example, [http://www.phpgedview.net/ PhpGedview] is an open source project offering exactly this. A possible disadvantage is that for this too work, your service provider must offer you sufficient bandwith, or otherwise serving pages can be slow.
  
The beauty of open source is that you can choose the environment to work with, and the environment to generate your website with. The benefits of collaborating should also not be exaggerated, however, it might be a good idea to offer in the footer of your GRAMPS generated website the option to send you feedback, like the example on [http://developers.gramps-project.org/tiki-index.php?page=MissingInformationReport this page].
+
The beauty of open source is that you can choose the environment to work with, and the environment to generate your website with. The benefits of collaborating should also not be exaggerated, however, it might be a good idea to offer in the footer of your Gramps generated website the option to send you feedback, like the example on [http://developers.gramps-project.org/tiki-index.php?page=MissingInformationReport this page].
  
 
== Changes you can do - For more advanced Users==
 
== Changes you can do - For more advanced Users==
Line 118: Line 118:
 
===Changing the narrative.css===
 
===Changing the narrative.css===
  
As mentioned, with a standard text editor (gedit) you can adapt your css file. Not happy with the colours or fonts? Change them! The beauty of the cascading style sheet is that if you make a change here, all your pages will change. Dada! Now one thing to watch out for is that if you make changes and you finally obtained a good style sheet, that you save a backup in another directory than the one GRAMPS made. Why? The next time you let GRAMPS generate some webpages, the program will re-install the default narrative.css and bye bye changes. You can on regeneration of your website select the option in GRAMPS to NOT use a css, but this is easily overseen, especially if you generate different websites with different requirements
+
As mentioned, with a standard text editor (gedit) you can adapt your css file. Not happy with the colours or fonts? Change them! The beauty of the cascading style sheet is that if you make a change here, all your pages will change. Dada! Now one thing to watch out for is that if you make changes and you finally obtained a good style sheet, that you save a backup in another directory than the one Gramps made. Why? The next time you let Gramps generate some webpages, the program will re-install the default narrative.css and bye bye changes. You can on regeneration of your website select the option in Gramps to NOT use a css, but this is easily overseen, especially if you generate different websites with different requirements
  
 
===Go for the real thing===
 
===Go for the real thing===
If everything went according to plan, you can repeat all the steps with a larger number of people. However, be cautious But hold your horses for just a sec First check out the amount of Mb this first attempt generated. This is important as your host limits the amount of data you can put on his server. Lycos for example (the free as in beer version) allows you a nifty 50 Mb. But as your database can hold an unlimited amount of persons and pictures this is easily obtained. A very important parameter is the amount of images (media objects) you put on your site. If you have, say 50 images of  500 Kb then half of your diskspace is gone already.
+
If everything went according to plan, you can repeat all the steps with a larger number of people. However, be cautious But hold your horses for just a sec First check out the amount of MB this first attempt generated. This is important as your host limits the amount of data you can put on his server. Lycos for example (the free as in beer version) allows you a nifty 50 MB. But as your database can hold an unlimited amount of persons and pictures this is easily obtained. A very important parameter is the amount of images (media objects) you put on your site. If you have, say 50 images of  500 KB then half of your diskspace is gone already.
  
 
===Splitting the database for hosting===
 
===Splitting the database for hosting===
  
What if your database is really really huge? I did not try this yet, but you could split your data, say ''the descendants of Jacobus Roelants''  on one Lycos site and the other part of the family ''the descendants of Sebadiah Johansson '' on another Lycos site and so on. It should be fairly easy to install links to switch between sites, eg in the home page, as the directory structure GRAMPS generates does not change.
+
What if your database is really really huge? I did not try this yet, but you could split your data, say ''the descendants of Jacobus Roelants''  on one Lycos site and the other part of the family ''the descendants of Sebadiah Johansson '' on another Lycos site and so on. It should be fairly easy to install links to switch between sites, eg in the home page, as the directory structure Gramps generates does not change.
  
 
===Changing a word present on multiple pages===
 
===Changing a word present on multiple pages===
  
 
  #! /bin/sh
 
  #! /bin/sh
  # filename : replaceall.sh
+
  # filename : replaceall
  # no BAKCUPS with this script.
+
  # usage: ./replaceall X Y
 +
# -------------------------------------------------------
 
  find . -type f -name '*.html' -print | while read i
 
  find . -type f -name '*.html' -print | while read i
 
  do
 
  do
  sed "s|$1|$2|g" $i > $i.tmp && mv $i.tmp $i
+
  sed -i.BAK "s|$1|$2|g" $i
 
  done
 
  done
  
To name this file ''replaceall'', give him executive rights. Then start the script at the root of we-site generated by Gramps :
+
This will find all programs here and below, and changes all X to Y. This uses the -i (in-place edits) available on most sed editor programs. It also creates backup copies (ending in .BAK) of the files that change. You may need to use special escaping characters if you use replaceall.sh with more than just simple letters.
 +
 
 +
Save this as a file named ''replaceall'', give it executive rights (chmod +x). Then start the script at the root of web site generated by Gramps :
  
 
  $ ./replaceall Souche Arbre
 
  $ ./replaceall Souche Arbre
  
Source : [http://pascal.ledisque.free.fr/wordpress/?p=1122 Pascal Le Disqué]
+
Which will change all instances of "Souche" with "Arbre" in all files ending in .html. To replace more than one word, use double quotes, like:
 +
 
 +
$ ./replaceall "Souche Family" "Arbre Family Tree"
 +
 
 +
Source :  
 +
 
 +
* [http://pascal.ledisque.free.fr/wordpress/?p=1122 Pascal Le Disqué]
 +
* Enhancement by D.S. Blank, Aug 18, 2009
  
 
==Code modifications==
 
==Code modifications==
 +
 +
===Alternate Code===
 +
 +
See [http://www.thomjoy.us/gramps.html ThomsWeb].
  
 
===Multilingual Web Site===
 
===Multilingual Web Site===
Line 151: Line 165:
 
[http://www.chailloux.org/public/geneal/gramps/ Here] an attempt :
 
[http://www.chailloux.org/public/geneal/gramps/ Here] an attempt :
  
5 line change on 'NarrativeWeb.py'
+
Line change on 'NarrativeWeb.py'
  
<JER> add the country icons, using the #PATH# trick
+
<pre>
#    msg = _('Generated by <a href="http://gramps-project.org">'  
+
  _ML = [ '<a href="/cgi-bin/changelanguage?fr" title="page
# 'GRAMPS</a> on %(date)s') % { 'date' : value }
+
    en français"> '  
      msg = _('Generated by <a href="http://gramps-project.org">'
+
    '<img alt="drapeau français" title="drapeau français" ' 'src="%(fr_fname)s" /></a> ',
          'GRAMPS</a> on %(date)s \n'  
+
    '<a href="/cgi-bin/changelanguage?pl" title="Wersja Polska"> '
          '<a href="/cgi-bin/changelanguage?fr" title="page en français"><img  
+
    '<img alt="Polska Flaga" title="Polska Flaga" ' 'src="%(pl_fname)s" /></a> ',
          src="#PATH#../graphics/nav32x16_fr.png" alt="FR"></a>\n'  
+
    '<a href="/cgi-bin/changelanguage?en" title="Page in English"> '
          '<a href="/cgi-bin/changelanguage?pl" title="Wersja Polska"><img src="#PATH#../graphics
+
    '<img alt="English Flag" title="English Flag" ' 'src="%(en_fname)s" /></a> '
          /nav32x16_pl.png" alt="PL"></a>\n'  
+
    ]
          ' <a href="/cgi-bin/changelanguage?en" title="Page in English"><img
+
</pre>
          src="#PATH#../graphics/nav32x16_en.png" alt="EN"></a>\n'
+
 
          ) % { 'date' : value }  
+
...
     msg = msg.replace('#PATH#',path)  
+
 
#</JER>
+
<pre>
 +
  elif 0 < copy_nr < len(_CC):
 +
    frfnm = os.path.join("graphics", "nav32x16_fr.png")
 +
    frfnm = self.report.build_url_fname(frfnm, None, self.up)
 +
    plfnm = os.path.join("graphics", "nav32x16_pl.png")
 +
    plfnm = self.report.build_url_fname(plfnm, None, self.up)
 +
    enfnm = os.path.join("graphics", "nav32x16_en.png")
 +
    enfnm = self.report.build_url_fname(enfnm, None, self.up)
 +
    fname = os.path.join("images", "somerights20.gif")
 +
    fname = self.report.build_url_fname(fname, None, self.up)  
 +
    text = '' text += _ML[0] % {'fr_fname' : frfnm}  
 +
     text += _ML[1] % {'pl_fname' : plfnm}
 +
    text += _ML[2] % {'en_fname' : enfnm}
 +
    text += _CC[copy_nr] % {'gif_fname' : fname}
 +
of.write('\t<p id="copyright">%s</p>\n' % text)
 +
</pre>  
  
 
* The script for pages generation
 
* The script for pages generation
Line 172: Line 201:
 
<pre>
 
<pre>
 
#/bin/sh
 
#/bin/sh
BASE='/home/jerome/jerome/Geneal/Sites/www.chailloux.org/public/geneal/gramps'
+
 
 +
HOME='/home/jerome'
 +
SITE="$HOME/geneal/Sites"
 +
BASE="$SITE/www.chailloux.org/public/geneal/gramps
 +
 
 
rm -r $BASE/images/*  
 
rm -r $BASE/images/*  
 
rm -r $BASE/thumb/*  
 
rm -r $BASE/thumb/*  
Line 188: Line 221:
 
DB="/home/jerome/.gramps/grampsdb/49a46209"  
 
DB="/home/jerome/.gramps/grampsdb/49a46209"  
  
OPT1="of=/home/jerome/jerome/Geneal/Sites"  
+
OPT1="of=$SITE,"  
 
OPT2="filter=0,living=1,incpriv=0"  
 
OPT2="filter=0,living=1,incpriv=0"  
 
OPT3="encoding=utf-8"  
 
OPT3="encoding=utf-8"  
 
OPT4="pid=I0000"  
 
OPT4="pid=I0000"  
 +
 +
OPT=$OPT1$OPT2$OPT3$OPT4
  
 
# FR  
 
# FR  
Line 197: Line 232:
 
LANG=fr_FR.UTF-8  
 
LANG=fr_FR.UTF-8  
  
gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/fr,$OPT1,$OPT2,$OPT3,$OPT4,\
+
gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/fr,homenote=N1010,title="Arbre des familles Chailloux - Żelaska",$OPT
title="Arbre des familles Chailloux - Żelaska",homenote=N0100
+
  
 
# PL
 
# PL
Line 204: Line 238:
 
LANG=pl_PL.UTF-8  
 
LANG=pl_PL.UTF-8  
  
gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/pl,$OPT1,$OPT2,$OPT3,$OPT4,\
+
gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/pl,homenote=N1011,title="Drzewo rodziny Chailloux - Żelaskich",$OPT
title="Drzewo rodziny Chailloux - Żelaskich",homenote=N0101
+
  
 
# EN  
 
# EN  
Line 211: Line 244:
 
LANG=en_EN.UTF-8  
 
LANG=en_EN.UTF-8  
  
gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/en,$OPT1,$OPT2,$OPT3,$OPT4,\
+
gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/en,homenote=N1012,title="Chailloux - Żelaska family tree",$OPT
title="Chailloux - Żelaska family tree",homenote=N0102
+
 
</pre>
 
</pre>
  
Line 221: Line 253:
 
my $ptr = $ENV{'HTTP_REFERER'};  
 
my $ptr = $ENV{'HTTP_REFERER'};  
 
my $new = "\/$ENV{'QUERY_STRING'}\/";  
 
my $new = "\/$ENV{'QUERY_STRING'}\/";  
 +
 
my $fr = '/fr/';  
 
my $fr = '/fr/';  
 
my $pl = '/pl/';  
 
my $pl = '/pl/';  
Line 252: Line 285:
  
 
[http://www.gramps-project.org/bugs/view.php?id=2313 Patch] was shared on mailing list.
 
[http://www.gramps-project.org/bugs/view.php?id=2313 Patch] was shared on mailing list.
 +
 +
===Animal pedigree===
 +
 +
You can use Gramps for generating an [[Animal_pedigree|Animal Pedigree]] !
  
 
==Comments==
 
==Comments==
  
 
If you have any comments, remarks, suggestions or alterations/adaptations or plain questions send me an e-mail frederik.de.richter at pandora.be. You could also edit this wiki page, or use the Talk page. It's free source so use it.
 
If you have any comments, remarks, suggestions or alterations/adaptations or plain questions send me an e-mail frederik.de.richter at pandora.be. You could also edit this wiki page, or use the Talk page. It's free source so use it.

Revision as of 14:51, 8 May 2013

Gramps-notes.png
This page needs a cleanup. Please help keep Gramps Wiki a useful resource by refactoring this page. Consider also updating the screenshots.

This is a Howto on how to make a genealogy website with Gramps 2.2.x. and the NarrativeWeb plugin.

The website will be made with the narrative website report, of which the interface is described at: Generating Web pages. The goal is to offer a complete howto/tutorial on using this report, from conception, to uploading your genealogical website to an internet service provider (ISP).

Before you start

You can easily generate a nice looking web site from within Gramps.

Before you start you should have an idea about the data you want to have on the website. If you are not careful, and generate a webpage from your complete database, the amount of generated files can be huge, as well as taking up a lot of space.

How to limit the amount of data

If you have a large database, it is wise to start with a filter to limit the number of people: In the People view of Gramps, go to the View menu, and activate the Filter sidebar. Next, go to Edit --> Person Filter Editor menu, and make a suitable filter. Read the help manual if necessary. Once a filter is defined, you can test it in the People view, by selecting the filter in the Filter Sidebar, and clicking find. You can combine filters (yes, it helps if you have experience with some basic and/or logic) until you have a selection of all the people you want on your website.

Make a Home Page, Introduction Page, and more

What?

Before you use the plugin NarrativeWeb, you should make some custom pages with the information not yet in Gramps:

  • a Home page: the starting page of the website
  • Introduction Page: page where you can give an introduction of your research, ...
  • Custom footnote: the footnote to appear on the site
  • Custom header: a custom header to appear on the top of every page
  • Publisher info: extra information on you, the publisher of the page, to appear on every page

Note that Gramps works with stylesheets, so the exact ordering, and look of the website is all contained in one file, the stylesheet, eg narrative.css. You should at this moment NOT concern yourself about style, only content, and some basic markup (paragraphs, italic/bold text, div sections, ...).

How?

Go to the Media View in Gramps, and click on the add icon. In the Select a media object dialog, you need to click on the option Internal Note, and give a title, eg Home Page, Footer, ... Next, you select the new media object, and edit it (double click or Edit button). Everything you write in the Note tab of the media object, will appear on your webpage if you select this media object during the website generation.

If you know html, you can just type the text with the needed html codes. If you do not know html, consider making a page with a web editor like Bluefish, Quanta Plus, ... . These contain icons to dynamically create webpages. The html text created like this can then be copied in the note section of your Home Page Gramps media object.

Tip: if you are experienced with style, you can use specific div tags in your pages, and edit the style sheet to contain your custom tags.


Choosing the layout

Gramps has some nice standard layout schemes. Those are kept in so-called cascading style sheets (.css files). In Gramps 2.2.x, six are supplied. You are free to edit these files (other lettertypes, other colours, ...).

Whatever the style you choose, after generation, it will default to the narrative.css file which will be placed in the dir you indicate. If you have some experience with websites you can easily customise this one file and without changing the content files, your web pages will be completely changed to the form, colours, etc. that you specified. Do backup these changes, as you might easily regenerate your website and overwrite this file by error.

Examples of the 6 styles:

  • Modern - TODO
  • Business - TODO
  • Certificate - TODO
  • Antique - TODO
  • Tranquil - TODO
  • Sharp - TODO

If you make a nice custom style sheet, please share with other Gramps users. You can do this by adding a link to your webpage in the examples below and adding to your css file that its copyright is creative commons alike, or you can send it to the developers on: gramps-devel <at> lists.sourceforge.net

Generate the pages

In the Report menu, choose Web Page-->Narrative Web Site.

Choose a suitable directory where you want to generate your website locally. It is best to do this locally, and upload your website only afterwards.

In the Report Options Tab, set the filter you created. Choose a GOOD title for your webpage. Choose file extension: html (the rest is for experienced users), Set character encoding to Unicode (only use other encoding if you have very specific reasons). Choose the style you want and set the copyright notice (use the footer for specific extra legalese necessary in your country). Think about copyright! Ancestor graph generation relates to the how many ancestors will be visible on the people pages in a nice graph. Try different settings for this.

In the Page Generation Tab, choose the internal notes you created, as related above. I suggest you suppress the GRAMPS ID, as visitors are not interested in this. Be careful with the option Include images and media objects. Only choose this option if:

  1. your site can be VERY big
  2. you extensively use the private marker on sensitive data. Many people have burnt themselves with this option, publishing private email conversations they stored for research reasons in Gramps, on the net without realizing.

The Privacy Tab is one of the most important settings . Make it a habit to never include private data, and restrict the information on living people. I suggest you set the years to restrict from person's death to a minimum of 25 years! This will prevent grave mistakes having sour consequences. Many genealogists have found themselves in disputes due to publication of information on living people. You have been warned. Also take into account local legislation (very strict in e.g. Italy, France).

Now you just click ok and Gramps starts generating your web page : a lot of files and directories will be made, so this will take some time. But when it is completed you will be the proud owner of a complete structure ready to publish on the WWW.

Regeneration of your site

Every time you change your database you need to regenerate your site to see the changes. Although Gramps will regenerate the entire site, only the pages with changed data will be different. You therefore need not republish all the website to the internet again, but can limit yourself to only upload the changed pages. Specific tools to do this exist, like sitecopy. See further.

Limitation: If you upgrade Gramps, changes might have happened to the website generation, meaning all pages will have changed. Investigate this before you upgrade, and consider the benefits of upgrading against this possible drawback.

Publishing

Now you can publish your work on the web.

Size and provider

First, check the size of your web page. Go to the directory where you stored the web site, and in a modern file browser, right-click and select properties. This normally allows to calculate the directory size. Write down this info, and check your webhosting contract. Above a certain size, you will need to pay extra. Investigate before you burn yourself! If your site is too large, you can make a filter which produces a smaller website, or disable images, or split your site in pieces, and host it with different providers.

There are some free providers around: eg Lycos , but there are maybe better alternatives.

Transfer your files

  • sitecopy: This is generally the best option. Only changed pages are uploaded to the server hosting your website. You can install sitecopy with every distribution via the package manager. Read the manual, it is self-explanatory: type in a console man sitecopy (or in konqueror type address man:sitecopy). Windows or Mac OS users could try FileZilla client.
  • rsync : This is for advanced linux users. It is a better solution than sitecopy, but you need full access to the webhost, which normal users normally not have. Rsync only uploads the changes to a file, whereas sitecopy uploads the entire file.
  • ftp/ssh: You can also use a wide range of ftp clients to upload your site. The easiest for new users is in GNOME/KDE, go to Remote Places, and click to add a new remote place. Choose the settings for your provider (ftp/ssh, login, password), and now you can drag and drop files in Nautilius/Konqueror, like on your own PC. You can also use one of the many specific ftp applications, like gFTP (it should be in the repositories of your distribution). Basically you transfer all the files to the server and that's it. However : as you have probably seen, you created with "NarrativeWeb" an awful lot of directories and files, so transferring the vast amount of files will take some time! If you update your site often, consider learning sitecopy!

Examples of websites

Feel free to add your with Gramps generated website here. Please, remove missing links if you encounter those. Style is one of the Gramps styles, or custom.

align="center"
Site Style Language Comment
De Richter Custom made Dutch version 2.2.6
Cross Family Tree Basic (Ash) English version 3.04
Van den Bos - Van der Harst Basic (Spruce) Dutch version 3.3.1-1
Arakiel & Families of The Marches Basic (Ash) English version 3.2.0-1

Comparison with other programs

There are two types of genealogy websites: static and dynamic. Static pages are ideal if you are limited with webspace, or want full control over your data. You have a genealogical database on your PC, and you select the data you want on a website, you upload this, and you are finished. Gramps website generation belongs in this category.

Dynamic websites have all the genealogical data on a server, and dynamically offer webpages, typically with javascript. This normally requires more disk space, however due to compression of the data, this might not be too bad. Dynamic websites are a great tool to collaborate on genealogical research with other people, as you normally have the option to change the data from within the website. For example, PhpGedview is an open source project offering exactly this. A possible disadvantage is that for this too work, your service provider must offer you sufficient bandwith, or otherwise serving pages can be slow.

The beauty of open source is that you can choose the environment to work with, and the environment to generate your website with. The benefits of collaborating should also not be exaggerated, however, it might be a good idea to offer in the footer of your Gramps generated website the option to send you feedback, like the example on this page.

Changes you can do - For more advanced Users

Changing your Home Page

If you made your own "HomePage", which I recommend strongly, you can easily edit this HTML file. Use a standard text editor (gedit will do quite nicely), and you can change the content. The same applies off course to the "Footer" and "IntroPage". If you know your way around with HTML you can add divs and extra markup. Remember to also put the newly defined div and classes in your edited css file.

Changing the narrative.css

As mentioned, with a standard text editor (gedit) you can adapt your css file. Not happy with the colours or fonts? Change them! The beauty of the cascading style sheet is that if you make a change here, all your pages will change. Dada! Now one thing to watch out for is that if you make changes and you finally obtained a good style sheet, that you save a backup in another directory than the one Gramps made. Why? The next time you let Gramps generate some webpages, the program will re-install the default narrative.css and bye bye changes. You can on regeneration of your website select the option in Gramps to NOT use a css, but this is easily overseen, especially if you generate different websites with different requirements

Go for the real thing

If everything went according to plan, you can repeat all the steps with a larger number of people. However, be cautious But hold your horses for just a sec First check out the amount of MB this first attempt generated. This is important as your host limits the amount of data you can put on his server. Lycos for example (the free as in beer version) allows you a nifty 50 MB. But as your database can hold an unlimited amount of persons and pictures this is easily obtained. A very important parameter is the amount of images (media objects) you put on your site. If you have, say 50 images of 500 KB then half of your diskspace is gone already.

Splitting the database for hosting

What if your database is really really huge? I did not try this yet, but you could split your data, say the descendants of Jacobus Roelants on one Lycos site and the other part of the family the descendants of Sebadiah Johansson on another Lycos site and so on. It should be fairly easy to install links to switch between sites, eg in the home page, as the directory structure Gramps generates does not change.

Changing a word present on multiple pages

#! /bin/sh
# filename : replaceall
# usage: ./replaceall X Y
# -------------------------------------------------------
find . -type f -name '*.html' -print | while read i
do
sed -i.BAK "s|$1|$2|g" $i
done

This will find all programs here and below, and changes all X to Y. This uses the -i (in-place edits) available on most sed editor programs. It also creates backup copies (ending in .BAK) of the files that change. You may need to use special escaping characters if you use replaceall.sh with more than just simple letters.

Save this as a file named replaceall, give it executive rights (chmod +x). Then start the script at the root of web site generated by Gramps :

$ ./replaceall Souche Arbre

Which will change all instances of "Souche" with "Arbre" in all files ending in .html. To replace more than one word, use double quotes, like:

$ ./replaceall "Souche Family" "Arbre Family Tree"

Source :

Code modifications

Alternate Code

See ThomsWeb.

Multilingual Web Site

Some people generated multilingual web site.

Here an attempt :

  • Line change on 'NarrativeWeb.py'
  _ML = [ '<a href="/cgi-bin/changelanguage?fr" title="page 
     en français"> ' 
     '<img alt="drapeau français" title="drapeau français" ' 'src="%(fr_fname)s" /></a> ',
     '<a href="/cgi-bin/changelanguage?pl" title="Wersja Polska"> '
     '<img alt="Polska Flaga" title="Polska Flaga" ' 'src="%(pl_fname)s" /></a> ',
     '<a href="/cgi-bin/changelanguage?en" title="Page in English"> ' 
     '<img alt="English Flag" title="English Flag" ' 'src="%(en_fname)s" /></a> '
     ] 

...

 elif 0 < copy_nr < len(_CC): 
     frfnm = os.path.join("graphics", "nav32x16_fr.png") 
     frfnm = self.report.build_url_fname(frfnm, None, self.up) 
     plfnm = os.path.join("graphics", "nav32x16_pl.png") 
     plfnm = self.report.build_url_fname(plfnm, None, self.up) 
     enfnm = os.path.join("graphics", "nav32x16_en.png") 
     enfnm = self.report.build_url_fname(enfnm, None, self.up) 
     fname = os.path.join("images", "somerights20.gif") 
     fname = self.report.build_url_fname(fname, None, self.up) 
     text = '' text += _ML[0] % {'fr_fname' : frfnm} 
     text += _ML[1] % {'pl_fname' : plfnm} 
     text += _ML[2] % {'en_fname' : enfnm} 
     text += _CC[copy_nr] % {'gif_fname' : fname}
 of.write('\t<p id="copyright">%s</p>\n' % text)
  • The script for pages generation
#/bin/sh

HOME='/home/jerome' 
SITE="$HOME/geneal/Sites" 
BASE="$SITE/www.chailloux.org/public/geneal/gramps"  

rm -r $BASE/images/* 
rm -r $BASE/thumb/* 
rm -r $BASE/fr/* 
rm -r $BASE/pl/* 
rm -r $BASE/en/* 

ln -s $BASE/images $BASE/fr/images 
ln -s $BASE/thumb $BASE/fr/thumb 
ln -s $BASE/images $BASE/pl/images 
ln -s $BASE/thumb $BASE/pl/thumb 
ln -s $BASE/images $BASE/en/images 
ln -s $BASE/thumb $BASE/en/thumb 

DB="/home/jerome/.gramps/grampsdb/49a46209" 

OPT1="of=$SITE," 
OPT2="filter=0,living=1,incpriv=0" 
OPT3="encoding=utf-8" 
OPT4="pid=I0000" 

OPT=$OPT1$OPT2$OPT3$OPT4 

# FR 
LANGUAGE=fr_FR:fr 
LANG=fr_FR.UTF-8 

gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/fr,homenote=N1010,title="Arbre des familles Chailloux - Żelaska",$OPT

# PL
LANGUAGE=pl_PL:pl
LANG=pl_PL.UTF-8 

gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/pl,homenote=N1011,title="Drzewo rodziny Chailloux - Żelaskich",$OPT 

# EN 
LANGUAGE=en_EN:en 
LANG=en_EN.UTF-8 

gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/en,homenote=N1012,title="Chailloux - Żelaska family tree",$OPT 
  • The 'changelanguage' cgi-bin
#!/usr/bin/perl 
my $ptr = $ENV{'HTTP_REFERER'}; 
my $new = "\/$ENV{'QUERY_STRING'}\/"; 

my $fr = '/fr/'; 
my $pl = '/pl/'; 
my $en = '/en/'; 

if ($ptr =~ $fr) { $ptr =~ s/$fr/$new/g; } 
elsif ($ptr =~ $pl) { $ptr =~ s/$pl/$new/g; } 
elsif ($ptr =~ $en) { $ptr =~ s/$en/$new/g; } 
else { $ptr="changelanguage_error:$ptr:$new:" }
 
print "Location: $ptr\n\n"; 
  • The resulting Web Site size

Why it is so important to share the images and the thumb directories among the various languages:

$ du -s * 
7328 en 
7340 fr 
64 graphics 
42148 images 
8 index.html 
7340 pl 
3968 thumb 
$

"Online maps" urls

Patch was shared on mailing list.

Animal pedigree

You can use Gramps for generating an Animal Pedigree !

Comments

If you have any comments, remarks, suggestions or alterations/adaptations or plain questions send me an e-mail frederik.de.richter at pandora.be. You could also edit this wiki page, or use the Talk page. It's free source so use it.