3 ms·
"No exotic dependencies and nothing to maintain" Oh really?: sed -E 's|(href="$(subst source,,$<))|class="current" \1|' header.html | cat - $< > $@ a sed
by jameshart 3y ago
"No exotic dependencies and nothing to maintain"
Oh really?:
sed -E 's|(href="$(subst source,,$<))|class="current" \1|' header.html | cat - $< > $@
a sed script that modifies HTML fragments isn't nothing. And this just does one thing that you might want to customize in the header for each page. It doesn't do things like handle pages having different <title> tags. Every feature like this that you come up with becomes another thing to maintain, and another thing that can catch you out later. When you come back to fix this later, will you even remember what it's supposed to do?
From a web publishing point of view, make and sed are exotic dependencies. There's not going to be a bunch of helpful pointers online to help you debug issues with using them for this purpose. When you google how to fix your sed regex to match specific HTML attributes and not match others, you're going to find stack overflow posts about Zalgo, not quick answers.
- deleted 3y ago[deleted]