This commit is contained in:
Artur Gurgul 2024-10-17 23:51:03 +02:00
parent d086c1d493
commit 0f1d41a991
30 changed files with 1013 additions and 1536 deletions

23
.sajt/layouts/default.pug Normal file
View file

@ -0,0 +1,23 @@
doctype html
html(lang="en")
head
meta(charset="utf-8")
meta(name="viewport" content="width=device-width, initial-scale=1")
title Artur Gurgul - #{title}
meta(name="author" content="Artur Gurgul")
meta(name="description" content="This is my notepad")
link(rel="shortcut icon" href="/favicon.png")
link(rel="alternate" type="application/atom+xml" title="#{site.data.theme.name}" href="#{site.url}/atom.xml")
link(rel="stylesheet" href="/static/css/all.css")
link(rel="stylesheet" href="/static/css/hightlight.css")
body
.container
.sidebar
include sidebar.pug
.scroll
.content
h1.title= title
#post!= content
.footer
include footer.pug

2
.sajt/layouts/footer.pug Executable file
View file

@ -0,0 +1,2 @@
.disclaimer
p © Artur Gurgul, 2024 — Public Domain Licence

10
.sajt/layouts/sidebar.pug Executable file
View file

@ -0,0 +1,10 @@
nav
h2(style="font-size: 20px; margin: 0px;") Hi. I'm
a(href="/") Artur Gurgul
h2(style="font-size: 15px; margin-top: -0.5em;") and this is my notepad.
hr.hr-text(data-content="Contents")
ul#blog-posts.posts
each page in pages.filter(it => it.hidden != true && it.title != undefined )
li
span »
a(href=page.url, style=(false ? "font-weight: bold;" : ""))= page.title

View file

@ -15,7 +15,9 @@ Publishing throught SSH (ftp and dav is planned)
sajt build
--clean # remove local files that are not revelant to the project anymore
--publish or --serve -p 3000 --watch # Publish or serve with options -p PORT, --watch observe changes and rebuild the page if thare are any
--publish or --serve -p 3000 --watch # Publish or serve with options -p PORT, --watch observe changes and rebuild the page if thare are any
--config config.yaml or -c config.yaml
--private # include private resources as well
sajt publish
--override # default is skip, if file exists, do not change it
@ -23,7 +25,7 @@ Publishing throught SSH (ftp and dav is planned)
### Project structure
.sajt/config.yaml
.sajt/config.yaml # default config, you can override values pointing secundary file using `--config` flag
.sajt/media # copy all files as they are
.sajt/layouts # pug files that describes the layout the pages

View file

@ -1,5 +1,3 @@
#!/usr/bin/env node
console.log("hello i am linked")
import "../index.js"

7
empty/.sajt/config.yaml Normal file
View file

@ -0,0 +1,7 @@
site:
title: Artur Gurgul - {{article.title}}
remote:
type: ssh
user: debian
host: artur.gurgul.pro
path: /var/www/artur.gurgul.pro

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file with editors other than draw.io -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="473px" height="187px" viewBox="-0.5 -0.5 473 187" content="&lt;mxfile host=&quot;Electron&quot; modified=&quot;2023-11-07T18:35:04.577Z&quot; agent=&quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36&quot; version=&quot;22.0.3&quot; etag=&quot;K1wkrmuddXaPyJl6GV6f&quot; type=&quot;device&quot;&gt;&lt;diagram name=&quot;Page-1&quot; id=&quot;i07ux6VTKLeM-OTNBLxs&quot;&gt;5ZhNU9swEIZ/TY5k/BHHzjEf0B5oywzTFo7CVhwVxeuRFZLw6yvZq9iOTYCEQEpPWK9Wa0n76kFxxx3PV18ESWffIKK841jRquNOOo5jB/2B+qOVNSpKKpRYsAi1UrhmjxRFC9UFi2hWC5QAXLK0LoaQJDSUNY0IAct62BR4/a0piWlDuA4Jb6q/WSRnhRo4fql/pSyemTfbZsVzYoJxJdmMRLCsSO55xx0LAFk8zVdjyvXumX0pxl080buZmKCJfMkApxjwQPgC14bzkmuzWBqptWMThJxBDAnh56U6ErBIIqozWqpVxlwCpEq0lfiHSrnGQpKFBCWpGYr1jR7UdTzTvsUkeWOyqrXW2JpCIsfAQeTzcy2rbxH18lEmBdzTp3tMqRzMYRal50c4ixP1HKpXUTV8xMkd5VeQMcmg1vFAhWTKCpdbAXMWRflumIAhptx05ClHJLyP8w0zE00g0b3FvuvNrpUyg4UIUcJDIomIKVZ30Cy4vbGROoAU5lTtnQoRlBPJHurZCR6EeBOHQ4dCkHUlIAWWyKyS+UoLKgAPtRP4Xa/IiYfaDZyq89RDkdO0KpMrpdyd7U51G079mUZE0la/5sVpK+t2ce5ASphrD9OMPZK7PIk2GS5YZfRGHW/Sbruh1mcg2KPqIxy9tL91spSELIlHOKky2zOu0YnpqtOCPlxRCZyqU5x2p2Aiq2sFWENT0zNM/jovlWYxITCdZsrBdXu81hC9k0DXoeQaTlpo1ORVK9vysXTF5A2O08+3FaKqZjkT3TATOQaKbOftWVSzxw4veE/AIfvMdHCPS4feTjqcKY/1A++EeNBveGCs9l0A52p7t21QP/dTxvnW1ul6XpA54/rI/EhposZfkyQ70v1jzzq+4KzhgJ7T+Aft44FdlldY2xhhVrm+9q3DD6j/gbBGQFpd36sycicgS8LX+I4p3hnxB9N60KR1/+NgHTRhnekjag1DjbxPzez+cZntP3Ojc3y/V7/RuYcRfN064E14PmjY5Bejy+dIvgPb7ZD/50jueNsk7w3ekeTmG8zHotzZA+X2UVHeFtl0y8EoN7fsE2G5bTfc8B0km7LPffW27VK8pFO96WfOS39Y7cl222qvaXkht/2gDvdT+rlujFtxCn4Z/t+B3rfeE+iqWX5eLupYfqV3z/8C&lt;/diagram&gt;&lt;/mxfile&gt;"><defs/><g><path d="M 170.5 15 L 30.53 15 L 30.5 116.76" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 30.5 122.76 L 26.5 114.76 L 30.5 116.76 L 34.5 114.76 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="10.999999999999998px"><text x="34.74" y="8.55">Update</text></g><path d="M 290.5 20 L 410.53 20.05 L 410.5 116.76" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 410.5 122.76 L 406.5 114.76 L 410.5 116.76 L 414.5 114.77 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="10.999999999999998px"><text x="372.63" y="12.59">Updates</text></g><rect x="170.5" y="5" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="11.999999999999998px"><text x="230" y="39.5">Controller</text></g><path d="M 90.5 125 L 90.53 50.05 L 162.26 50.01" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 168.26 50 L 160.27 54.01 L 162.26 50.01 L 160.26 46.01 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="10.999999999999998px"><text x="114.55" y="43.59">User Actions</text></g><rect x="0.5" y="125" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="11.999999999999998px"><text x="60" y="159.5">View</text></g><path d="M 380.5 125 L 380.53 50.05 L 298.74 50" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 292.74 50 L 300.74 46.01 L 298.74 50 L 300.73 54.01 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="10.999999999999998px"><text x="371.55" y="42.18">Notifies</text></g><rect x="350.5" y="125" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="11.999999999999998px"><text x="410" y="159.5">Model</text></g></g></svg>

Before

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file with editors other than draw.io -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="473px" height="186px" viewBox="-0.5 -0.5 473 186" content="&lt;mxfile host=&quot;Electron&quot; modified=&quot;2023-11-07T18:34:22.657Z&quot; agent=&quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36&quot; version=&quot;22.0.3&quot; etag=&quot;Iz-bp9UTBWzNTIIgo6GH&quot; type=&quot;device&quot;&gt;&lt;diagram name=&quot;Page-1&quot; id=&quot;xkBbz92YaXBT8ljpGPb4&quot;&gt;7VlbV6MwEP41fdQDoRf62Iu6D+6u53j29phCSrOmDCektvXXbwJJIQUrWmvr6hPky2RIMt98DKHljearK46T2VcICWshJ1y1vHELIdfv9uVFIWuNSChHIk5DjRXALX0gGnQ0uqAhSS1DAcAETWwwgDgmgbAwzDksbbMpMPupCY5IBbgNMKuiv2goZjnqo16BfyE0mpknu2bFc2yM9UrSGQ5hWYK8i5Y34gAiv5uvRoSp3TP7ko+7fKR3MzFOYtFkAMoH3GO20GvT8xJrs1gSyrXrJnAxgwhizC4KdMhhEYdEeXRkq7C5Bkgk6ErwLxFirQOJFwIkJGfI17/VoHPUMe0/2knWGK+s1lq3phCLETDg2fw8x+k6WD58mAoOd+TxHhMqpH2YRan5YUajWN4H8lFEDh8yPCHsBlIqKFgd94QLKqlwvWUwp2GY7YYxGGiXm47M5RAHd1G2YWaiMcSqN993tdlWKFNY8EBDOkkE5hHZUKsacXfDI5mBBOZEbp404YRhQe9t91hnQrSx00MHnON1ySABGou05PlGAdJAZzXyNaN1Tvct3smb3KFplWZWQBk363nqVXj6IwmxILVszUJTF9Tt0ExACJgrBpOUPuBJ5kRRTK9WeuwMW51xPekGCp8Bpw+yDzPNpJcTpwk/lBOyatWInJ59IS1lSqB6SmhHzrnj+8gK35l2/jzSFKwwJjCdppKrNhWeG/z2SYjUvho1GNfoTlWZalUsG3sQ/Wi/vn5Ykd4R1s4jOZ1+JnWjpG7vTOoz+Vrt+p0TSuNuJd4jucccGJNbuR1yO12nlLGtrVOxu8RzylTKfU9ILMff4jg9UIHwwjg2yCs9oI3sF6h5ny6LAtM1JrNScdl19s/E3hEFdkVFrq+9jm5u9FXeF/KqGkZdC1W2NFm7eG+ybGq4si53jyfLflWWU5WgziBQ4vZfqXOa4IDG0VBPatw+rGL3nijDUK/Xtsswbz/9XtcOeBU17x9fM9yyYBT68VE145i1nDmZKdHhiqjvRWeR1XRhxozPD7amStF/Qilc37wiTqK0M3Qshf8nJcunqrodJVx9wffuqjrUsas65LxhWece83TP1HWWRqOGGu3aGo1eV6PrLKtc2V+j2zUafYDzusZ0qB6ifQNBp/Tzi7uhKru7z9HkJ7fb8+0C7pTO0dzqQZr+OfPRZbrrvJ1My2bxfyePYvGbzLv4Bw==&lt;/diagram&gt;&lt;/mxfile&gt;"><defs/><g><path d="M 171 14 L 31.05 14 L 31 115.76" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 31 121.76 L 27 113.76 L 31 115.76 L 35 113.77 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="10.999999999999998px"><text x="35.24" y="8.55">Update</text></g><path d="M 291 34 L 410.95 34 L 411 115.76" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 411 121.76 L 406.99 113.77 L 411 115.76 L 414.99 113.76 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="10.999999999999998px"><text x="367.87" y="29.55">Updates</text></g><rect x="171" y="4" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="11.999999999999998px"><text x="230.5" y="38.5">Controller</text></g><path d="M 91 124 L 90.95 49.05 L 162.76 49.01" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 168.76 49 L 160.77 53.01 L 162.76 49.01 L 160.76 45.01 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="10.999999999999998px"><text x="114.98" y="44.59">User Actions</text></g><path d="M 121 169 L 342.76 169" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 348.76 169 L 340.76 173 L 342.76 169 L 340.76 165 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="10.999999999999998px"><text x="256.82" y="164.55">Gets updated state</text></g><rect x="1" y="124" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="11.999999999999998px"><text x="60.5" y="158.5">View</text></g><path d="M 351 139 L 129.24 139" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 123.24 139 L 131.24 135 L 129.24 139 L 131.24 143 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="10.999999999999998px"><text x="256.29" y="133.55">Notifies</text></g><rect x="351" y="124" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="11.999999999999998px"><text x="410.5" y="158.5">Model</text></g></g></svg>

Before

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file with editors other than draw.io -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="572px" height="63px" viewBox="-0.5 -0.5 572 63" content="&lt;mxfile host=&quot;Electron&quot; modified=&quot;2023-11-15T22:26:32.916Z&quot; agent=&quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36&quot; version=&quot;22.0.3&quot; etag=&quot;69OR-mwMNjNfgNuLt2t0&quot; type=&quot;device&quot;&gt;&lt;diagram name=&quot;Page-1&quot; id=&quot;UDvbTf5mp8RW8-KXhH33&quot;&gt;7Vhbb9owFP41vE65kEAfC7TbpG6rVHXrHg0xiVeTEzmmQH/97OSYxLm0bNC1qiYhYX8+5/jynRsM/Olq+1GQLPkCEeUDz4m2A3828DzXDXz1pZEdIo4blEgsWIRYBdywR2oEEV2ziOaWoATgkmU2uIA0pQtpYUQI2NhiS+D2rhmJaQu4WRDeRn+wSCYlOvZGFf6JsjgxO7vhWbmyIkYYb5InJIJNDfIvBv5UAMhytNpOKdevZ96l1LvsWd0fTNBUHqLglQoPhK/xbnguuTOXpZG6O05ByARiSAm/qNCJgHUaUW3RUbNK5gogU6CrwF9Uyh0SSdYSFLSEVE6Bgyi28R0ndIiyMcmlgHvav2Je3EMb5mx6G8JZnKrxQl2fKvUJJ3PKryFnkoG18ECFZIrRq4bAikVRcSkjcI4m9wvKgtjd4YbF5Ke++YfATGdbfIlytjOzLZN3tXFNS80qJT0xOiUZmgGL3xzWYoFQiP5PREyR8lHbC9y9b6mopLCi6mRKRFBOJHuwrROMjngvh6rnQpBdTSADlsq8ZvlaA0oAI9038YpxHp41nPHP5NWgPEGP9tjWHjmOfZ/y1VDriWN4YeMYw4ah8q1bhtSg9rgVVIRcd/j5rfCbEUkUMmdpxNK4MxgLl+1y9qbLzkFKWOkApTl7JPPCiHYrJE5ZDCaDYNYdjOcaT0CwR7VGODr83wdUoTkhi/u4yBdmtxRSuvd0bYRuLW/EHI6nrzJn3bu9U3h35QdGBJbLnB5L8fD1Muw+Uzl2pvKeS1V93tBMt+2E3Jm8C12T/lwr/Xkvkf/cDhc5NgFaHvAE3UGL7tssIpLm/0P5oFAevuFQDlvcfmd0g/1tg107YpeM88YraZouyYpx7evfMpoq/RuS5i/SGfUxckCEoMLQaRRFUyQ3VQPsGkKTWvMbOv1kHRpUo86HH2hCdM+gXU59nNvPGp6qmwvgXLnyM6Q8wUA3X6duV0/Aizt+RV7Gb6C2Nbrw0WlrW5dkm9fu1n50dG0zhaxe3MLT17buNjj0mv10cFA/3f8r4YjUe9bytK8g2ZK9r7qaZ2Shuv4JHqo4CGJXdCkRecHqO37D1dcEQ80HDiq97yHLh/6/y/JqWv3/VPJU/Y3nX/wG&lt;/diagram&gt;&lt;/mxfile&gt;"><defs/><g><path d="M 220 30 L 130 30 L 128.24 30" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 122.24 30 L 130.24 26 L 128.24 30 L 130.24 34 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="11px"><text x="169.95" y="25.41">Data binding</text></g><path d="M 340 15 L 441.76 15" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 447.76 15 L 439.76 19 L 441.76 15 L 439.76 11 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="11px"><text x="395.41" y="10.41">Updates</text></g><rect x="220" y="0" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="12px"><text x="279.5" y="34.5">ViewModel</text></g><rect x="0" y="0" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="12px"><text x="59.5" y="27.5">View</text><text x="59.5" y="41.5">+ UIViewController</text></g><path d="M 450 45 L 348.24 45" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 342.24 45 L 350.24 41 L 348.24 45 L 350.24 49 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060AD" font-family="Helvetica" text-anchor="middle" font-size="11px"><text x="394.5" y="40.41">Notifies</text></g><rect x="450" y="0" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="12px"><text x="509.5" y="34.5">Model</text></g></g></svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file with editors other than draw.io -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="402px" height="252px" viewBox="-0.5 -0.5 402 252" content="&lt;mxfile host=&quot;Electron&quot; modified=&quot;2023-10-25T22:24:22.516Z&quot; agent=&quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36&quot; etag=&quot;bTbxmJN1u4h5iuN82-fe&quot; version=&quot;22.0.3&quot; type=&quot;device&quot;&gt;&lt;diagram name=&quot;Page-1&quot; id=&quot;Rsnn_ZEz_QR4m3hk7b2z&quot;&gt;1ZfLcpswFIafxstmACV2svQtzSKddOJF2+xkOAa5QocKEUOfvhJIGGzHSWbstN14pF9Ht//jSPKATNPys6RZ8gUj4IPAi8oBmQ2CYDS80b9GqBphSPxGiCWLGqkjLNhvsKJn1YJFkPcCFSJXLOuLIQoBoeppVErc9MNWyPuzZjSGPWERUr6vfmORShr1Ohht9TtgceJm9t2GU+qC7U7yhEa46UhkPiBTiaiaUlpOgRvvnC9Nv9sXWtuFSRDqLR2eHuRG+nORLp9G5BeuHuXj+BNpRnmmvLAbtotVlXMAIm2IraJUCcYoKJ9v1YnEQkRgpvF0bRtzj5hp0dfiGpSqLF1aKNSSXrasvptOF1eu+sOOUVdmZa9W2doKhZoiR1kvj3je0KN67kmuJP6El1scvsCO4fZkjTTbfNFZK+VYyBCO2Om+UCpjUEfigpa/zhvAFPQGdT8JnCr23F8HtV9w3MZtIeuC5fwO5v4e83WyXO9x71NdMc6dtwIFWBNvacq4IfOQgdD9F1Tk52P0DFJBeZzSvqu2w6VLRHsSXdvqZpvWvgtJOik99M7EITjAYZ28xuGI6YcRnZYDmZwABdlBEYz+NovLN5yDnOtLx7iqT/LMiCHHwni2SZiCRUbro2Gjr8HzwTiB+f5N33zff6P51+cy/2rP/HGotBm7BJzvRcqbADIxTjB9W9/TJfCvmDPFUOiQJSqFaSdgzFlsGpS5kiZYKM6E9tw9Gv6FI+4kdK+GO6l1gC75yMwavp5Z7cvIUIhonrSnHbXUQr17kAdwpiyKeDcn0zI279CL5u0XXOhYnaVqhsWSw403NrKZpfKN5/WEpSkGTVE7OxvVxaot1kPdgWHY9Ph/crtF3c1t7wD+VnwHf13dvl7rts5fADL/Aw==&lt;/diagram&gt;&lt;/mxfile&gt;"><defs/><g><path d="M 291 61 L 291 126 L 191 126 L 191 182.76" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 191 188.76 L 187 180.76 L 191 182.76 L 195 180.76 Z" fill="#0060ad" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><rect x="231" y="1" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="12px"><text x="290.5" y="35.5">jhbj</text></g><rect x="131" y="191" width="120" height="60" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="12px"><text x="190.5" y="225.5">jhjh</text></g><path d="M 31 51 C 7 51 1 71 20.2 75 C 1 83.8 22.6 103 38.2 95 C 49 111 85 111 97 95 C 121 95 121 79 106 71 C 121 55 97 39 76 47 C 61 35 37 35 31 51 Z" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="386" cy="138.5" rx="7.5" ry="7.5" fill="none" stroke="#0060ad" stroke-width="2" pointer-events="all"/><path d="M 386 146 L 386 171 M 386 151 L 371 151 M 386 151 L 401 151 M 386 171 L 371 191 M 386 171 L 401 191" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/><g fill="#0060ad" font-family="Open Sans" font-weight="bold" text-anchor="middle" font-size="12px"><text x="385.5" y="208.5">Actor</text></g><path d="M 1 151 L 71 151 L 71 176 L 81 176 L 81 166 L 101 186 L 81 206 L 81 196 L 71 196 L 71 221 L 46 221 L 46 231 L 56 231 L 36 251 L 16 231 L 26 231 L 26 221 L 1 221 Z" fill="none" stroke="#0060ad" stroke-width="2" stroke-miterlimit="10" pointer-events="all"/></g></svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.9 KiB

686
empty/.sajt/static/css/all.css Executable file
View file

@ -0,0 +1,686 @@
@font-face {
font-family: Montserrat;
/* declare weights giving two values to specify a range */
font-weight: 400 800;
src: url(/static/fonts/Montserrat-VariableFont_wght.ttf);
}
@font-face {
font-family: Montserrat;
/* declare weights giving two values to specify a range */
font-weight: 400 800;
font-style: italic;
src: url(/static/fonts/Montserrat-Italic-VariableFont_wght.ttf);
}
@font-face {
font-family: Proto;
/* declare weights giving two values to specify a range */
font-weight: 400 800;
src: url(/static/fonts/0xProto-Regular.ttf);
}
* {
font-family: Montserrat, sans-serif;
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
font-weight: 500;
}
.title {
position: sticky; top:0;
background-color: white;
}
html {
scroll-behavior: smooth;
}
.container {
position: relative;
/* margin: 0 auto; */
padding: 0;
display: flex;
}
.sidebar {
width: 390px;
float: left;
}
body,
.content,
.container {
box-sizing: border-box;
}
body,
.container {
height: 100%;
}
.content {
width: 800px;
}
.sidebar {
box-sizing: border-box;
border-right: 1px solid #DDD;
height: 100%;
}
.scroll {
height: 100%;
width: 100%;
overflow-y: scroll
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
body {
background: #fff;
font: 14px/21px Montserrat;
color: #444;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #181818;
font-family: Montserrat, sans-serif;
font-weight: normal;
}
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
font-weight: inherit;
}
h1 {
font-size: 46px;
line-height: 50px;
margin-bottom: 14px;
}
h2 {
font-size: 35px;
line-height: 40px;
margin-bottom: 10px;
}
h3 {
font-size: 28px;
line-height: 34px;
margin-bottom: 8px;
}
h4 {
font-size: 21px;
line-height: 30px;
margin-bottom: 4px;
}
h5 {
font-size: 17px;
line-height: 24px;
}
h6 {
font-size: 14px;
line-height: 21px;
}
.subheader {
color: #777;
}
p {
margin: 0 0 20px 0;
}
p img {
margin: 0;
}
p.lead {
font-size: 21px;
line-height: 27px;
color: #777;
}
em {
font-style: italic;
}
strong {
font-weight: bold;
color: #333;
}
small {
font-size: 80%;
}
blockquote,
blockquote p {
font-size: 17px;
line-height: 24px;
color: #777;
font-style: italic;
}
blockquote {
margin: 0px;
padding: 0px 20px 0 15px;
border-left: 2px solid #ddd;
}
blockquote cite {
display: block;
font-size: 12px;
color: #555;
}
blockquote cite:before {
content: "\2014 \0020";
}
blockquote cite a,
blockquote cite a:visited,
blockquote cite a:visited {
color: #0060ad;
}
hr {
border: solid #ddd;
border-width: 1px 0 0;
clear: both;
margin: 10px 0 30px;
height: 0;
}
a,
a:visited {
color: #333;
text-decoration: underline;
outline: 0;
}
a:hover,
a:focus {
color: #000;
}
p a,
p a:visited {
line-height: inherit;
}
ul,
ol {
margin-bottom: 20px;
}
ul {
list-style: none outside;
}
ol {
list-style: decimal;
}
ol,
ul.square,
ul.circle,
ul.disc {
margin-left: 30px;
}
ul.square {
list-style: square outside;
}
ul.circle {
list-style: circle outside;
}
ul.disc {
list-style: disc outside;
}
ul ul,
ul ol,
ol ol,
ol ul {
margin: 4px 0 5px 30px;
font-size: 90%;
}
ul ul li,
ul ol li,
ol ol li,
ol ul li {
margin-bottom: 6px;
}
li {
line-height: 18px;
margin-bottom: 12px;
}
ul.large li {
line-height: 21px;
}
li p {
line-height: 21px;
}
img.scale-with-grid {
max-width: 100%;
height: auto;
}
ul.tabs {
display: block;
margin: 0 0 20px 0;
padding: 0;
border-bottom: solid 1px #ddd;
}
ul.tabs li {
display: block;
width: auto;
height: 30px;
padding: 0;
float: left;
margin-bottom: 0;
}
ul.tabs li a {
display: block;
text-decoration: none;
width: auto;
height: 29px;
padding: 0px 20px;
line-height: 30px;
border: solid 1px #ddd;
border-width: 1px 1px 0 0;
margin: 0;
background: #f5f5f5;
font-size: 13px;
}
ul.tabs li a.active {
background: #fff;
height: 30px;
position: relative;
top: -4px;
padding-top: 4px;
border-left-width: 1px;
margin: 0 0 0 -1px;
color: #111;
}
ul.tabs-content {
margin: 0;
display: block;
}
ul.tabs-content>li {
display: none;
}
ul.tabs-content>li.active {
display: block;
}
ul.tabs:before,
ul.tabs:after {
content: '\0020';
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
ul.tabs:after {
clear: both;
}
ul.tabs {
zoom: 1;
}
label span,
legend span {
font-weight: normal;
font-size: 13px;
color: #444;
}
thead {
border-bottom: solid #0060ad;
font-weight: bold;
color: #0060ad;
}
thead th {
padding-left: 20px;
padding-right: 20px;
padding-top: 5px;
padding-bottom: 0px;
}
tbody td {
padding: 5px;
}
table {
margin-left: auto;
margin-right: auto;
}
html,
body {
height: 100%;
}
body {
font-size: 16px;
background-color: white;
color: #222222;
line-height: 24px;
margin: 0;
border-top: 7px solid #0060ad;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #181818;
font-family: Montserrat, sans-serif;
font-weight: 600;
}
h1.title {
font-weight: 800;
}
h1 {
font-size: 32px;
line-height: 40px;
}
h2 {
font-size: 24px;
line-height: 30px;
}
h3 {
font-size: 21px;
line-height: 24px;
margin: 1em 0;
}
ul {
margin: 1em 0;
list-style: disc;
}
a {
color: #0060ad;
text-decoration: none;
}
a:hover {
color: #0060ad;
text-decoration: underline;
}
a:visited {
color: #0060ad;
}
table {
font-size: inherit;
font: 100%;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
}
.posts {
padding: 20px;
}
ul.posts {
margin-top: 0;
list-style-type: none;
margin-bottom: 10px;
}
ul.posts li {
line-height: 22px;
font-size: 16px;
margin-bottom: 0px;
}
ul.posts span {
font-family: 'Proto', monospace;
color: #aaa;
padding-right: 5px;
font-size: 14px;
}
.site .footer {
font-size: 80%;
color: #666;
border-top: 4px solid #eee;
overflow: hidden;
}
nav h1,
nav h2 {
text-align: center;
}
#post pre {
border: 0px solid #ddd;
background-color: #005fad06 !important;
padding: 0 .4em;
margin-bottom: 20px !important;
border-color: #005fad43 !important;
}
#post ul,
#post ol {
margin-left: 1.35em;
}
#post code {
border: 1px solid #ddd;
background-color: #eef;
font-size: 85%;
padding: 0 .2em;
}
#post pre code {
border: none;
}
.sidebar {
padding-top: 25px;
font-family: Montserrat, sans-serif;
}
.sidebar p {
font-weight: 200;
}
.sidebar a {
font-weight: 600;
}
text {
font: 500 12px/22px Montserrat, sans-serif;
}
/* path, rect {
stroke: red;
} */
g {
font: 500 12px/22px Montserrat, sans-serif;
}
/* stroke-width="2" */
.content {
font: 400 16px/22px Montserrat, sans-serif;
padding-left: 40px;
padding-top: 25px;
min-height: 400px;
}
#home h2 {
color: #0060ad;
}
#post pre {
background-color: white;
border-left: 12px solid #eee;
padding: 0 .8em;
}
#post code {
background-color: transparent;
}
#stalker {
float: inherit;
}
.disclaimer {
color: #aaa;
font-weight: 700;
font-size: smaller;
text-align: center;
padding-top: 40px;
padding-bottom: 10px;
}
.highlight {
background-color: white;
color: #586e75;
font-weight: bold;
}
.highlight .c {
color: #586e75 !important;
font-style: italic !important
}
p:has(img) {
background-color: #005fad06;
border-left: 12px solid #005fad43;
}
p > img {
display: block;
margin: 0 auto;
padding-top: 12px;
padding-bottom: 12px;
}
p:has(svg) {
background-color: #005fad06;
border-left: 12px solid #005fad43;
}
p > svg {
display: block;
margin: 0 auto;
padding-top: 12px;
padding-bottom: 12px;
}
pre {
white-space: pre;
overflow: auto;
}
code,
pre {
font-family: 'Proto', monospace;
}
.hljs {
padding: 0px !important;
}

View file

@ -0,0 +1,101 @@
/*
XCode style (c) Angel Garcia <angelgarcia.mail@gmail.com>
*/
.hljs {
background: #fff;
color: black;
}
/* Gray DOCTYPE selectors like WebKit */
.xml .hljs-meta {
color: #c0c0c0;
}
.hljs-comment,
.hljs-quote {
color: #007400;
}
.hljs-tag,
.hljs-attribute,
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-name {
color: #aa0d91;
}
.hljs-variable,
.hljs-template-variable {
color: #3F6E74;
}
.hljs-code,
.hljs-string,
.hljs-meta .hljs-string {
color: #c41a16;
}
.hljs-regexp,
.hljs-link {
color: #0E0EFF;
}
.hljs-title,
.hljs-symbol,
.hljs-bullet,
.hljs-number {
color: #1c00cf;
}
.hljs-section,
.hljs-meta {
color: #643820;
}
.hljs-title.class_,
.hljs-class .hljs-title,
.hljs-type,
.hljs-built_in,
.hljs-params {
color: #5c2699;
}
.hljs-attr {
color: #836C28;
}
.hljs-subst {
color: #000;
}
.hljs-formula {
background-color: #eee;
font-style: italic;
}
.hljs-addition {
background-color: #baeeba;
}
.hljs-deletion {
background-color: #ffc8bd;
}
.hljs-selector-id,
.hljs-selector-class {
color: #9b703f;
}
.hljs-doctag,
.hljs-strong {
font-weight: bold;
}
.hljs-emphasis {
font-style: italic;
}

Binary file not shown.

View file

@ -2,7 +2,8 @@ import { Command } from 'commander'
import chalk from 'chalk'
import fs from 'fs-extra'
import path from 'path'
import { newProject, buildProject } from './project.js'
import { newProject, buildProject, appProject } from './project.js'
import { serve } from './serve.js'
const program = new Command()
@ -11,9 +12,19 @@ program
.description('Initialize project in the current directory with the default theme')
.action(newProject)
program
program
.command('build')
.description('Build the webpage')
.action(newProject)
.action(buildProject)
program
.command('serve')
.description('Run the website locally')
.action(serve)
program
.command('app')
.description('Run notes as the the app')
.action(appProject)
program.parse(process.argv)

View file

@ -1,7 +1,9 @@
const hljs = require('highlight.js')
const { marked } = require('marked')
const { markedHighlight } = require('marked-highlight')
const matter = require('gray-matter')
import hljs from 'highlight.js'
import { marked } from 'marked'
import { markedHighlight } from 'marked-highlight'
import matter from 'gray-matter'
import fs from 'fs'
import path from 'path'
marked.use(markedHighlight({
langPrefix: 'hljs language-',
@ -11,7 +13,7 @@ marked.use(markedHighlight({
}
}))
function parseMD(file) {
export function parseMD(file) {
const fileContents = fs.readFileSync(path.join("./", file), 'utf8')
@ -25,13 +27,13 @@ function parseMD(file) {
}
}
const renderer = new marked.Renderer();
const renderer = new marked.Renderer()
renderer.paragraph = (text) => {
return text.text
}
function parseMarkdown(obj) {
export function parseMarkdown(obj) {
for (let key in obj) {
if (typeof obj[key] === 'object' && obj[key] !== null) {
if (Array.isArray(obj[key])) {

1430
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,8 @@
"description": "Static site generator based on pug/html and yaml files",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "electron ./src/desktop/main.js"
},
"bin": {
"sajt": "./bin/sajt"
@ -41,5 +42,8 @@
"pug": "^3.0.3",
"ssh2": "^1.15.0",
"ssh2-sftp-client": "^11.0.0"
},
"devDependencies": {
"electron": "^33.0.1"
}
}

View file

@ -1,5 +1,6 @@
import { fileURLToPath } from 'url'
import path from 'path'
import fs from 'fs'
import { cp } from './utils.js'
// Get the directory of the current file
@ -15,6 +16,57 @@ export function newProject() {
cp(DEFAULT_PROJECT_PATH, ".")
}
import { readConfig } from './site.js'
import { build } from './site.js'
export function buildProject() {
const ignore = [".build", ".site"]
console.log("building")
let config = {
... readConfig(),
buildDir: './.build',
ignore: [".build", ".sajt"]
}
config.remote.port = 22
config.remote.privateKey = fs.readFileSync(path.resolve(process.env.HOME, '.ssh/id_rsa'))
build(config)
//loadTemplate()
//parseMD()
//buildProject(config)
}
//import { run } from './src/desktop/main.js'
import * as proc from 'child_process'
//import { app, BrowserWindow } from 'electron'
import * as electron from 'electron'
export function appProject() {
//run()
//const child = proc.spawn(electron, ["."])
console.log(electron)
console.log(electron.default)
const child = proc.spawn(electron.default, [".build"])
// https://www.matthewslipper.com/2019/09/22/everything-you-wanted-electron-child-process.html
// exec('node start', (error, stdout, stderr) => {
// if (error) {
// console.error(`error: ${error.message}`)
// return;
// }
// if (stderr) {
// console.error(`stderr: ${stderr}`);
// return
// }
// console.log(`stdout:\n${stdout}`)
// })
}

View file

@ -1,4 +1,4 @@
const express = require('express')
import express from 'express'
const app = express()
const PORT = process.env.PORT || 3000

View file

@ -1,6 +1,6 @@
const fs = require('fs')
const pug = require('pug')
const path = require('path')
import fs from 'fs'
import pug from 'pug'
import path from 'path'
function removeDirectorySync(directory) {
try {
@ -11,8 +11,12 @@ function removeDirectorySync(directory) {
}
}
function readConfig() {
const fileContents = fs.readFileSync('.site/config.yaml', 'utf8')
import yaml from 'js-yaml'
export function readConfig() {
const __dirname = process.cwd()
const configPath = path.join(__dirname, '.sajt/config.yaml')
const fileContents = fs.readFileSync(configPath, 'utf8')
return yaml.load(fileContents)
}
@ -21,7 +25,7 @@ function compile(template, content, output) {
console.error("Template is not defined")
return
}
const compiledFunction = pug.compileFile(`.site/templates/${template}.pug`);
const compiledFunction = pug.compileFile(`.sajt/layouts/${template}.pug`);
const data = {
...content,
site: {posts: []}
@ -50,6 +54,8 @@ function compileData(template, content, output) {
console.log(`HTML has been rendered and saved to ${output}`);
}
import { getAllFilesWithExtension, pathToArray, parseYML } from './utils.js'
import { parseMD } from './markdown.js'
function readMetadata(ignore) {
let htmlExtension = "html"
@ -99,72 +105,50 @@ function readMetadata(ignore) {
site.meta = site.md.meta
site.hidden = site.data.hidden || false
site.hidden = site.data?.hidden || false
}
return list
}
import { cp } from "./utils.js"
import { parseMarkdown } from './markdown.js'
export function build(config) {
removeDirectorySync(config.buildDir)
cp("./.sajt/static", path.join(config.buildDir, "static"))
const buildFolder = './.build'
let data = readMetadata(config.ignore)
let pages = data.map(site => {
return {
title: site.meta.title,
url: site.path
}
})
//loadTemplate()
//parseMD()
let config = readConfig()
const serverConfig = {
host: config.remote.host,
port: 22,
username: config.remote.user,
privateKey: privateKey,
path: config.remote.path
}
removeDirectorySync(buildFolder)
copyDirectory("./.site/static", path.join(buildFolder, "static"))
let data = readMetadata()
let pages = data.map(site => {
return {
title: site.meta.title,
url: site.path
for(const site of data) {
if (site.type == "md") {
compile(site.meta.layout,
{
content: site.md.content,
title: site.meta.title,
hidden: false,
pages
},
path.join(config.buildDir, site.path))
} else if (site.type == "yml") {
let data = {...site.data}
delete data.layout
parseMarkdown(data)
compileData(site.data.layout,
{data, pages, hidden: data.hidden},
path.join(config.buildDir, site.path))
}
}
})
for(const site of data) {
if (site.type == "md") {
compile(site.meta.layout,
{
content: site.md.content,
title: site.meta.title,
hidden: false,
pages
},
path.join(buildFolder, site.path))
} else if (site.type == "yml") {
let data = {...site.data}
delete data.layout
parseMarkdown(data)
compileData(site.data.layout,
{data, pages, hidden: data.hidden},
path.join(buildFolder, site.path))
}
}
//console.log(readMetadata())
// sajt
uploadDirectory(serverConfig, buildFolder)
//console.log(readMetadata())
// sajt
// Not to upload now
//uploadDirectory(serverConfig, buildFolder)
}

15
src/desktop/index.html Normal file
View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using Node.js <span id="node-version"></span>,
Chromium <span id="chrome-version"></span>,
and Electron <span id="electron-version"></span>.
</body>
</html>

34
src/desktop/main.js Normal file
View file

@ -0,0 +1,34 @@
import { app, BrowserWindow } from 'electron'
// import pkg from 'electron';
// console.log("package ", pkg)
// const { app, BrowserWindow } = pkg;
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600
})
//win.loadFile('index.html')
win.loadFile('/Users/agurgul/projs/home/docs/artur.gurgul.pro/.build/index.html')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit()
})
// REPL
// { app } = await import('electron')
export function run() {
console.log("running")
}

4
ssh.js
View file

@ -1,9 +1,5 @@
const Client = require('ssh2-sftp-client')
// Read the private key from the default location
const privateKey = fs.readFileSync(path.resolve(process.env.HOME, '.ssh/id_rsa'))
async function uploadDirectory(serverConfig, localDirPath) {
const sftp = new Client()
await sftp.connect(serverConfig)

View file

@ -45,7 +45,7 @@ export function cp(source, destination) {
})
}
function pathToArray(filePath) {
export function pathToArray(filePath) {
// Normalize the file path to handle different OS path separators
const normalizedPath = path.normalize(filePath)
// Split the path into an array of directories