diff options
author | Akshay <[email protected]> | 2020-02-01 13:56:34 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2020-02-01 13:56:34 +0000 |
commit | bca8c0e47e9d7bc0ad176b40cd3f2af8dda0dc67 (patch) | |
tree | d1825439fa18d595a355d16e66db3d0d97748131 /generate.sh | |
parent | b8a4ba7d790faeec252ff6b8c144effee094f63d (diff) |
use heredocs instead of echo
Diffstat (limited to 'generate.sh')
-rwxr-xr-x | generate.sh | 77 |
1 files changed, 34 insertions, 43 deletions
diff --git a/generate.sh b/generate.sh index 2ba3fc9..3d55941 100755 --- a/generate.sh +++ b/generate.sh | |||
@@ -42,41 +42,32 @@ link_wrapper() { | |||
42 | " | 42 | " |
43 | } | 43 | } |
44 | 44 | ||
45 | # meta | 45 | cat > ./docs/index.html << EOF |
46 | echo " | ||
47 | <!DOCTYPE html> | 46 | <!DOCTYPE html> |
48 | <html lang=\"en\"> | 47 | <html lang="en"> |
49 | <head> | 48 | <head> |
50 | <link rel=\"stylesheet\" href=\"./style.css\"> | 49 | <link rel="stylesheet" href="./style.css"> |
51 | <meta charset=\"UTF-8\"> | 50 | <meta charset="UTF-8"> |
52 | <meta name=\"viewport\" content=\"initial-scale=1\"> | 51 | <meta name="viewport" content="initial-scale=1"> |
53 | <meta content=\"#ffffff\" name=\"theme-color\"> | 52 | <meta content="#ffffff" name="theme-color"> |
54 | <meta name=\"HandheldFriendly\" content=\"true\"> | 53 | <meta name="HandheldFriendly" content="true"> |
55 | <meta property=\"og:title\" content=\"nerdypepper\"> | 54 | <meta property="og:title" content="nerdypepper"> |
56 | <meta property=\"og:type\" content=\"website\"> | 55 | <meta property="og:type" content="website"> |
57 | <meta property=\"og:description\" content=\"a static site {for, by, about} me \"> | 56 | <meta property="og:description" content="a static site {for, by, about} me "> |
58 | <meta property=\"og:url\" content=\"https://nerdypepper.tech\"> | 57 | <meta property="og:url" content="https://nerdypepper.tech"> |
59 | <title>n</title> | 58 | <title>n</title> |
60 | " > ./docs/index.html | ||
61 | |||
62 | # body | ||
63 | echo " | ||
64 | <body> | 59 | <body> |
65 | <h1 class=\"heading\">n</h1> | 60 | <h1 class="heading">n</h1> |
66 | <h4 class=\"date\">nerdypepper's μblog</h4> | 61 | <h4 class="date">nerdypepper's μblog</h4> |
67 | " >> docs/index.html | 62 | <div class="posts"> |
68 | 63 | <div class="post"> | |
64 | <div class="separator"></div> | ||
65 | <table> | ||
66 | EOF | ||
69 | 67 | ||
70 | # begin posts | ||
71 | echo " | ||
72 | <div class=\"posts\"> | ||
73 | <div class=\"post\"> | ||
74 | <div class="separator"></div> | ||
75 | <table> | ||
76 | " >> docs/index.html | ||
77 | 68 | ||
78 | # posts | 69 | # posts |
79 | posts=$(ls -t ./posts); | 70 | posts=$(ls -t ./posts) |
80 | mkdir -p docs/posts | 71 | mkdir -p docs/posts |
81 | 72 | ||
82 | for f in $posts; do | 73 | for f in $posts; do |
@@ -111,20 +102,20 @@ for f in $posts; do | |||
111 | 102 | ||
112 | done | 103 | done |
113 | 104 | ||
114 | echo " | 105 | cat >> ./docs/index.html << EOF |
115 | </table> | 106 | </table> |
116 | <div class="separator"></div> | 107 | <div class="separator"></div> |
117 | <div class="footer"> | 108 | <div class="footer"> |
118 | <a href="https://github.com/nerdypepper">Github</a> · | 109 | <a href="https://github.com/nerdypepper">Github</a> · |
119 | <a href="https://twitter.com/N3rdyP3pp3r">Twitter</a> · | 110 | <a href="https://twitter.com/N3rdyP3pp3r">Twitter</a> · |
120 | <a href="mailto:[email protected]">Mail</a> · | 111 | <a href="mailto:[email protected]">Mail</a> · |
121 | <a href="https://linkedin.com/in/nerdypepper">LinkedIn</a> · | 112 | <a href="https://linkedin.com/in/nerdypepper">LinkedIn</a> · |
122 | <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"> | 113 | <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"> |
123 | <img class="footimgs" src="https://d33wubrfki0l68.cloudfront.net/94387e9d77fbc8b4360db81e72603ecba3df94a7/632bc/static/cc.svg"> | 114 | <img class="footimgs" src="https://d33wubrfki0l68.cloudfront.net/94387e9d77fbc8b4360db81e72603ecba3df94a7/632bc/static/cc.svg"> |
124 | </a> | 115 | </a> |
125 | </div> | 116 | </div> |
126 | </div> | 117 | </div> |
127 | </div> | 118 | </div> |
128 | </body> | 119 | </body> |
129 | </html> | 120 | </html> |
130 | " >> docs/index.html | 121 | EOF |