ramiismail / dopresskit

presskit() - spend time making games, not press.
GNU General Public License v3.0
137 stars 50 forks source link

Fix additional links being shown with an empty #35

Open sttz opened 9 years ago

sttz commented 9 years ago

In project pages, additional links that don't contain a subpath (e.g. domain.com instead of domain.com/path) are shown with an empty title, i.e. not appearing at all in the rendered page.

The behavior of the code for additional links is also not in sync between the index page and project pages. The index pages compares the strpos result to !== false (does not contain) whereas the project page compares it to !== 0 (does not begin with), which causes the issue.

This pull requests fixes the issue and brings the behavior on the main page and project pages in line, always checking if the link contains a /.

I'm not sure if the behavior of this title-parsing is very useful anyway. I think it would be clearer to always show the link as it was entered and provide an optional title field in the xml to set the title manually.

sttz commented 9 years ago

I went ahead and implemented my suggestion as well. Now the link title is the output of parseLinkby default and can be set manually in the xml using a linktitle field.