doc: Add canonical url

This commit is contained in:
isaacs
2014-04-12 22:19:36 -07:00
parent fa0fa8cc9a
commit 6be6b4b74e
2 changed files with 3 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
<title>@NAME@</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
<link rel="canonical" href="https://www.npmjs.org/@URL@">
<script async=true src="../../static/toc.js"></script>
<body>

View File

@@ -53,11 +53,13 @@ case $dest in
exit $?
;;
*.html)
url=${dest/html\//}
(cat html/dochead.html && \
./node_modules/.bin/ronn -f $src &&
cat html/docfoot.html)\
| sed "s|@NAME@|$name|g" \
| sed "s|@DATE@|$date|g" \
| sed "s|@URL@|$url|g" \
| sed "s|@VERSION@|$version|g" \
| perl -pi -e 's/<h1>([^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>\1<\/h1> <p>\2<\/p>/g' \
| perl -pi -e 's/npm-npm/npm/g' \