mirror of
https://github.com/supleed2/supleed2-old-landing-page.git
synced 2024-12-22 14:15:49 +00:00
Create custom index page and add social.lol link
Links now have rel="noopener noreferrer me", a title set to the link text and open in a new tab
This commit is contained in:
parent
8c8d9b2f71
commit
8771efa29e
|
@ -30,6 +30,8 @@ params: # Customise Guide: https://github.com/Yukuro/hugo-theme-shell/blob/maste
|
|||
- "https://8bit.omg.lol/"
|
||||
- - My /now Page
|
||||
- "https://8bit.omg.lol/now/"
|
||||
- - Mastodon (social.lol)
|
||||
- "https://social.lol/@8bit/"
|
||||
- - LinkedIn
|
||||
- "https://www.linkedin.com/in/aadidesai/"
|
||||
- - Peerlist
|
||||
|
|
55
layouts/index.html
Normal file
55
layouts/index.html
Normal file
|
@ -0,0 +1,55 @@
|
|||
{{ 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' target='_blank' rel='noopener noreferrer me' title='%s'>%s</a></span>" $leaf $link $ac $ac | safeHTML}}
|
||||
{{ else }}
|
||||
{{ $leaf = printf "<span id='terminal'>%s├── <a href='%s' target='_blank' rel='noopener noreferrer me' title='%s'>%s</a></span><br>" $leaf $link $ac $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 "ps1delay" $ps1Delay "stdoutdelay" $stdoutDelay "commanddelay" $commandDelay ) }}
|
||||
|
||||
{{ end }}
|
Loading…
Reference in a new issue