styles and templates
authorDaniel Liu <mr.picklepinosaur@gmail.com>
Sat, 31 Jul 2021 03:37:15 +0000 (23:37 -0400)
committerDaniel Liu <mr.picklepinosaur@gmail.com>
Sat, 31 Jul 2021 03:37:15 +0000 (23:37 -0400)
build/stylesheets/root.css [new file with mode: 0644]
modules/md-header
modules/readingtime
pinopress
templates/archiveitem.template.html
templates/head.template.html
templates/rollingitem.template.html

diff --git a/build/stylesheets/root.css b/build/stylesheets/root.css
new file mode 100644 (file)
index 0000000..67f9a26
--- /dev/null
@@ -0,0 +1,71 @@
+
+:root {
+
+    /* color scheme - one dark */
+    /* --black-normal:   #282C34; */
+    /* --black-bright:   #454C59; */
+    /* --red-normal:     #E06C75; */
+    /* --red-bright:     #FF7A85; */
+    /* --green-normal:   #98C379; */
+    /* --green-bright:   #B5E890; */
+    /* --yellow-normal:  #E5C07B; */
+    /* --yellow-bright:  #FFD68A; */
+    /* --blue-normal:    #61AFEF; */
+    /* --blue-bright:    #69BBFF; */
+    /* --magenta-normal: #C678DD; */
+    /* --magenta-bright: #E48AFF; */
+    /* --cyan-normal:    #56B6C2; */
+    /* --cyan-bright:    #66D9E8; */
+    /* --white-normal:   #ABB2BF; */
+    /* --white-bright:   #CFD7E6; */
+
+    /* color scheme - gruvbox */
+    --black-normal:   #282828;
+    --black-bright:   #3c3836;
+    --red-normal:     #cc241d;
+    --red-bright:     #fb4934;
+    --green-normal:   #98971a;
+    --green-bright:   #b8bb26;
+    --yellow-normal:  #d79921;
+    --yellow-bright:  #fabd2f;
+    --blue-normal:    #458588;
+    --blue-bright:    #83a598;
+    --magenta-normal: #b16286;
+    --magenta-bright: #d3869b;
+    --cyan-normal:    #689d6a;
+    --cyan-bright:    #8ec07c;
+    --white-normal:   #a89984;
+    --white-bright:   #ebdbb2;
+
+    --bg-dark:  var(--black-normal);
+    --bg-light: var(--black-bright);
+    --text-dark: var(--white-normal);
+    --text-light: var(--white-bright);
+    
+    color: var(--text-dark);
+    background-color: var(--bg-dark);
+    font-family: 'Courier New', monospace;
+
+}
+
+body {
+    height: 100%;
+    margin: 0;
+    padding: 2rem;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    color: var(--text-light);
+}
+
+a {
+    color: var(--text-light);
+    transition: color 0.2s;
+}
+a:hover {
+    color: var(--text-dark);
+}
+
+strong {
+    color: var(--text-light);
+}
index e671ea8..3e1b3e4 100755 (executable)
@@ -17,4 +17,4 @@ export DESCRIPTION=`getprop "$1" description`
 export USERLOCAL1=`getprop "$1" userlocal1`
 export USERLOCAL2=`getprop "$1" userlocal2`
 # this only works when this script is called from pinopress script, as it inherits the required env variables. careful with this one, it's a bit hacky
-export ARTICLE_URL="$SITEURL/$ARTICLE_PATH/$(echo $(basename "$1") | sed -e 's/\(.*\)\.html/\1\.md/')"
+export ARTICLE_URL="$SITEURL/$ARTICLE_PATH/$(echo $(basename "$1") | sed -e 's/\(.*\)\.md/\1\.html/')"
index 7983314..b3ef98f 100755 (executable)
@@ -7,8 +7,8 @@
 ##    READING_TIME in minutes
 
 ## config vars
-wordsPerMinute=250
+wordsPerMinute=200
 
 # first clean special symbols and lines with whitespace
 wordcount=`sed -e 's/[^A-Za-z0-9 ]//g' -e '/^\s*$/d' "$1" | wc -w`
-export READING_TIME=$(expr $(expr $wordcount + $wordsPerMinute) / $wordsPerMinute)
+export READING_TIME=$(expr $(expr $wordcount / $wordsPerMinute) + 1)
index c12c485..b47d785 100755 (executable)
--- a/pinopress
+++ b/pinopress
@@ -8,6 +8,8 @@ SITEURL := https://blog.danieliu.xyz
 USERGLOBAL1 :=
 USERGLOBAL2 :=
 
+include config.mk
+
 .PHONY: help build clean
 
 # internal variables
@@ -69,11 +71,11 @@ $(BUILD_DIR)/$(ARTICLE_PATH)/%.html: $(SRC_DIR)/%.md
        echo "parsing $<"
        $(export_common)
        $(call export_article,"$<")
-       . ./$(MODULE_DIR)/md-header "$<"
        cat $(TEMPLATE_DIR)/head.template.html > "$@"
        # module pipeline starts here
-       ./$(MODULE_DIR)/md "$^" >> "$@"
-       . ./$(MODULE_DIR)/readingtime "$^"
+       ./$(MODULE_DIR)/md "$<" >> "$@"
+       . ./$(MODULE_DIR)/md-header "$<"
+       . ./$(MODULE_DIR)/readingtime "$<"
        # module pipeline ends here
        cat $(TEMPLATE_DIR)/foot.template.html >> "$@"
        envsubst < "$@" | sponge "$@"
index 867a94d..fe695ab 100644 (file)
@@ -1 +1 @@
-<li>$ARTICLE_TITLE</li>
+<li><a href="$ARTICLE_URL">$ARTICLE_TITLE</a></li>
index a4fc487..ee53597 100644 (file)
@@ -5,5 +5,7 @@
     <link rel="stylesheet" href="#"> 
     <link rel="shortcut icon" href="#">
     <title></title>
+
+    <link rel="stylesheet" href="$SITEURL/stylesheets/root.css">
 </head>
 <body>
index 52803ec..589db20 100644 (file)
@@ -1,3 +1,5 @@
 <div>
     <h3><a href="$ARTICLE_URL">$ARTICLE_TITLE</a></h3>
+    <p>Published $PUBLISHED_DATE</p>
+    <p>$DESCRIPTION</p>
 </div>