diff options
author | Carlos Fenollosa <cfenollosa@mba.local> | 2019-09-01 14:19:21 +0200 |
---|---|---|
committer | Carlos Fenollosa <cfenollosa@mba.local> | 2019-09-01 14:19:21 +0200 |
commit | bf676017c4febd546134a0636909599fba21e6f2 (patch) | |
tree | 1444d33cc13a004719504b4e773433627a1758ca /bb.sh | |
parent | 89780c3108bddac6582498ce86e4d344465a4e3a (diff) |
fixed head before sed
Diffstat (limited to 'bb.sh')
-rwxr-xr-x | bb.sh | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -341,9 +341,9 @@ twitter_card() { echo "<meta name='twitter:card' content='summary' />" echo "<meta name='twitter:site' content='@$global_twitter_username' />" echo "<meta name='twitter:title' content='$2' />" # Twitter truncates at 70 char - description=$(grep -v "^<p>$template_tags_line_header" "$1" | sed -e 's/<[^>]*>//g' | head -c 250 | tr '\n' ' ' | sed "s/\"/'/g") + description=$(grep -v "^<p>$template_tags_line_header" "$1" | sed -e 's/<[^>]*>//g' | tr '\n' ' ' | sed "s/\"/'/g" | head -c 250) echo "<meta name='twitter:description' content=\"$description\" />" - image=$(sed -n 's/.*<img.*src="\([^"]*\)".*/\1/p' "$1" | head -n 1) # First image is fine + image=$(sed -n '2,$ d; s/.*<img.*src="\([^"]*\)".*/\1/p' "$1") # First image is fine [[ -z $image ]] && return [[ $image =~ ^https?:// ]] || image=$global_url/$image # Check that URL is absolute echo "<meta name='twitter:image' content='$image' />" |