diff --git a/Scripts/Translate/Main.py b/Scripts/Translate/Main.py index c3dcf18..e466fac 100755 --- a/Scripts/Translate/Main.py +++ b/Scripts/Translate/Main.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 ModificationMetadataKey = "lastmod" -KeepOriginalMetadata = ["draft", "date", "lastmod"] +KeepOriginalMetadata = ["draft", "date", "lastmod", "slug"] DestinationLanguages = ["it", "en", "es", "fr"] # "de", "eo" IncludePaths = ["/"] -ExcludePaths = ["/miscellanea/Devlogs.md", "/admin.md"] # "/miscellanea/PicoBlog.md" +ExcludePaths = ["/miscellanea/Devlogs.md", "/miscellanea/Percent-Encoding.md", "/admin.md"] # "/miscellanea/PicoBlog.md" TranslationFixes = { "{{}}_/": "{{< assetsRoot>}}/", "{{< assetsRoot >}}_/": "{{< assetsRoot >}}/", @@ -108,6 +108,7 @@ def number_to_ascii(number:int) -> str: # TODO handle .notranslate HTML elements # TODO fix strange bugs, including bug of autoinserted trailing underscores '_', and HTML closing tags breaking def wrap_for_translation(original_text): + external_tokens = [] original_text = (original_text .replace("{{%", "{{@%").replace("%}}", "%@}}") # Hugo shortcodes .replace("{{<", "{{@<").replace(">}}", ">@}}") @@ -116,15 +117,18 @@ def wrap_for_translation(original_text): original_tokens = original_text.split("{{@") for i in range(1, len(original_tokens)): token_tokens = original_tokens[i].split("@}}") + external_tokens.append("{{@" + token_tokens[0] + "@}}") token_tokens[0] = (f"{TranslationMagic}__" + str(ascii_to_number("{{@" + token_tokens[0] + "@}}")).replace("1", "1_").replace("9", "9_") + "__") original_tokens[i] = ''.join(token_tokens) - return ''.join(original_tokens) + return (''.join(original_tokens), external_tokens) -def unwrap_from_translation(translated_text): +def unwrap_from_translation(translated_text, external_tokens): translated_tokens = translated_text.split(f"{TranslationMagic}__") for i in range(1, len(translated_tokens)): token_tokens = translated_tokens[i].split("__") - token_tokens[0] = number_to_ascii(token_tokens[0].replace(' ', '').replace('_', '')) + token_tokens[0] = external_tokens.pop(0) #number_to_ascii(token_tokens[0].replace(' ', '').replace('_', '')) + if (token_tokens[1].startswith('_')): + token_tokens[1] = token_tokens[1][1:] # Extra underscore insertion workaround translated_tokens[i] = (token_tokens[0] + "__".join(token_tokens[1:])) return (''.join(translated_tokens) .replace("{{@%", "{{%").replace("%@}}", "%}}") # Hugo shortcodes @@ -139,7 +143,7 @@ def translate_document(document_path, documents): printf(f"* {document_path} ->") for destination_language in documents[document_path]: source_language = get_source_language(document_path) - original_text = wrap_for_translation(read_original_document(document_path)) + original_text, external_tokens = wrap_for_translation(read_original_document(document_path)) printf('', destination_language) try: is_python_translator = True @@ -175,7 +179,7 @@ def translate_document(document_path, documents): translated_text = ''.join(translated_tokens) elif translated_text.strip(): translated_text = (translated_preamble + translated_text) - translated_text = unwrap_from_translation(translated_text) + translated_text = unwrap_from_translation(translated_text, external_tokens) for replacement in TranslationFixes: translated_text = translated_text.replace(replacement, TranslationFixes[replacement]) destination_path = make_destination_path(document_path, destination_language) @@ -198,7 +202,7 @@ def main(): def read_from_scripts(relative_path:str): return open((dirname(realpath(__file__)) + "/../" + relative_path), 'r').read() -TranslationMagic = ("__" + str(ascii_to_number("sitoctt"))) +TranslationMagic = ("__" + str(ascii_to_number("sito.octt"))) if __name__ == "__main__": globals_text = read_from_scripts("Lib/Globals.sh") diff --git a/content/it/projektoj/BloccSpacc.md b/content/it/projektoj/BloccSpacc.md new file mode 100644 index 0000000..84ca709 --- /dev/null +++ b/content/it/projektoj/BloccSpacc.md @@ -0,0 +1,21 @@ ++++ +Title = "BloccSpacc" +Slug = "BloccSpacc" +canonicalUrl = "https://github.com/octospacc/BloccSpacc" ++++ + +{{< embed "https://hlb0.octt.eu.org/Misc/BloccSpacc/" app "width: 540px; height: 560px;" >}} + +Tutte le informazioni e il codice sorgente sono disponibili su Git: + +* https://gitlab.com/octospacc/BloccSpacc +* https://github.com/octospacc/BloccSpacc +* https://gitea.it/octospacc/BloccSpacc + +## LEGGIMI originale + +
+ +{{< GetRemote "https://gitlab.com/octospacc/BloccSpacc/-/raw/main/README.md" markdown >}} + +
diff --git a/content/it/projektoj/MultiSpaccSDK.md b/content/it/projektoj/MultiSpaccSDK.md new file mode 100644 index 0000000..69d230a --- /dev/null +++ b/content/it/projektoj/MultiSpaccSDK.md @@ -0,0 +1,11 @@ ++++ +Title = "MultiSpaccSDK" +Slug = "MultiSpaccSDK" +canonicalUrl = "https://github.com/octospacc/MultiSpaccSDK" ++++ + +Tutte le informazioni e il codice sorgente sono disponibili su Git: + +* https://gitlab.com/octospacc/MultiSpaccSDK +* https://github.com/octospacc/MultiSpaccSDK +* https://gitea.it/octospacc/MultiSpaccSDK diff --git a/content/it/projektoj/Naples-NDS.md b/content/it/projektoj/Naples-NDS.md new file mode 100644 index 0000000..77301df --- /dev/null +++ b/content/it/projektoj/Naples-NDS.md @@ -0,0 +1,11 @@ ++++ +Title = "Naples NDS" +Slug = "Naples-NDS" ++++ + +{{< embed "https://gamingshitposting.github.io/naplesnds/" window >}} + +Tutte le informazioni e il codice sorgente sono disponibili su Git: + +* https://github.com/GamingShitposting/naplesnds +* https://gitea.it/octospacc/naplesnds diff --git a/content/it/projektoj/Offline-Caching.md b/content/it/projektoj/Offline-Caching.md index 4950068..ca31517 100644 --- a/content/it/projektoj/Offline-Caching.md +++ b/content/it/projektoj/Offline-Caching.md @@ -7,3 +7,11 @@ canonicalUrl = "https://addons.mozilla.org/firefox/addon/offline-caching/" Tutte le informazioni e il codice sorgente sono disponibili su: * https://addons.mozilla.org/firefox/addon/offline-caching/ + +## LEGGIMI originale + +
+ +{{< GetRemote "https://addons.mozilla.org/firefox/addon/offline-caching/" html split `
` 1 `
}} + +
diff --git a/content/it/projektoj/Sala-Museo-Games.md b/content/it/projektoj/Sala-Museo-Games.md new file mode 100644 index 0000000..ff712b0 --- /dev/null +++ b/content/it/projektoj/Sala-Museo-Games.md @@ -0,0 +1,11 @@ ++++ +Title = "Sala Museo Games" +Slug = "Sala-Museo-Games" ++++ + +{{< embed "https://gamingshitposting.github.io/SalaMuseoGames/" window >}} + +Tutte le informazioni e il codice sorgente sono disponibili su Git: + +* https://github.com/GamingShitposting/SalaMuseoGames +* https://gitea.it/octospacc/SalaMuseoGames diff --git a/content/it/projektoj/Spacc-BBS.md b/content/it/projektoj/Spacc-BBS.md new file mode 100644 index 0000000..287c0ab --- /dev/null +++ b/content/it/projektoj/Spacc-BBS.md @@ -0,0 +1,6 @@ ++++ +Title = "Spacc BBS" +Slug = "Spacc-BBS" ++++ + +{{< embed "https://bbs.spacc.eu.org/" window >}} diff --git a/content/it/projektoj/SpaccCraft.md b/content/it/projektoj/SpaccCraft.md new file mode 100644 index 0000000..9634a7e --- /dev/null +++ b/content/it/projektoj/SpaccCraft.md @@ -0,0 +1,6 @@ ++++ +Title = "SpaccCraft" +Slug = "SpaccCraft" ++++ + +{{< embed "https://SpaccCraft.altervista.org/" window >}} diff --git a/content/it/projektoj/Spaccogram.md b/content/it/projektoj/Spaccogram.md new file mode 100644 index 0000000..b488174 --- /dev/null +++ b/content/it/projektoj/Spaccogram.md @@ -0,0 +1,14 @@ ++++ +Title = "Spaccogram (Web)" +Slug = "Spaccogram" ++++ + +{{< embed "https://1.tgweb.octt.eu.org/" window >}} + +Tutte le informazioni sono disponibili sul canale Telegram: + +* https://t.me/+ujaob63Vy705Mzgx + +Il codice sorgente è disponibile su Git: + +* https://gitea.it/octospacc/Spaccogram diff --git a/content/it/projektoj/SpiderADB.md b/content/it/projektoj/SpiderADB.md index 0f8272b..46138f3 100644 --- a/content/it/projektoj/SpiderADB.md +++ b/content/it/projektoj/SpiderADB.md @@ -3,4 +3,4 @@ Title = "🕷️ SpiderADB" Slug = "SpiderADB" +++ -{{< embed "https://hub.octt.eu.org/SpiderADB/" app >}} +{{< embed "https://hub.octt.eu.org/SpiderADB/#/about" app >}} diff --git a/content/it/projektoj/WebPinBoard-Bachecoctt.md b/content/it/projektoj/WebPinBoard-Bachecoctt.md new file mode 100644 index 0000000..0822a95 --- /dev/null +++ b/content/it/projektoj/WebPinBoard-Bachecoctt.md @@ -0,0 +1,22 @@ ++++ +Title = "WebPinBoard / Bachecoctt" +Slug = "WebPinBoard-Bachecoctt" +canonicalUrl = "https://github.com/octospacc/WebPinBoard" ++++ + +{{< embed "https://octtspacc.gitlab.io/bachecoctt/" window >}} + +Tutte le informazioni e il codice sorgente sono disponibili su Git: + +* https://gitlab.com/octospacc/WebPinBoard +* https://github.com/octospacc/WebPinBoard +* https://gitea.it/octospacc/WebPinBoard +* https://codeberg.org/octt-mirror/WebPinBoard + +## LEGGIMI originale + +
+ +{{< GetRemote "https://gitlab.com/octospacc/WebPinBoard/-/raw/main/README.md" markdown >}} + +
diff --git a/content/it/projektoj/_index.md b/content/it/projektoj/_index.md index ddc023f..3183291 100644 --- a/content/it/projektoj/_index.md +++ b/content/it/projektoj/_index.md @@ -3,4 +3,4 @@ Title = "Progetti⚒️" Lastmod = 2025-02-15 +++ -Questa sezione raccoglie (quasi) tutti i miei progetti (di cui uno è il sitoctt stesso). Per informazioni aggiuntive, leggi il post di presentazione: https://octospacc.altervista.org/2025/02/14/definitivo-progettocto-di-progettazioctt/ +Questa sezione raccoglie (quasi) tutti i miei progetti (di cui uno è il sitoctt stesso). Per informazioni aggiuntive, leggi il post di presentazione: . diff --git a/hugo.toml b/hugo.toml index fd5da60..22010a8 100644 --- a/hugo.toml +++ b/hugo.toml @@ -6,6 +6,7 @@ title = "✨sitoctt✨" canonifyURLs = true disablePathToLower = true sectionPagesMenu = "main" +summaryLength = 40 defaultContentLanguage = "it" defaultContentLanguageInSubdir = true theme = [ "hugo-notice", "ananke" ] diff --git a/layouts/shortcodes/embed.html b/layouts/shortcodes/embed.html index 2ba842c..25adc1f 100644 --- a/layouts/shortcodes/embed.html +++ b/layouts/shortcodes/embed.html @@ -6,18 +6,18 @@ {{- $type = "embed" -}} {{- end -}} {{- $iswindow := (in (slice "app" "window") $type) -}} -
+
{{- if (eq $type "embed") -}} {{- $link = $href -}} - + {{- else if $iswindow -}}
{{ partial "anchor.html" (dict "Params" (dict "style" "color: rgba(255,255,255,.9); text-decoration: none;" "target" "_blank" "rel" "noopener" "href" $href)) }}
-
- +
+
{{- else if in (slice "youtube" "yt") $type -}} {{- $link = (printf "https://youtu.be/%s" $href) -}}