CodeForPhilly / CodeForPhilly/codeforphilly.org

Create template for project cards on homepage

Offen
#46 8 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @tblacknc Auf GitHub ansehen
Vorherrschende Sprache
CSS
Sterne
10
Forks
7
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently, we show cards for selected projects on the homepage (codeforphilly.org):

![image](https://user-images.githubusercontent.com/2574498/150041290-80f2cb11-d29e-446f-bf71-5e76df0ad465.png)

However, the HTML for each card is repeated, with information like heading hard-coded:

https://github.com/CodeForPhilly/codeforphilly.org/blob/develop/html-templates/home.tpl#L100-L115

## Proposed Solution

If we use a template, then we can consolidate this repeated code into one place. In other words, we could have a template like this in the `home.tpl` page:

```
{template projectTile name description logo=no}

{$name|escape}


{$description|escape|markdown}
{/template}
```

And then create the individual cards using something like this:

```
{projectTile name="Project 1" description="## This is a cool project"}
{projectTile name="Project 2" description="## This is a another project"}
```

Here is a link to the [template engine docs (owoo)](https://web.archive.org/web/20200223131043/http://dwoo.org/documentation/v1.3/dwoo-for-designers.html). Note that it is fairly old, but if we can get our work pretty far, and post it on the #cfp-homepage-redesign channel, we can hopefully lean a bit on @themightychris to fill in any gaps.

## Outcome

The homepage should look the exact same, but the underlying code should be much cleaner, since it uses the template. If there are any useful changes to the look / homepage content, let's handle them after implementing a template (just to be sure we get templating down).

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.