diff options
author | Jefferson Julio <[email protected]> | 2021-05-31 19:16:12 -0300 |
---|---|---|
committer | Jefferson Julio <[email protected]> | 2021-05-31 19:16:12 -0300 |
commit | 9f5162371323562623bae42b0476bd8b9a4a5e92 (patch) | |
tree | 9375011fbff065938b1878cbf5198247a8a0dbbf /index.sh | |
parent | 381bff129b70471e86e99a2d6b6a7e090f13287e (diff) | |
download | blog.sh-9f5162371323562623bae42b0476bd8b9a4a5e92.tar.bz2 blog.sh-9f5162371323562623bae42b0476bd8b9a4a5e92.zip |
Add more HTML metadata, re-format some text
Diffstat (limited to 'index.sh')
-rwxr-xr-x | index.sh | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -27,15 +27,24 @@ sanitize-filename () { echo "${1// /\\ }" } +scape-regex () { + echo "$1" | + sed 's/(/\\(/g' | + sed 's/)/\\)/g' | + sed 's/|/\\|/g' +} + html () { cat <<HTML +<!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="utf-8" /> <title>jefferson.sh</title> <meta name="viewport" content="width=device-width,initial-scale=1" /> + <link rel="icon" type="image/png" href="/static/favicon.png" /> <link rel="stylesheet" href="/static/styles.css" /> - <link rel="manifest" href="/static/manifest.json"> + <link rel="manifest" href="/static/manifest.json" /> </head> <body> @@ -58,28 +67,18 @@ router () { case "$REQUEST_URI" in /) BODY=$(source ./pages/home.sh) - ;; + ;; /contato) HEADER_TITLE="source pages/contato.sh" HEADER_TITLE_MOBILE="$HEADER_TITLE" BODY=$(source ./pages/contato.sh) ;; - /$ARTICLES_PATH*.txt) + /$ARTICLES_PATH*) ARTICLE_FILE=.$REQUEST_URI HEADER_TITLE="ARTICLE_FILE=$(sanitize-filename "$ARTICLE_FILE");source pages/article.sh" HEADER_TITLE_MOBILE="ARTICLE_FILE=$(sanitize-filename "$ARTICLE_FILE");source pages/article.sh" BODY=$(source ./pages/article.sh) ;; - /json) - RESPONSE_CONTENT_TYPE="application/json" - STATUS=200 - BODY=$(cat <<JSON -{ - "teste": "JSON" -} -JSON -) - ;; *) STATUS=404 HEADER_TITLE="REQUEST_FILE=.$(sanitize-filename "$REQUEST_URI");source page.sh" |