commit aff6c614205bf8dc8227a82112ef0df55b003cc7
parent f46e3f1768c7b595033ebfacc6e3ead726ee063d
Author: mjkloeckner <martin.cachari@gmail.com>
Date: Thu, 20 Oct 2022 00:29:30 -0300
Added temporary syntax highlight to code blocks
Added temporary syntax highlight to code blocks via
scripts/syntax-highlight which is a script written and compiled in go
scripts/deploy_local.sh now prints an error and exits if not ran with
root privileges
Added ` ||:` at the end of rm in scripts/sync.sh, functions
generate_blog_index and generate_latest_uploads to avoid script printing
not found error
Diffstat:
11 files changed, 165 insertions(+), 98 deletions(-)
diff --git a/blog/dwm-config/dwm-config.html b/blog/dwm-config/dwm-config.html
@@ -1,6 +1,4 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
+<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8"/>
<meta name="generator" content="Shell script"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
@@ -20,7 +18,7 @@
<article>
<link rel="stylesheet" type="text/css" href="/css/article_style.css"/>
-<h1 id="article-title">dwm - A tiling window manager configuration</h1><p class="article-date">23-Oct-2021</p>
+<h1 id="article-title">dwm - A tiling window manager configuration</h1><p class="article-date">23-Oct-2021 (last update 15-Oct-2022)</p>
<p>A window manager is a software that can manage the layout and appearance
of every window spawned in your desktop, most people confuse them with
@@ -181,10 +179,10 @@ clear you should google how to use diff and patch to modify a file.</p>
<li><a href="https://man7.org/linux/man-pages/man1/patch.1.html">patch man page</a></li>
</ul>
- <script type="text/javascript" src="/scripts/article-date.js"></script>
<!--#include virtual="/common/end_of_article.shtml" -->
</article>
<!--#include virtual="/common/footer.shtml" -->
- </body>
-</html>
+
+
+</body></html>
diff --git a/blog/nerdearla-2022/nerdearla-2022.html b/blog/nerdearla-2022/nerdearla-2022.html
@@ -1,56 +1,89 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="generator" content="Shell script">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <meta name="article-author" content="$article-author$">
- <meta name="article-date" content="23-Sep-2022">
- <meta name="article-title" content="I'm going to Nerdearla 2022">
-
- <title>I'm going to Nerdearla 2022 | Martin Klöckner's Webpage</title>
- <link rel='stylesheet' type='text/css' href="/css/style.css">
- <link rel="icon" href="/favicon.png">
+<!DOCTYPE html><html lang="en"><head>
+ <meta charset="utf-8"/>
+ <meta name="generator" content="Shell script"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+
+ <meta name="article-author" content="$article-author$"/>
+ <meta name="article-date" content="23-Sep-2022"/>
+ <meta name="article-title" content="I'm going to Nerdearla 2022"/>
+
+ <title>I'm going to Nerdearla 2022 | Martin Klöckner's Webpage</title>
+ <link rel="stylesheet" type="text/css" href="/css/style.css"/>
+ <link rel="icon" href="/favicon.png"/>
</head>
<body>
<!--#include virtual="/common/header.shtml" -->
<article>
- <link rel='stylesheet' type='text/css' href="/css/article_style.css">
+ <link rel="stylesheet" type="text/css" href="/css/article_style.css"/>
-<h1 id=article-title>I’m going to Nerdearla 2022</h1><p class="article-date">23-Sep-2022</p>
+<h1 id="article-title">I’m going to Nerdearla 2022</h1><p class="article-date">23-Sep-2022 (last update 17-Oct-2022)</p>
-<p>As the title says I’m going to be present at <a href="https://nerdear.la/">Nerdearla</a>.</p>
+<p>As the title says I’m going to be present at <a href="https://nerdear.la/">Nerdearla</a>.</p>
-<p>This will be my second time that I attend to this event since I’ve been there for the first time in 2019. I remember that <a href="https://en.wikipedia.org/wiki/Jon_Hall_(programmer)">John ‘Maddog’ Hall</a> was making a presentation called “50 years of UNIX and the landing on the Moon”, you can find a record of the presentation <a href="https://www.youtube.com/watch?v=9O_FnKZI6_M">here</a>.</p>
+<p>This will be my second time that I attend to this event since I’ve been there for the first time in 2019. I remember that <a href="https://en.wikipedia.org/wiki/Jon_Hall_(programmer)">John ‘Maddog’ Hall</a> was making a presentation called “50 years of UNIX and the landing on the Moon”, you can find a record of the presentation <a href="https://www.youtube.com/watch?v=9O_FnKZI6_M">here</a>.</p>
-<p><a href="nerdearla-2019.png" title="Nerdearla 2019"><img src="nerdearla-2019.jpeg" alt="Nerdearla 2019" /></a></p>
+<p><a href="nerdearla-2019.png" title="Nerdearla 2019"><img src="nerdearla-2019.jpeg" alt="Nerdearla 2019"/></a></p>
-<p>It was my first talk ever and I loved it, sadly becouse of the pandemic I couldn’t go in the past two years.</p>
+<p>It was my first talk ever and I loved it, sadly becouse of the pandemic I couldn’t go in the past two years.</p>
<p>The event is half remote half presential and the entrance is free. It takes place at Centro cultural Konex on Once, Buenos Aires on Oct 19 to Oct 22, last three days.</p>
-<pre><code class="language-console">$ sudo make clean install
+<pre><code class="language-console"><span class="pun">$</span> <span class="pln">sudo</span> <span class="kwd">make</span> <span class="pln">clean</span> <span class="pln">install</span>
</code></pre>
<p>This is how I replace the variables in the template with the data aquired from the metadata contained in the files written in markdown</p>
-<pre><code class="language-console">$ sed -e "s/\$article-title\\$/$title/" -e "s/\$article-date\\$/$date/" \
- -e "s/\$pagetitle\\$/$pagetitle/" -e '/\$body\$/r./body.html' \
- -e '/\$body\$/d' $template > $filename.html
+<pre><code class="language-console"><span class="pun">$</span> <span class="pln">sed</span> <span class="pun">-</span><span class="pln">e</span> <span class="str">"s/\$article-title\\$/$title/"</span> <span class="pun">-</span><span class="pln">e</span> <span class="str">"s/\$article-date\\$/$date/"</span> <span class="pun">\</span>
+ <span class="pun">-</span><span class="pln">e</span> <span class="str">"s/\$pagetitle\\$/$pagetitle/"</span> <span class="pun">-</span><span class="pln">e</span> <span class="str">'/\$body\$/r./body.html'</span> <span class="pun">\</span>
+ <span class="pun">-</span><span class="pln">e</span> <span class="str">'/\$body\$/d'</span> <span class="pun">$</span><span class="typ">TEMPLATE</span> <span class="pun">></span> <span class="pun">$</span><span class="pln">filename</span><span class="pun">.</span><span class="pln">html</span>
</code></pre>
<p>This is how I generate this webpage, converting it from its markdown file into html, this is a custom scripts that I made that only depends on lowdown, grep, and sed. Previously I had another script similar, which depended on pandoc, which is an alternative of lowdown but much more bloated, it depends on a ton of libraries wirtten in haskell</p>
-<pre><code class="language-console">$ ./build.sh nerdearla-2022.md
+<pre><code>$ ./build.sh nerdearla-2022.md
+</code></pre>
+
+<p>this is an nginx config file snippet taken from <a href="https://landchad.net">LandChad.net</a></p>
+
+<pre><code class="language-nginx"><span class="pln">server</span> <span class="pun">{</span>
+ <span class="pun">#</span><span class="pun">.</span><span class="pun">.</span><span class="pun">.</span>
+ <span class="pln">auth_basic</span> <span class="str">"What's the Password?"</span> <span class="pun">;</span>
+ <span class="pln">auth_basic_user_file</span> <span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">nginx</span><span class="pun">/</span><span class="pln">myusers</span> <span class="pun">;</span>
+ <span class="pln">location</span> <span class="pun">/</span><span class="kwd">public</span><span class="pun">/</span> <span class="pun">{</span>
+ <span class="pun">#</span><span class="pun">.</span><span class="pun">.</span><span class="pun">.</span>
+ <span class="pln">auth_basic</span> <span class="pln">off</span> <span class="pun">;</span>
+ <span class="pun">}</span>
+ <span class="pun">#</span><span class="pun">.</span><span class="pun">.</span><span class="pun">.</span>
+<span class="pun">}</span>
+</code></pre>
+
+<pre><code class="language-c"><span class="kwd">int</span> <span class="pln">main</span> <span class="pun">(</span><span class="kwd">void</span><span class="pun">)</span>
+<span class="pun">{</span>
+ <span class="typ">SAV</span> <span class="pun">*</span><span class="pln">sav</span> <span class="pun">=</span> <span class="typ">NULL</span><span class="pun">;</span>
+ <span class="typ">Drw</span> <span class="pun">*</span><span class="pln">drw</span> <span class="pun">=</span> <span class="typ">NULL</span><span class="pun">;</span>
+ <span class="pln">time_t</span> <span class="pln">tic</span><span class="pun">,</span> <span class="pln">toc</span><span class="pun">;</span>
+ <span class="kwd">unsigned</span> <span class="kwd">int</span> <span class="pln">ti</span><span class="pun">,</span> <span class="pln">tf</span><span class="pun">,</span> <span class="pln">dt</span><span class="pun">,</span> <span class="pln">time_per_frame</span><span class="pun">;</span>
+ <span class="pln">pthread_t</span> <span class="pln">p1</span> <span class="pun">=</span> <span class="dec">0</span><span class="pun">;</span>
+ <span class="pln">status_t</span> <span class="pln">st</span><span class="pun">;</span>
+
+ <span class="kwd">if</span><span class="pun">(</span><span class="pun">(</span><span class="pln">st</span> <span class="pun">=</span> <span class="typ">SAV_create</span><span class="pun">(</span><span class="pun">&</span><span class="pln">sav</span><span class="pun">)</span><span class="pun">)</span> <span class="pun">!</span><span class="pun">=</span> <span class="typ">OK</span><span class="pun">)</span> <span class="kwd">goto</span> <span class="kwd">end</span><span class="pun">;</span>
+ <span class="kwd">if</span><span class="pun">(</span><span class="pun">(</span><span class="pln">st</span> <span class="pun">=</span> <span class="pln">drw_create</span><span class="pun">(</span><span class="pun">&</span><span class="pln">drw</span><span class="pun">)</span><span class="pun">)</span> <span class="pun">!</span><span class="pun">=</span> <span class="typ">OK</span><span class="pun">)</span> <span class="kwd">goto</span> <span class="kwd">end</span><span class="pun">;</span>
+
+ <span class="pln">tic</span> <span class="pun">=</span> <span class="pln">time</span><span class="pun">(</span><span class="typ">NULL</span><span class="pun">)</span><span class="pun">;</span>
+ <span class="pln">time_per_frame</span> <span class="pun">=</span> <span class="dec">16</span><span class="pun">;</span> <span class="com">/* miliseconds */</span>
+ <span class="pln">sav</span><span class="pun">-</span><span class="pun">></span><span class="pln">arr</span><span class="pun">-</span><span class="pun">></span><span class="pln">shuffle</span><span class="pun">(</span><span class="pln">sav</span><span class="pun">-</span><span class="pun">></span><span class="pln">arr</span><span class="pun">)</span><span class="pun">;</span>
+
+ <span class="kwd">char</span> <span class="pun">*</span><span class="pln">hw</span> <span class="pun">=</span> <span class="str">"Hello, world!\n"</span>
+ <span class="kwd">return</span> <span class="dec">0</span><span class="pun">;</span>
+<span class="pun">}</span>
</code></pre>
- <script type="text/javascript" src="/scripts/article-date.js"></script>
<!--#include virtual="/common/end_of_article.shtml" -->
</article>
<!--#include virtual="/common/footer.shtml" -->
- </body>
-</html>
+
+
+</body></html>
diff --git a/blog/sav/sav.html b/blog/sav/sav.html
@@ -1,34 +1,32 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="generator" content="Shell script">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <meta name="article-author" content="$article-author$">
- <meta name="article-date" content="18-Sep-2022">
- <meta name="article-title" content="SAV - Sorting Algorithms Visualized">
-
- <title>SAV - Sorting Algorithms Visualized | Martin Klöckner's Webpage</title>
- <link rel='stylesheet' type='text/css' href="/css/style.css">
- <link rel="icon" href="/favicon.png">
+<!DOCTYPE html><html lang="en"><head>
+ <meta charset="utf-8"/>
+ <meta name="generator" content="Shell script"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+
+ <meta name="article-author" content="$article-author$"/>
+ <meta name="article-date" content="18-Sep-2022"/>
+ <meta name="article-title" content="SAV - Sorting Algorithms Visualized"/>
+
+ <title>SAV - Sorting Algorithms Visualized | Martin Klöckner's Webpage</title>
+ <link rel="stylesheet" type="text/css" href="/css/style.css"/>
+ <link rel="icon" href="/favicon.png"/>
</head>
<body>
<!--#include virtual="/common/header.shtml" -->
<article>
- <link rel='stylesheet' type='text/css' href="/css/article_style.css">
+ <link rel="stylesheet" type="text/css" href="/css/article_style.css"/>
-<h1 id=article-title>SAV - Sorting Algorithms Visualized</h1><p class="article-date">18-Sep-2022</p>
+<h1 id="article-title">SAV - Sorting Algorithms Visualized</h1><p class="article-date">18-Sep-2022 (last update 15-Oct-2022)</p>
<p>This is a desktop app that shows how an array is being sorted using different algorithms.</p>
-<p><img src="sav.gif" alt="" title="Gif showing SAV working" /></p>
+<p><img src="sav.gif" alt="" title="Gif showing SAV working"/></p>
-<p>I made it using pure C and SDL2 for graphics, you can take a look at it’s source code on <a href="https://github.com/mjkloeckner/sav">Github</a>.</p>
+<p>I made it using pure C and SDL2 for graphics, you can take a look at it’s source code on <a href="https://github.com/mjkloeckner/sav">Github</a>.</p>
-<p>The main purpose of this app was to put in practice the knowledge I gained in C as well with algorithms, and it was like a challenge since I’d never used SDL2 graphics before. In the end was a very enjoyable project since SDL2 per se is a very simple and easy to use library.</p>
+<p>The main purpose of this app was to put in practice the knowledge I gained in C as well with algorithms, and it was like a challenge since I’d never used SDL2 graphics before. In the end was a very enjoyable project since SDL2 per se is a very simple and easy to use library.</p>
<p>Currently it supports the following algorithms:</p>
@@ -42,10 +40,10 @@
<li>heap sort</li>
</ul>
- <script type="text/javascript" src="/scripts/article-date.js"></script>
<!--#include virtual="/common/end_of_article.shtml" -->
</article>
<!--#include virtual="/common/footer.shtml" -->
- </body>
-</html>
+
+
+</body></html>
diff --git a/blog/vim-config/vim-config.html b/blog/vim-config/vim-config.html
@@ -1,40 +1,38 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="generator" content="Shell script">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <meta name="article-author" content="$article-author$">
- <meta name="article-date" content="04-Mar-2021">
- <meta name="article-title" content="vim - The keyboard driven text editor">
-
- <title>vim - The keyboard driven text editor | Martin Klöckner's Webpage</title>
- <link rel='stylesheet' type='text/css' href="/css/style.css">
- <link rel="icon" href="/favicon.png">
+<!DOCTYPE html><html lang="en"><head>
+ <meta charset="utf-8"/>
+ <meta name="generator" content="Shell script"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+
+ <meta name="article-author" content="$article-author$"/>
+ <meta name="article-date" content="04-Mar-2021"/>
+ <meta name="article-title" content="vim - The keyboard driven text editor"/>
+
+ <title>vim - The keyboard driven text editor | Martin Klöckner's Webpage</title>
+ <link rel="stylesheet" type="text/css" href="/css/style.css"/>
+ <link rel="icon" href="/favicon.png"/>
</head>
<body>
<!--#include virtual="/common/header.shtml" -->
<article>
- <link rel='stylesheet' type='text/css' href="/css/article_style.css">
+ <link rel="stylesheet" type="text/css" href="/css/article_style.css"/>
-<div id="article-title-with-icon"> <div id="article-icon"> <img src="vim_logo.png" title="Vim logo" alt="Vim logo"> </div> <h1 id="article-title">The keyboard driven text editor</h1></div><p class="article-date">04-Mar-2021</p>
+<div id="article-title-with-icon"> <div id="article-icon"> <img src="vim_logo.png" title="Vim logo" alt="Vim logo"/> </div> <h1 id="article-title">The keyboard driven text editor</h1></div><p class="article-date">04-Mar-2021 (last update 15-Oct-2022)</p>
<p>If we think for a moment about software we are going to realize that the
core of every program is just plain text, literally, just words in a
-file that someone wrote, this webpage it’s just text interpreted by
+file that someone wrote, this webpage it’s just text interpreted by
your web-browser, whose also just plain text implemented by another
program, some software has more complexity than others, for example the
-linux kernel it’s estimated that has around 27.8 million lines of code,
+linux kernel it’s estimated that has around 27.8 million lines of code,
which is also just plain text</p>
-<p>The way we tell computers what to do it’s with text, so in order to
-write that text we just need a text editor and this is were Vim it’s
-known for. Vim it’s just a text editor. The term Vim stands for Vi
-IMproved, Vim it’s a rewrite and improved version of Vi, a text editor
+<p>The way we tell computers what to do it’s with text, so in order to
+write that text we just need a text editor and this is were Vim it’s
+known for. Vim it’s just a text editor. The term Vim stands for Vi
+IMproved, Vim it’s a rewrite and improved version of Vi, a text editor
that dates from 1978.</p>
<p>In this article I want to show how this text editor became my best
@@ -42,24 +40,24 @@ frient (?), I learned to love about Vim keybindings and now I even have
and extension on my browser to use vim like keybindings.</p>
<p>Vim is a console text editor (altough you can find distributions like
-gvim, which comes with a gui), a benefit of this its that It’s very
-lightweign in terms of system resources. Vim it’s also highly
+gvim, which comes with a gui), a benefit of this its that It’s very
+lightweign in terms of system resources. Vim it’s also highly
configurable, you can do this by editing the <em>.vimrc</em> text
file, which should be in you home directory in Linux or BSD bases OSs,
if not you can <em>create</em> a new blank one and start from zero</p>
-<p>If you installed Vim and you don’t know how to move around or insert
-text, first you need to understand the basics, Vim has 3 main “modes”</p>
+<p>If you installed Vim and you don’t know how to move around or insert
+text, first you need to understand the basics, Vim has 3 main “modes”</p>
<p>By default Vim comes with a lot of features disabled, for example a key
binding to comment a line or auto close brackets, parenthesis, etc, this
features you can enable them by installing <em>plugins</em> which I
will cover leter.</p>
- <script type="text/javascript" src="/scripts/article-date.js"></script>
<!--#include virtual="/common/end_of_article.shtml" -->
</article>
<!--#include virtual="/common/footer.shtml" -->
- </body>
-</html>
+
+
+</body></html>
diff --git a/common/blog_index.shtml b/common/blog_index.shtml
@@ -1,4 +1,4 @@
-<li><time>23-Sep-2022</time> <a href="/blog/nerdearla-2022/nerdearla-2022">I'm going to Nerdearla 2022</a></li>
+<li><time>23-Sep-2022</time> <a href="/blog/nerdearla-2022/nerdearla-2022">I'm going to Nerdearla 2022</a></li>
<li><time>18-Sep-2022</time> <a href="/blog/sav/sav">SAV - Sorting Algorithms Visualized</a></li>
<li><time>23-Oct-2021</time> <a href="/blog/dwm-config/dwm-config">dwm - A tiling window manager configuration</a></li>
<li><time>04-Mar-2021</time> <a href="/blog/vim-config/vim-config">vim - The keyboard driven text editor</a></li>
diff --git a/common/latest_uploads.shtml b/common/latest_uploads.shtml
@@ -1,4 +1,4 @@
-<li><time>23-Sep-2022</time> <a href="/blog/nerdearla-2022/nerdearla-2022">I'm going to Nerdearla 2022</a></li>
+<li><time>23-Sep-2022</time> <a href="/blog/nerdearla-2022/nerdearla-2022">I'm going to Nerdearla 2022</a></li>
<li><time>18-Sep-2022</time> <a href="/blog/sav/sav">SAV - Sorting Algorithms Visualized</a></li>
<li><time>23-Oct-2021</time> <a href="/blog/dwm-config/dwm-config">dwm - A tiling window manager configuration</a></li>
<li><time>04-Mar-2021</time> <a href="/blog/vim-config/vim-config">vim - The keyboard driven text editor</a></li>
diff --git a/md/nerdearla-2022/nerdearla-2022.md b/md/nerdearla-2022/nerdearla-2022.md
@@ -22,12 +22,50 @@ This is how I replace the variables in the template with the data aquired from t
```console
$ sed -e "s/\$article-title\\$/$title/" -e "s/\$article-date\\$/$date/" \
-e "s/\$pagetitle\\$/$pagetitle/" -e '/\$body\$/r./body.html' \
- -e '/\$body\$/d' $template > $filename.html
+ -e '/\$body\$/d' $TEMPLATE > $filename.html
```
This is how I generate this webpage, converting it from its markdown file into html, this is a custom scripts that I made that only depends on lowdown, grep, and sed. Previously I had another script similar, which depended on pandoc, which is an alternative of lowdown but much more bloated, it depends on a ton of libraries wirtten in haskell
-```console
+```
$ ./build.sh nerdearla-2022.md
```
+
+this is an nginx config file snippet taken from [LandChad.net](https://landchad.net)
+
+
+```nginx
+server {
+ #...
+ auth_basic "What's the Password?" ;
+ auth_basic_user_file /etc/nginx/myusers ;
+ location /public/ {
+ #...
+ auth_basic off ;
+ }
+ #...
+}
+```
+
+```c
+int main (void)
+{
+ SAV *sav = NULL;
+ Drw *drw = NULL;
+ time_t tic, toc;
+ unsigned int ti, tf, dt, time_per_frame;
+ pthread_t p1 = 0;
+ status_t st;
+
+ if((st = SAV_create(&sav)) != OK) goto end;
+ if((st = drw_create(&drw)) != OK) goto end;
+
+ tic = time(NULL);
+ time_per_frame = 16; /* miliseconds */
+ sav->arr->shuffle(sav->arr);
+
+ char *hw = "Hello, world!\n"
+ return 0;
+}
+```
diff --git a/scripts/build_page.sh b/scripts/build_page.sh
@@ -71,6 +71,7 @@ lang="en"
generator="Shell script"
template="$templ"
filename="$(basename $input | sed 's/\.[^.]*$//')"
+last_update="$(date -r $input '+%d-%b-%Y')"
# echo "file: $input"
# echo "filename: $filename"
@@ -84,7 +85,7 @@ sed '/^% /d' $input | lowdown --html-no-head-ids --html-no-escapehtml --html-no-
# puts ids to <h1> tag and adds paragraph next to it with the article-date
sed -i -e 's/<h1>/<h1 id=article-title>/g' \
- -e "s/<\/h1>/<\/h1><p class=\"article-date\">"$date"<\/p>/" body.html
+ -e "s/<\/h1>/<\/h1><p class=\"article-date\">$date (last update $last_update)<\/p>/" body.html
# indent: sed + `-e 's/^/\t\t\t/'`
# (applying indent makes final html more pleasant to view, but causes code
@@ -106,7 +107,7 @@ insert_div_article_title_w_logo() {
sed -i -e "s^$title_line^<div id=\"article-title-with-icon\">\
<div id=\"article-icon\"> <img src=\"$logo_src\" title=\"$logo_title\" alt=\"$logo_alt\">\
- <\/div> <h1 id=\"article-title\">$h1_title<\/h1><\/div><p class=\"article-date\">$date</p>^"\
+ <\/div> <h1 id=\"article-title\">$h1_title<\/h1><\/div><p class=\"article-date\">$date (last update $last_update)</p>^"\
"$dest_dir"/"$filename".html
sed -i -E '/(^<p>).*?(article-icon).*?<\/p>/d' "$dest_dir"/"$filename".html
@@ -116,10 +117,10 @@ insert_div_article_title_w_logo() {
rm body.html &> /dev/null
-# ./syntax-highlight "$dest_dir"/"$filename".html > sh.html
+./scripts/syntax-highlight "$dest_dir"/"$filename".html > tmp.html
+
+mv tmp.html "$dest_dir"/"$filename".html
# cp -rf sh.html "$dest_dir"/"$filename".html
echo "==> "$filename".html generated succesfully"
-
-# apply_syntax_highlight "$filename.html"
diff --git a/scripts/deploy_local.sh b/scripts/deploy_local.sh
@@ -1,5 +1,7 @@
root_folder="/home/mk/soydev/webp/kloeckner.com.ar"
+[[ $EUID -ne 0 ]] && echo "erro: this script must be run with root privileges" && exit 1
+
set -xe
rm -rf /var/www/html &>/dev/null
diff --git a/scripts/sync.sh b/scripts/sync.sh
@@ -10,7 +10,7 @@ blog_folders=$("$root_folder"/scripts/sort_blog_index.py "$blog_folder")
# set -xe
generate_blog_index() {
- rm $root_folder/$blog_index_file 2> /dev/null
+ rm -rf $root_folder/$blog_index_file ||:
touch $root_folder/$blog_index_file
# for i in $(eval $root_folder/scritps/sort_blog_index.py $root_folder/$blog_folder); do
@@ -25,7 +25,7 @@ generate_blog_index() {
}
generate_latest_uploads() {
- rm $root_folder/$latest_uploads_file &> /dev/null
+ rm -rf $root_folder/$latest_uploads_file ||:
tail -n 5 $root_folder/$blog_index_file > $root_folder/$latest_uploads_file
}
diff --git a/scripts/template.html b/scripts/template.html
@@ -22,7 +22,6 @@
$body$
- <script type="text/javascript" src="/scripts/article-date.js"></script>
<!--#include virtual="/common/end_of_article.shtml" -->
</article>