From Fedora Project Wiki
Artwork DesignService fedorawebsitesbanner 3.png

Esta página descreve como corrigir um bug ou submeter outras alterações ao site do Projeto Fedora. Qualquer pessoa pode executar essas etapas e você não precisa de permissão especial para enviar um patch à lista websites para consideração.

Making changes

Nunca use conta root para isso
Não use a conta root do seu sistema para este trabalho. Todas essas etapas podem ser executadas por um usuário normal. Você só precisa fornecer a senha de root para instalar pacotes na primeira etapa.

Este procedimento mostra como copiar o repositório fedora-websites localmente e usar sua loja local para fazer mudanças.

  1. Certifique-se de ter o pacote Package-x-generic-16.pnggit e o Apache Web Service instalado:
    su -c 'dnf install git gettext python-genshi python-lxml python-setuptools python-dateutil python-dogpile-cache babel python-feedparser fedfind python-requests'
    su -c 'dnf groups install "Web Server"'
  2. Configure pelo menos seu nome e endereço de e-mail em sua configuração global do git, conforme mostrado no this section of the git quick reference.
  3. Certifique-se de estar em um diretório ao qual você tenha acesso de gravação, como seu diretório pessoal ou um subdiretório, e clone o repositório fedora-websites.
    cd $HOME
    git clone
  4. Note.png
    fedorahosted repository has been archived
    Our old repository on has been archived but is still available for consulting. Commits to this repo won't make it into the websites!
  5. Altere o diretório para o site que você deseja alterar. O repositório carrega vários sites, incluindo, e outros.
    cd fedora-websites/
  6. Você pode criar uma nova branch para suas alterações ou fazer seu trabalho em uma branch existente no projeto fedora-websites. Para criar uma nova branch apenas para o seu uso ("mychanges" é um nome que você pode escolher livremente):
    git checkout -b mychanges

    Se você quiser trabalhar em algo que já existe, faça uma nova branch para novas alterações, ou configure sua branch para rastrear as alterações nessa branch existente. Isso permite que você desenvolva o trabalho existente sem se preocupar em sobrescrever o trabalho da equipe. Por exemplo, se você quiser ajudar com a branch "fpo-redesign":

    git checkout -b mychanges --track origin/fpo-redesign
  7. Teste suas mudanças e correções.

    Após a conclusão com sucesso, o site agora estará disponível no /out/directory. Agora, execute um sandbox test no local do projeto:

    make test
  8. Abra em seu navegador o endereço http://localhost:5000 para exibir o site. Quando você terminar de visualizar, pare o servidor Web temporário:
    make stoptest
  9. Se tudo estiver OK, organize os arquivos que você alterou:
    git add data/content/file1.html data/content/file2.html
  10. Confirme as alterações em etapas:
    git commit -m 'Fix spelling errors'

Showing off your changes

You can copy the contents of the /out/ folder to a web share, if you have one, for viewing. Your space provides this under the ~/public_html/ folder.

ADVANCED USERS: You can also copy your git tree to your storage site, which allows us to easily pull them in. If you don't have a account, you'll need to post your changes somewhere and let us know.

Instructions for using your space are found on the wiki page.

Sending in your changes

You can either file a pull request, or send a patch. Filing a pull request is highly preferred.

Filing Pull Requests

This is the best method if you want to contribute to the websites team but are not yet a member of the team.

  1. Log into and then fork the fedora-websites git repository.
  2. Once you’ve forked the git repository, you will need to set the remote upstream git clone of your fork in order to track the official websites repository. While not mandatory, it’s conventional to call the remote upstream with the name upstream which can be done with the following command while within the directory of your local git clone of your fork.
    git remote add upstream
  3. Update your fork
  4. Pull upstream and merge into local master to make sure that your master branch is in line with the latest changes from upstream. Then push it to your clone so that origin knows about the changes.
    git pull --rebase upstream master
    git push origin master
  5. Checkout to your development branch
  6. You can now checkout to your development branch and push it to your remote repo on pagure:
    git push origin mychanges
  7. Open a pull request
  8. You can now open a pull request in

Sending a patch

This is less preferable than the pull request, but if for some reason you're not able to do a PR, you can still get your fix in.

  1. Create patch files for your changes:
    git format-patch origin/master
  2. Now you can send the patches you've created, which will have names such as 0001-my-change.patch, as a link to an external ressource like to the websites list. Please don't attach files to the ML, otherwise you can file a ticket and add the patch there.

Making text translatable

Text intended for a human reader should be made into translatable strings. Text to be translated should be surrounded by one of the following:

  • If the string contains other HTML markup such as special characters (such as < > found in HTML markup), surround the string like this:
  • If there is no such special markup or characters, surround the string like this:

In some cases, you may want a piece of text to be changeable without disturbing the rest of the translation. This is often the case with quantities that might change from release to release such as a file size. Here is an example of using named substitution to accomplish this goal:

${_('%(size)s, DVD ISO disc image for %(arch)s-bit PC') % {'size':'3.1 GB', 'arch':'32'}}

Many editors will automatically highlight this syntax. Others such as vim can be customized to do so. To add a vim specific color syntax, run the following:

vi ~/.vim/after/syntax/html.vim

Then, insert the code below into this new file.

" highlight Comment ctermfg=Green guifg=Green
  sy  match  htmlComment    /${_(["'].*["'])}/
  sy  match  htmlComment    /${Markup(_(["'].*["']))}/   

" error highlighted
  sy match htmlComment  /${_([0-9A-Za-z%].*')}/ contains=htmlCommentError
  sy match htmlComment  /${Markup((.*[)]{,1}}/  contains=htmlCommentError

This code is an example, and somewhat incomplete -- feel free to improve it and edit this page. For each HTML file, vim will override the default color with the comment color of the right strings, and highlight strings that have errors.


How do I avoid changing strings when I commit/push?

After you create your changes to an HTML file and run make, the POT and PO files are updated automatically. If you are working during a time when strings are supposed to be frozen for translators, you may not want to push these string changes out. Here's how to avoid that problem:

  • Use git add <filename> and git commit -m 'commit message' to commit your HTML changes. Remember to make these changes meaningful. Do not use git add . if you've made lots of unrelated changes; it's a bad habit.
  • Repeat previous step as often as needed to commit all changes.
  • Run git stash to stash the other changes you've made.
  • (Optional/Recommended?) Run git pull --rebase to make sure you've got the latest changes from upstream and that your changes don't cause any weird conflicts.
  • Run git push origin <branch-name> to push your HTML changes out.
  • Run git stash pop to bring your other changes back to the working tree, and off the stack of stashes.

How do I push my changes once I've become a member of the websites team?

If you've been bitten by the bug-fixing bug and are contributing on a regular basis, you'll want to update your git settings to push directly to the git repository. To do so, run git remote set-url origin ssh:// in your local fedora-websites repository.
At this point you should also read more about our workflow.

Additional information

The git quick reference might be useful for you, beyond just setting up your global configuration.

The Git Community Book is an excellent reference if you find git useful and want to learn more about it.

You don't have to be a member of the Websites team to help fix things on the site, but if you find yourself doing it more than once, you might want to join us!