init: first commit

This commit is contained in:
2024-05-19 20:16:31 +00:00
parent a931d2096d
commit 9ceea7cbbe
7 changed files with 292 additions and 1 deletions

View File

@@ -0,0 +1,55 @@
baseURL = "http://localhost/"
title = "Shell"
ignoreErrors = ["error-remote-getjson"]
[module]
[[module.imports]]
path = 'github.com/yukuro/hugo-theme-shell'
[params]
description = "morthimer's Portfolio"
[params.Terminal]
schema = "gruvbox_dark"
userName = "guest"
pcName = "morthimer.fr"
workDir = "www"
profile = "profile.txt"
ps1Delay = 20
stdoutDelay = 20
commandDelay = 40
titleDelay = 0
contentDelay = 0
description = """
Greetings!
I'm morthimer.
Skills:
- Docker, Kubernetes
- Python, Bash, Go
- Ansible, Terraform
- GitLab CI, GitHub Actions, ArgoCD
- Prometheus, Loki, Grafana
"""
[params.Tree]
use = true
folderName = "links"
files = [
["Git", "https://git.morthimer.fr"],
["Wiki", "https://wiki.morthimer.fr"],
]
[params.Tree2]
use = true
folderName = "bookmarks"
files = [
["IT Roadmaps", "https://roadmap.sh/"],
["DevOps Training", "https://github.com/bregman-arie/devops-exercises"],
["Awesome Content","https://github.com/sindresorhus/awesome"],
["server-world.info","https://www.server-world.info/en/"],
["The Brutalist Report", "https://brutalist.report/" ],
]

View File

@@ -0,0 +1,78 @@
{{ define "main" }}
{{ $env := printf "<strong><span id='user'>%s@%s</span><span id='terminal'>:</span><span id='dir'>~/%s</span></strong><span id='terminal'>$</span>" .Site.Params.Terminal.userName .Site.Params.Terminal.pcName "" | safeHTML }}
{{ $envWithDir := printf "<strong><span id='user'>%s@%s</span><span id='terminal'>:</span><span id='dir'>~/%s</span></strong><span id='terminal'>$</span>" .Site.Params.Terminal.userName .Site.Params.Terminal.pcName .Site.Params.Terminal.workDir | safeHTML }}
{{ $cd := printf "<span id='terminal'>cd %s</span>" .Site.Params.Terminal.workDir | safeHTML }}
{{ $cat := printf "<span id=terminal>cat %s</span>" .Site.Params.Terminal.profile | safeHTML }}
{{ $description := "" }}
{{ if eq (substr .Site.Params.Terminal.description -3 3) ".md" }}
{{ $s := "" }}
{{ with .Site.GetPage .Site.Params.Terminal.description }}
<!-- replace the first p tag with a br tag -->
{{ $s = replaceRE "</?p[^>]*>" "" .Content 1 }}
{{ end }}
{{ $description = printf "<span id='terminal'>%s</span>" $s | safeHTML}}
{{ else }}
{{ $limit := sub (len (findRE "\n" .Site.Params.Terminal.description)) 1 }}
{{ $description = printf "<span id='terminal'>%s</span>" .Site.Params.Terminal.description }}
{{ $description = replaceRE "\n" "<br>" $description $limit| safeHTML }}
{{ end }}
{{ $tree := "" }}
{{ $leaf := "" }}
{{ if .Site.Params.Tree.use }}
{{ $tree = printf "<span id='terminal'>tree ./%s/</span>" .Site.Params.Tree.folderName | safeHTML}}
{{ $leaf = printf "%s<strong><span id='dir'>./%s/</span></strong><br>" $leaf .Site.Params.Tree.folderName | safeHTML}}
{{ range $index, $val := .Site.Params.Tree.files }}
{{ $ac := index $val 0}}
{{ $link := index $val 1}}
<!-- pass link (i.e. http, https) and mailto -->
{{ $l := $.Site.GetPage $link }}
{{ if $l }}
{{ $link = $l.Permalink}}
{{ end }}
{{ if eq (add $index 1) (len $.Site.Params.Tree.files) }}
{{ $leaf = printf "<span id='terminal'>%s└── <a href='%s'>%s</a></span>" $leaf $link $ac | safeHTML}}
{{ else }}
{{ $leaf = printf "<span id='terminal'>%s├── <a href='%s'>%s</a></span><br>" $leaf $link $ac | safeHTML}}
{{ end }}
{{ end }}
{{ end }}
{{ $tree2 := "" }}
{{ $leaf2 := "" }}
{{ if .Site.Params.Tree2.use }}
{{ $tree2 = printf "<span id='terminal'>tree ./%s/</span>" .Site.Params.Tree2.folderName | safeHTML}}
{{ $leaf2 = printf "%s<strong><span id='dir'>./%s/</span></strong><br>" $leaf2 .Site.Params.Tree2.folderName | safeHTML}}
{{ range $index, $val := .Site.Params.Tree2.files }}
{{ $ac := index $val 0}}
{{ $link := index $val 1}}
<!-- pass link (i.e. http, https) and mailto -->
{{ $l := $.Site.GetPage $link }}
{{ if $l }}
{{ $link = $l.Permalink}}
{{ end }}
{{ if eq (add $index 1) (len $.Site.Params.Tree2.files) }}
{{ $leaf2 = printf "<span id='terminal'>%s└── <a href='%s'>%s</a></span>" $leaf2 $link $ac | safeHTML}}
{{ else }}
{{ $leaf2 = printf "<span id='terminal'>%s├── <a href='%s'>%s</a></span><br>" $leaf2 $link $ac | safeHTML}}
{{ end }}
{{ end }}
{{ end }}
{{ $end := $env }}
{{ $payload := delimit (slice $cd $cat $description $tree $leaf $end) "" }}
{{ $ps1Delay := $.Site.Params.Terminal.ps1Delay }}
{{ $stdoutDelay := $.Site.Params.Terminal.stdoutDelay }}
{{ $commandDelay := $.Site.Params.Terminal.commandDelay }}
{{ partial "partials/typeIndex.html" (dict "context" . "env" $env "cd" $cd "envWithDir" $envWithDir "cat" $cat "description" $description "tree" $tree "leaf" $leaf "tree2" $tree2 "leaf2" $leaf2 "ps1delay" $ps1Delay "stdoutdelay" $stdoutDelay "commanddelay" $commandDelay ) }}
{{ end }}

View File

@@ -0,0 +1,70 @@
<span id="ps1_01"></span> <span id="cd"></span> <br>
<span id="ps1_02"></span> <span id="cat"></span> <br>
<span id="std_out_01"></span> <br>
<span id="ps1_03"></span> <span id="tree"></span> <br>
<span id="std_out_02"></span> <br>
<span id="ps1_04"></span> <span id="tree2"></span> <br>
<span id="std_out_03"></span> <br>
<span id="ps1_05"></span>
<script type="text/javascript">
async function typewriter(text, elementId, waitAfter) {
var n = 0,
isTag = false
addText = "";
const el = document.getElementById(elementId);
const wait = () => new Promise(r => setTimeout(r, waitAfter));
const nowait = () => new Promise(r => r());
const render = () => el.innerHTML = (text.slice(0, n + 1) + addText);
const cursor = document.createElement('span');
cursor.id = "blink";
el.style.setProperty("--cursor-visibility", "visible");
while (n < text.length) {
if (text.charAt(n + 1) === "<") isTag = true;
if (text.charAt(n + 1) === ">") isTag = false;
if (isTag) {
n++;
continue;
}
requestAnimationFrame(render);
if (waitAfter === 0) {
await nowait();
} else {
await wait();
}
n++;
}
el.style.setProperty("--cursor-visibility", "collapse");
}
function parseDelay(d) {
const parsed = parseInt(d, 10);
if (isNaN(parsed)) return 0;
return parsed;
}
const ps1Delay = parseDelay("{{ .ps1delay }}"),
stdoutDelay = parseDelay("{{ .stdoutdelay }}"),
commandDelay = parseDelay("{{ .commanddelay }}");
const typeeffetct = async () => {
await typewriter("{{ .env }}", "ps1_01", ps1Delay); await typewriter("{{ .cd }}", "cd", commandDelay);
await typewriter("{{ .envWithDir }}", "ps1_02", ps1Delay); await typewriter("{{ .cat }}", "cat", commandDelay);
await typewriter("{{ .description }}", "std_out_01", stdoutDelay);
await typewriter("{{ .envWithDir }}", "ps1_03", ps1Delay); await typewriter("{{ .tree }}", "tree", commandDelay);
await typewriter("{{ .leaf }}", "std_out_02", stdoutDelay);
await typewriter("{{ .envWithDir }}", "ps1_04", ps1Delay); await typewriter("{{ .tree2 }}", "tree2", commandDelay);
await typewriter("{{ .leaf2 }}", "std_out_03", stdoutDelay);
await typewriter("{{ .envWithDir }}", "ps1_05", ps1Delay);
return;
}
typeeffetct()
</script>