summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Kylie McClain <somasis@exherbo.org> 2015-09-26 11:37:39 -0400
committerAvatar Kylie McClain <somasis@exherbo.org> 2015-09-26 11:37:39 -0400
commit05c71aedb5e1cfef6bec13f8d63fc8ad6104f428 (patch)
tree4e324175b18a7966e371bbbfb97a873ee94f091d
parent1286a5ad2ef205aedd95c437586a590d77af3d3b (diff)
downloadwww-05c71aedb5e1cfef6bec13f8d63fc8ad6104f428.tar.gz
www-05c71aedb5e1cfef6bec13f8d63fc8ad6104f428.tar.xz
Makefile: better regex for automagic links
Change-Id: I1fed5fc111a93c7bf73718ede8b411973a2c4b6c
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index a468755..284598f 100644
--- a/Makefile
+++ b/Makefile
@@ -8,9 +8,13 @@ all: $(addsuffix .html,$(basename $(shell find -type f -name '*.mkd' -not -whole
@echo "Generating $@ ..."
@ruby -e "File.open('$<.tmp', 'w') {|file| file.write File.read('$<').gsub(/#\{include ([0-9A-Za-z_.]+)\}/) {|z| File.read(\"#{\$$1}.part.tmpl\")}}"
@sed -i -e '1 s,^Title: ,Title: Exherbo - ,' $<.tmp
- @sed -i -r -e 's|[^\[`](\[pkg:)repository/(\S+)(\])|\[`repository/\2`\](//git.exherbo.org/summer/repositories/\2/index.html)|g' $<.tmp
- @sed -i -r -e 's|[^\[`](\[pkg:)(\S+/\S+)(\])|\[`\2`\](//git.exherbo.org/summer/packages/\2/index.html)|g' $<.tmp
- @sed -i -r -e 's,[^\[`](\[::(\w+)\]),\[`\1`\](//git.exherbo.org/\2.git),g' $<.tmp
+ @sed -i -r -e 's|`\[pkg:(.*)\]|`\[escapedpkg:\1\]|g' $<.tmp
+ @sed -i -r -e 's|`\[::(.*)\]|`\[:repo:\1\]|g' $<.tmp
+ @sed -i -r -e 's|\[pkg:repository/(.+)\]|\[`repository/\1`\](//git.exherbo.org/summer/repositories/\1/index.html)|g' $<.tmp
+ @sed -i -r -e 's|\[pkg:(.+/.+)\]|\[`\1`\](//git.exherbo.org/summer/packages/\1/index.html)|g' $<.tmp
+ @sed -i -r -e 's,\[::(\w+)\],\[`::\1`\](//git.exherbo.org/\1.git),g' $<.tmp
+ @sed -i -r -e 's|`\[:repo:(.+)\]|`\[::\1\]|g' $<.tmp
+ @sed -i -r -e 's|`\[escapedpkg:(.+)\]|`\[pkg:\1\]|g' $<.tmp
@maruku --html --output $@ $<.tmp
@sed -i -e 's,<head>,&<link rel="shortcut icon" href="/favicon.png" />,' $@
@sed -i -e 's,<td />,<td></td>,g' $@