downsync fix

This commit is contained in:
octospacc 2024-09-01 12:10:37 +02:00
parent a86c3f198c
commit bbd2a18091
16 changed files with 65 additions and 72 deletions

View File

@ -10,6 +10,8 @@ const PostsFileDate = true; // Append dates (YYYY-MM-DD) to posts file names
const FrontmatterNew = {
createdon: "Date",
updatedon: "Lastmod",
editedon: "Lastmod",
image: "Featured_Image",
categories: [],
urls: ["Aliases"],
htmltitle: false,
@ -20,7 +22,6 @@ let Replacements = { // Format: { ReplaceWithString: [ToFindString] }
'"><a class="footnote-ref" href="#fn': '"><a href="#fn',
" href=\"{{< assetsRoot >}}/": " href=\"https://sitoctt-assets.octt.eu.org/",
" src=\"{{< assetsRoot >}}/": " src=\"https://sitoctt-assets.octt.eu.org/",
'<div class="highlight CodeScroll">': '<div class="highlight">',
// TODO: Fix anchor rels
};
const TestURL = 'https://listed.to/p/hDaMhJ2ts7';
@ -97,14 +98,31 @@ const MakeMetaStr = Post => {
//Str += `// ${Marks[Type]} ${Key} = ${Post[Type][Key]}\n`;
// TODO: should this handle bools properly?
let Value = Post[Type][Key];
const KeyNew = FrontmatterNew[Key.toLowerCase()];
let KeyNew = FrontmatterNew[Key.toLowerCase()];
let ToJson = true;
if (KeyNew === false) {
return;
} else if (KeyNew === Array) {
KeyNew = null;
Value = `[ "${Value.split(' ').join('", "')}" ]`;
} else if (Array.isArray(KeyNew)) {
KeyNew = KeyNew[0];
Value = Value.split(' ');
//Value = `[ "${Value.split(' ').join('", "')}" ]`;
//ToJson = false;
}
Str += `${KeyNew || Key} = ${isNaN(Value.replaceAll('-', '')) ? JSON.stringify(Value) : Value}\n`;
KeyNew ||= Key;
switch (KeyNew.toLowerCase()) {
default:
break; case 'featured_image':
Value = Value.replace('[staticoso:CustomPath:Assets]', '@').replace('https://sitoctt-assets.octt.eu.org', '@');
break; case 'categories':
if (Post[Type].Downsync.toLowerCase().split('/').includes(Value[0].toLowerCase())) {
Value = Value.slice(1);
}
}
if (Array.isArray(Value)) {
Value = '[ ' + Value.map(item => JSON.stringify(item)).join(', ') + ' ]';
ToJson = false;
}
Str += `${KeyNew} = ${isNaN(Value.replaceAll('-', '')) && ToJson ? JSON.stringify(Value) : Value}\n`;
});
});
return `+++\n${Str}+++\n`; //Str;

View File

@ -1,6 +1,7 @@
{
"devDependencies": {
"axios": "^1.4.0",
"jsdom": "^22.0.0"
"jsdom": "^22.0.0",
"turndown": "^7.2.0"
}
}

View File

@ -1,11 +1,9 @@
+++
Title = "⚡️ Il blogging rapido con Standard Notes"
Description = "Volendo scrivere e pubblicare di più, mi accorgo che il mio workflow mi rallentava, e nel cercare modi di blogging più rapidi, ripenso a Listed."
Downsync = "/it/posts/Blogging-Rapido-con-Standard-Notes.html"
Aliases = [
"/Posts/2022-12-13-Blogging-Rapido-con-Standard-Notes.html",
]
Date = 2022-12-13
Downsync = "/it/blog/Blogging-Rapido-con-Standard-Notes.html"
Aliases = [ "/Posts/2022-12-13-Blogging-Rapido-con-Standard-Notes.html" ]
Description = "Volendo scrivere e pubblicare di più, mi accorgo che il mio workflow mi rallentava, e nel cercare modi di blogging più rapidi, ripenso a Listed."
Lastmod = 2022-12-16
Categories = [ "Tecnologia" ]
+++

View File

@ -1,10 +1,8 @@
+++
Title = "🎄 Distrazioni di Natale: l'albero Padoru"
Date = 2022-12-17
Downsync = "/it/posts/Distrazioni-di-Natale-Albero-Padoru.html"
Aliases = [
"/Posts/2022-12-17-Distrazioni-di-Natale-Albero-Padoru.html",
]
Downsync = "/it/blog/Distrazioni-di-Natale-Albero-Padoru.html"
Aliases = [ "/Posts/2022-12-17-Distrazioni-di-Natale-Albero-Padoru.html" ]
Description = "Tempo di Natale, di scongelare i Padoru, e metterli sull'albero. Durante questo calmo fai-da-te, però, scopro che ho la memoria corta..."
Featured_Image = "@/Media/Padoru/Padoru-Tree-Old-New-Fragments.webp"
Categories = [ "DIY" ]
@ -25,7 +23,7 @@ Per quelle 3 persone che vivono sotto le pietre <em>(e che non so come potrebber
In una <a href="https://youtu.be/efdN69QscAg" rel="noopener nofollow" target="_blank">scena del gioco</a>, <a href="https://typemoon.fandom.com/it/wiki/Nerone" rel="noopener nofollow" target="_blank">Nerone Claudio Cesare Augusto Germanico (non scherzo)</a> indossa un costume da <strong>Babbo Natale</strong>, e danza in giro per quello che credo sia un corridoio, cantando una <strong>parodia</strong> originale di <em>Jingle Bells</em>, di appena 4 strofe.</p>
<video class="SmallVideoQuote Blockquote NoImgCenter" title="Il video della scena del gioco." src="{{< assetsRoot >}}/Media/Padoru/PadoruPadoru.webm" controls="true" muted="true" loop="true" autoplay="true">Il video della scena del gioco.</video>
<video class="SmallVideoQuote Blockquote NoImgCenter" title="Il video della scena del gioco." src="{{< assetsRoot >}}/Media/Padoru/PadoruPadoru.webm" [:videoelemargs-controlmuteloopauto:]="">Il video della scena del gioco.</video>
<blockquote>
<p>HASHIRE SORI YO<br>

View File

@ -1,11 +1,9 @@
+++
Title = "🐕‍🦺 Epicyon, piattaforma del Fediverso durata 2 giorni"
Description = "Ho provato una certa piattaforma del Fediverso. Belle promesse di semplicità e leggerezza, ma dopo soli 3 giorni ho dovuto togliere baracca!"
Date = 2022-12-26
Downsync = "/it/posts/Epicyon-Piattaforma-del-Fediverso-Durata-2-Giorni.html"
Aliases = [
"/Posts/2022-12-26-Epicyon-Piattaforma-del-Fediverso-Durata-2-Giorni.html",
]
Downsync = "/it/blog/Epicyon-Piattaforma-del-Fediverso-Durata-2-Giorni.html"
Aliases = [ "/Posts/2022-12-26-Epicyon-Piattaforma-del-Fediverso-Durata-2-Giorni.html" ]
Description = "Ho provato una certa piattaforma del Fediverso. Belle promesse di semplicità e leggerezza, ma dopo soli 3 giorni ho dovuto togliere baracca!"
Featured_Image = "@/Media/Epicyon-Dec-2022/Featured-LCD.png"
Categories = [ "Internet" ]
+++

View File

@ -1,10 +1,8 @@
+++
Title = "🤯 Quando i problemi hardware diventano mentali (maledetto Raspino)"
Date = 2023-01-28
Downsync = "/it/posts/Problemi-Hardware-Diventano-Mentali.html"
Aliases = [
"/Posts/2023-01-28-Problemi-Hardware-Diventano-Mentali.html",
]
Downsync = "/it/blog/Problemi-Hardware-Diventano-Mentali.html"
Aliases = [ "/Posts/2023-01-28-Problemi-Hardware-Diventano-Mentali.html" ]
Description = "Servizi che crollano decretando la fine del mio Regno Del Terrore, le giornate perse a dir mannaggia al Rasperino, e 2 mesi di peripezie..."
Categories = [ "Sysadmin", "Rasperino" ]
+++
@ -41,7 +39,7 @@ Circa nello stesso momento (il fato ha deciso che l'aiuto dovesse arrivare tardi
<style>
.highlight.plaintext:first-of-type { max-height: 80vh; }
</style>
<div class="highlight CodeScroll"><pre class="highlight plaintext"><code>Dec 27 06:32:35 kernel: [27230.964650] INFO: task kworker/2:0:21874 blocked for more than 860 seconds.
<div class="highlight"><pre class="highlight plaintext"><code>Dec 27 06:32:35 kernel: [27230.964650] INFO: task kworker/2:0:21874 blocked for more than 860 seconds.
Dec 27 06:32:35 kernel: [27230.964693] Tainted: G C 5.15.76-v7+ #1597
Dec 27 06:32:35 kernel: [27230.964709] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Dec 27 06:32:35 kernel: [27230.964723] task:kworker/2:0 state:D stack: 0 pid:21874 ppid: 2 flags:0x00000000

View File

@ -1,10 +1,8 @@
+++
Title = "🔋 Tutto per non cambiare due pile..."
Date = 2023-04-03
Downsync = "/it/posts/Tutto-Per-Non-Cambiare-Due-Pile.html"
Aliases = [
"/Posts/2023-04-03-Tutto-Per-Non-Cambiare-Due-Pile.html",
]
Downsync = "/it/blog/Tutto-Per-Non-Cambiare-Due-Pile.html"
Aliases = [ "/Posts/2023-04-03-Tutto-Per-Non-Cambiare-Due-Pile.html" ]
Description = "Mi secco a cambiare le batterie del telecomando della TV che ho sulla scrivania, quindi ovvio realizzando un accrocco con graffette e cartone..."
Categories = [ "DIY" ]
+++

View File

@ -1,13 +1,11 @@
+++
Title = "🏴‍☠️ Che impatto avrà la nuova legge anti-pirateria italiana?"
Date = 2023-04-16
Lastmod = 2023-04-17
Downsync = "/it/posts/Che-Impatto-Nuova-Legge-Anti-Pirateria-Italiana.html"
Aliases = [
"/Posts/2023-04-16-Che-Impatto-Nuova-Legge-Anti-Pirateria-Italiana.html",
]
Downsync = "/it/blog/Che-Impatto-Nuova-Legge-Anti-Pirateria-Italiana.html"
Aliases = [ "/Posts/2023-04-16-Che-Impatto-Nuova-Legge-Anti-Pirateria-Italiana.html" ]
Description = "Hanno approvato in Italia una legge per un contrasto forte alla pirateria. Il fatto è che comporta rischi importanti per gli internauti."
Categories = [ "Internet" ]
Lastmod = 2023-04-17
+++
<!-- Autogenerated by ListedDownsync.js. Do not edit (unless also set "% Downsync = False") - it would be overwritten. -->

View File

@ -1,12 +1,11 @@
+++
Title = "😭 Più che un esame, ho fatto una guerra."
Date = 2023-05-02
Lastmod = 2023-05-03
Downsync = "/it/posts/Piu-Che-un-Esame-Ho-Fatto-una-Guerra.html"
Aliases = [
"/Posts/2023-05-02-Piu-Che-un-Esame-Ho-Fatto-una-Guerra.html",
]
Downsync = "/it/blog/Piu-Che-un-Esame-Ho-Fatto-una-Guerra.html"
Aliases = [ "/Posts/2023-05-02-Piu-Che-un-Esame-Ho-Fatto-una-Guerra.html" ]
Description = "Per colpa di gente che non sa leggere delle regole, mi sono venuti i demoni in capa mentre svolgevo un esame che doveva essere facilissimo."
Categories = [ ]
Lastmod = 2023-05-03
+++
<!-- Autogenerated by ListedDownsync.js. Do not edit (unless also set "% Downsync = False") - it would be overwritten. -->

View File

@ -1,10 +1,8 @@
+++
Title = "☣️ Le brutture irrisolvibili della dock di Nintendo Switch (Parte I)"
Date = 2023-06-30
Downsync = "/it/posts/Brutture-Irrisolvibili-della-Dock-Nintendo-Switch.html"
Aliases = [
"/Posts/2023-06-30-Brutture-Irrisolvibili-della-Dock-Nintendo-Switch.html",
]
Downsync = "/it/blog/Brutture-Irrisolvibili-della-Dock-Nintendo-Switch.html"
Aliases = [ "/Posts/2023-06-30-Brutture-Irrisolvibili-della-Dock-Nintendo-Switch.html" ]
Featured_Image = "@/Media/Switch-Dock/Dock-Binned-Unsharp.webp"
Description = "Possibile trovare così tanti difetti in un solo accessorio? Nintendo, da anni, con il dock del suo Switch ci dimostra di si!"
Categories = [ "Tecnologia", "Gaming" ]

View File

@ -1,12 +1,11 @@
+++
Title = "🏖️ Recensione: Pipì nel Mare (Mar Tirreno)"
Date = 2023-08-11
Downsync = "/it/posts/Recensione-Pipi-Nel-Mar-Tirreno.html"
Aliases = [
"/Posts/2023-08-11-Recensione-Pipi-Nel-Mar-Tirreno.html",
]
Downsync = "/it/blog/Recensione-Pipi-Nel-Mar-Tirreno.html"
Aliases = [ "/Posts/2023-08-11-Recensione-Pipi-Nel-Mar-Tirreno.html" ]
Featured_Image = "@/Media/Misc/craiyon_211338_anime_girl_in_the_ocean_looking_at_the_sunset__half_body_rem.webp"
Description = "Un'azione di solito considerata come priva di rilevanza, in un attimo speciale può scoprirsi magica e impossibile da tenere per sé: tocca scrivere una recensione."
Categories = [ ]
+++
<!-- Autogenerated by ListedDownsync.js. Do not edit (unless also set "% Downsync = False") - it would be overwritten. -->

View File

@ -1,11 +1,9 @@
+++
Title = "📎 Mollette per capelli, ridotte a colla e sassolini"
Date = 2023-09-15
Downsync = "/it/posts/Mollette-per-Capelli-Colla-e-Sassolini.html"
Aliases = [
"/Posts/2023-09-15-Mollette-per-Capelli-Colla-e-Sassolini.html",
]
Image = "@/Media/Decor/craiyon_182944_small_hair_clip_decorated_with_glitter__worn_on_head__profile_closeup_smiling__anime.webp"
Downsync = "/it/blog/Mollette-per-Capelli-Colla-e-Sassolini.html"
Aliases = [ "/Posts/2023-09-15-Mollette-per-Capelli-Colla-e-Sassolini.html" ]
Featured_Image = "@/Media/Decor/craiyon_182944_small_hair_clip_decorated_with_glitter__worn_on_head__profile_closeup_smiling__anime.webp"
Description = "Non tutte le mie creazioni DIY sono orripilanti. Stavolta, per fare un regalo sia a me che non, abbellisco delle mollette per capelli, nel primo modo che mi viene a mente."
Categories = [ "DIY" ]
+++

View File

@ -1,10 +1,9 @@
+++
Title = "🎇 Il resocontoctt di questo 2023, almeno in termini di posting!"
Date = 2023-12-31
Downsync = "/it/posts/Resocontoctt-2023.html"
Aliases = [
"/Posts/2023-12-31-Resocontoctt-2023.html",
]
Downsync = "/it/blog/Resocontoctt-2023.html"
Aliases = [ "/Posts/2023-12-31-Resocontoctt-2023.html" ]
Categories = [ ]
+++
<!-- Autogenerated by ListedDownsync.js. Do not edit (unless also set "% Downsync = False") - it would be overwritten. -->

View File

@ -1,10 +1,8 @@
+++
Title = "🚀 LIBERTY WINGS: un Breve RPG sulla Libertà (Recensione)"
Date = 2024-04-07
Downsync = "/it/posts/LIBERTY-WINGS-Breve-RPG-Liberta-Recensione.html"
Aliases = [
"/Posts/2024-04-07-LIBERTY-WINGS-Breve-RPG-Liberta-Recensione.html",
]
Downsync = "/it/blog/LIBERTY-WINGS-Breve-RPG-Liberta-Recensione.html"
Aliases = [ "/Posts/2024-04-07-LIBERTY-WINGS-Breve-RPG-Liberta-Recensione.html" ]
Featured_Image = "@/Media/Games/LIBERTY-WINGS/COVER-ART.jpg"
Description = "Riguardo un breve gioco sulla libertà, ambientato in un futuro non troppo lontano, in cui l'umanità è schiava del regime di un'azienda."
Categories = [ "Gaming", "Recensioni" ]

View File

@ -1,10 +1,8 @@
+++
Title = "📓️ Sul passaggio dai diari ai blog ai social, una riflessione"
Date = 2024-06-22
Downsync = "/it/posts/Diari-Blog-Social-Riflessione.html"
Aliases = [
"/Posts/2024-06-22-Diari-Blog-Social-Riflessione.html",
]
Downsync = "/it/blog/Diari-Blog-Social-Riflessione.html"
Aliases = [ "/Posts/2024-06-22-Diari-Blog-Social-Riflessione.html" ]
Description = "Partendo dalla proposta C2 dell'Esame di Stato 2024, racconto la mia storia e le criticità con le modernissime forme di diario personale."
Featured_Image = "@/Media/Decor/dall-e_ca32679b-2878-4fb1-a031-f28a3865058d.jpeg"
Categories = [ "Internet" ]

View File

@ -1,17 +1,14 @@
+++
Title = "2⃣ Gaming sincronizzato tra PlayStation 2 e smartphone"
Date = 2023-10-17
Lastmod = 2023-10-18
Downsync = "/it/posts/Notes/Gaming-Sincronizzato-PS2-Smartphone.html"
Aliases = [
"/Posts/Notes/2023-10-17-Gaming-Sincronizzato-PS2-Smartphone.html",
]
Downsync = "/it/note/Gaming-Sincronizzato-PS2-Smartphone.html"
Aliases = [ "/Posts/Notes/2023-10-17-Gaming-Sincronizzato-PS2-Smartphone.html" ]
Description = "Per filo e per segno, come ho ideato un sistema per avere giochi e salvataggi sempre sincronizzati tra emulatore e console PS2 reale, condiviso qui."
Categories = [ "Gaming" ]
Lastmod = 2023-10-18
+++
<!-- Autogenerated by ListedDownsync.js. Do not edit (unless also set "% Downsync = False") - it would be overwritten. -->
<h1><span class="twa twa-2⃣"><span>2</span></span> Gaming sincronizzato tra PlayStation 2 e smartphone</h1>
<p>Chi segue le mie avventure da abbastanza tempo e con dovuta attenzione forse lo sa, ma il più grande problema dell'informatica è: come conciliare bene le discrepanze che si vengono a creare quando ci si pone il problema di videogiocare sia a casa che in portatilità? Tra giochi che in un caso sono comodi da giocare e in un altro magari nemmeno girano, e i salvataggi che si spargono per innumerevoli dispositivi diversi, risolvere questo problema in toto non sarà mai possibile...<br>
Eppure, certe volte, l'entropia del cervello è in grado di generare idee particolarmente utili anche a questo proposito, come mi è successo l'altro giorno per la PS2.</p>