Skip to content

Commit

Permalink
Add the ability to use headings (bderenzo#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregdotca authored Jun 12, 2021
1 parent 2afe955 commit 40f9ae7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Element, Name, Icon, Url

For instance:
```
heading, Heading, -, -
section, Tools, wrench, -
item, Status Page, heart, https://github.com/bderenzo/tinystatus
item, Dashboard, bookmark, https://github.com/bderenzo/tinyhome
Expand Down
1 change: 1 addition & 0 deletions config.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Element, Name, Icon, Url
heading, My Dashboard, -, -
section, Multimedia, photo-video, -
item, Music, compact-disc, https://github.com/navidrome/navidrome
item, Portfolio, camera, https://github.com/saimn/sigal
Expand Down
5 changes: 4 additions & 1 deletion tinyhome
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ itemize(){
name="$(get_element '2' "${line}")"
icon="$(get_element '3' "${line}")"

if [ "${category}" = 'section' ]; then
if [ "${category}" = 'heading' ]; then
echo "<h1>${name}</h1>"
elif [ "${category}" = 'section' ]; then
echo "<h2><i class='fas fa-${icon}'></i>${name}</h2>"
elif [ "${category}" = 'item' ]; then
url="$(get_element '4-' "${line}")"
Expand All @@ -25,6 +27,7 @@ cat << EOF
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>${title}</title><style>
body { font-family: segoe ui,Roboto,Oxygen-Sans,Ubuntu,Cantarell,helvetica neue,Verdana,sans-serif; }
i { margin-right: 7px; }
h1 { padding: 15px 0 0 0; color: #444444; text-align: center; }
h2 { padding: 10px 0 0 0; color: #444444; }
a { text-decoration: none; color: #444444; }
a:hover { opacity: 0.5; }
Expand Down

0 comments on commit 40f9ae7

Please sign in to comment.