Skip to content

Commit

Permalink
2023-10-28 23:16:28
Browse files Browse the repository at this point in the history
  • Loading branch information
uidHUB committed Oct 28, 2023
1 parent 2c779b2 commit a9d6c0d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
30 changes: 19 additions & 11 deletions assets/css/system/module/_shortcodes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ body {
border-radius: unset;

code {
&:after {
.line:last-child:after {
content: ' _';
opacity: 0;
animation: cursor 1s infinite;
Expand Down Expand Up @@ -82,33 +82,41 @@ body {

&-linux {
pre {
code:before {
content: 'user@host ~ % ';
code {
.line:first-child:before {
content: 'user@host ~ % ';
}
}
}

&-root {
pre {
code:before {
content: 'root@host ~ # ';
color: var(--bs-danger);
code {
.line:first-child:before {
content: 'root@host ~ # ';
color: var(--bs-danger);
}
}
}
}
}

&-windows {
pre {
code:before {
content: 'C:\\Users\\User> ';
code {
.line:first-child:before {
content: 'C:\\Users\\User> ';
}
}
}

&-root {
pre {
code:before {
content: 'C:\\Users\\Admin> ';
color: var(--bs-danger);
code {
.line:first-child:before {
content: 'C:\\Users\\Admin> ';
color: var(--bs-danger);
}
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion layouts/_default/_markup/render-codeblock-terminal.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ <h5 class="mb-0">{{ (i18n "terminal") }}</h5>
</div>
</div>
</div>
<div class="card-body p-0" id="{{ ($cp) }}">{{ (highlight (($inner) | chomp) ($type)) }}</div>
{{ $lang := "" }}
{{ if (eq ($attr.hl) "false") }}
{{ $lang = "plaintext" }}
{{ else }}
{{ if (eq ($attr.os) "windows") }}{{ $lang = "powershell" }}{{ end }}
{{ if (eq ($attr.os) "linux") }}{{ $lang = "bash" }}{{ end }}
{{ end }}
<div class="card-body p-0" id="{{ ($cp) }}">{{ (highlight (($inner) | chomp) ($lang)) }}</div>
</div>
</div>

0 comments on commit a9d6c0d

Please sign in to comment.