do not prepend full url to linklist

that breaks links when browsing locally and when https is not availeble or
vice-versa
pull/1/head
Alessandro Mauri 3 years ago
parent a5e0be8a3f
commit c49758a5c5
  1. 10
      rivet.sh

@ -1,17 +1,17 @@
#!/bin/sh -e
# Copyright (c) 2021 Alessandro Mauri
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -183,7 +183,7 @@ sed -i -e 's/\.md$/\.html/' "$objlist"
# Create a list that contains the links to all html files
linklist="$(mktemp)"
cp -f "$objlist" "$linklist"
sed -i -e "s/^$destdir//" -e "s/^/$prefix:\/\/$domain/" "$linklist"
sed -i -e "s/^$destdir//" "$linklist"
# Insert metadata into <head>
if ! [ "$SKIP_META" ]; then
@ -261,7 +261,7 @@ if ! [ "$SKIP_SITEMAP" ]; then
cat << EOF >> "$destdir"/sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</urlset>
</urlset>
EOF
while IFS="" read -r line; do
sed -i "/<\/urlset>/i \

Loading…
Cancel
Save