375641
results for ""a""
-
[Zegnat] I use nunjucks to generate svg and js code as well, so clearly I am a reprobate.
[KevinMarks]
at
2025-03-29 16:28
-
I was kind of afraid to do it. I thought I would surely screw up some part of the logic. So I set up a unit test that would create the current output snapshots. Then I changed to the templating and really did test driven development. Or test driven refactoring anyway.
[artlung]
at
2025-03-29 16:02
-
artlung: haha, yeah that sounds like a great case to let a template engine do its thing! I recently experienced the reverse in a work project, turning client-side handlebars templates into PHP templates and having to resolve all the ambiguity that handlebars syntax happily hides was a pain 😅
[schmarty]
at
2025-03-29 15:56
-
<li><b>{{ title }}</b> <span>{{ artist }}</span> <a href='https://artlung.com/mixtapes/{{ slug }}'>{{ slug }}</a> </li>
[artlung]
at
2025-03-29 15:54
-
The mixtapes project is weirdly more complicated. I have tapes that are a single tape with 2 sides. I have tape series with multiple tapes. I have ones with artwork, ones without. I have CDs which don't have "sides". The data might have track timings or not. They may have additional notes or not. I have some with text in other languages. So doing that all in PHP gets to be really complicated.
[artlung]
at
2025-03-29 15:52
-
I have been writing a LOT of code and reworking things in the last year and mostly I haven't wanted to use templating. But all the cases there were things I knew what the output was.
[artlung]
at
2025-03-29 15:50
-
artlung: thanks! That makes sense! I have considered Twig (and sometimes Blade) for projects but usually the "PHP is a template language" voice in my head wins out and I just reach for PHPLeague's Plates 😅
[schmarty]
at
2025-03-29 15:49
-
It was not on my site, no. I was basically getting tired of a lot of manual printfs and conditionals to account for whetther there was data in a section or not and started considering Twig. Funny enough I was thinking of Smarty first because I am old but Twig seemed nice.
[artlung]
at
2025-03-29 15:47
-
I did a phpunit test that ran over the existing outputs and I checked against that when I was doing the work and it went pretty well.
[artlung]
at
2025-03-29 15:45
-
[artlung]: nice! You do not need a twig filter when writing out variables into HTML attribute values to make sure things are escaped?
Zegnat
at
2025-03-29 15:43
Sort by:
Filter results by:
Tag
Query took 0.04s.
Search tips
- Exclusion
- +foo -bar
- Logical OR
- foo OR bar
- Exact phrase
- "foo bar"
- Partial words
- foo*
- Particular fields only
- title:foo
- domain:example.org
- nick:somebody
- after:2016-11-23
- before:2016-11-23
- date:2016-11-23