Compare commits

...

10 Commits

Author SHA1 Message Date
Mark Dumay
a11ee72174 Merge pull request #354 from gethinode/develop
Bump package version
2023-07-22 06:31:01 +02:00
Mark Dumay
8e91440261 Merge branch 'main' into develop 2023-07-22 06:21:36 +02:00
mark
19879c4ecc Bump package version 2023-07-22 06:21:01 +02:00
Mark Dumay
810dfef311 Merge pull request #353 from gethinode/develop
Fix overflow of syntax highlight
2023-07-22 06:19:56 +02:00
Mark Dumay
c42fcefa73 Merge branch 'main' into develop 2023-07-22 06:12:58 +02:00
mark
a3c417e378 Fix overflow of syntax highlight 2023-07-22 06:10:11 +02:00
Mark Dumay
2bee381906 Merge pull request #352 from gethinode/develop
Enable filename-only in file and docs shortcode
2023-07-21 16:15:34 +02:00
Mark Dumay
244a3f7496 Merge branch 'main' into develop 2023-07-21 16:08:16 +02:00
mark
563b526cea Bump package release 2023-07-21 16:07:09 +02:00
mark
fa7fad67b5 Add full arg to shortcode 2023-07-21 16:06:32 +02:00
5 changed files with 25 additions and 6 deletions

View File

@@ -10,6 +10,7 @@
.syntax-highlight { .syntax-highlight {
background-color: var(--bs-light) if($enable-important-utilities, !important, null); background-color: var(--bs-light) if($enable-important-utilities, !important, null);
overflow-x: auto;
} }
.preview-background { .preview-background {
@@ -29,6 +30,7 @@
.syntax-highlight { .syntax-highlight {
background-color: var(--bs-tertiary-bg) if($enable-important-utilities, !important, null); background-color: var(--bs-tertiary-bg) if($enable-important-utilities, !important, null);
overflow-x: auto;
} }
.bg, .bg,

View File

@@ -44,6 +44,14 @@
{{ errorf "Invalid value for param 'show': %s" $showParam -}} {{ errorf "Invalid value for param 'show': %s" $showParam -}}
{{ end -}} {{ end -}}
{{ $fullParam := "true" -}}
{{ $full := true -}}
{{ with .Get "full" }}{{ $fullParam = . }}{{ end -}}
{{ if in $supportedFlags $fullParam -}}
{{ if eq $fullParam "true" }}{{ $full = true }}{{ else }}{{ $full = false }}{{ end -}}
{{ else -}}
{{ errorf "Invalid value for param 'full': %s" $fullParam -}}
{{ end -}}
{{- /* If any parameters are missing, print an error and exit */ -}} {{- /* If any parameters are missing, print an error and exit */ -}}
{{- if or (not $name) (not $file) -}} {{- if or (not $name) (not $file) -}}
@@ -72,7 +80,7 @@
data-bs-target=".multi-{{ $id }}" data-bs-target=".multi-{{ $id }}"
aria-expanded="false" aria-expanded="false"
aria-controls="body-{{ $id }} footer-{{ $id }}"> aria-controls="body-{{ $id }} footer-{{ $id }}">
<small>{{ strings.TrimPrefix $basePath $file }}</small> <small>{{ if $full }}{{ strings.TrimPrefix $basePath $file }}{{ else }}{{ path.Base $file }}{{ end }}</small>
</a> </a>
</li> </li>
</ul> </ul>

View File

@@ -1,7 +1,7 @@
{{- /* {{- /*
Source: https://github.com/twbs/bootstrap/blob/main/site/layouts/shortcodes/scss-docs.html Source: https://github.com/twbs/bootstrap/blob/main/site/layouts/shortcodes/scss-docs.html
Usage: `file path="path/to/filename" lang="lang" show="true"` Usage: `file path="path/to/filename" lang="lang" show="true" full="true"`
Prints the full content of any given file supported by the Chroma syntax highlighter. Prints the full content of any given file supported by the Chroma syntax highlighter.
*/ -}} */ -}}
@@ -28,6 +28,15 @@
{{ errorf "Invalid value for param 'show': %s" $showParam -}} {{ errorf "Invalid value for param 'show': %s" $showParam -}}
{{ end -}} {{ end -}}
{{ $fullParam := "true" -}}
{{ $full := true -}}
{{ with .Get "full" }}{{ $fullParam = . }}{{ end -}}
{{ if in $supportedFlags $fullParam -}}
{{ if eq $fullParam "true" }}{{ $full = true }}{{ else }}{{ $full = false }}{{ end -}}
{{ else -}}
{{ errorf "Invalid value for param 'full': %s" $fullParam -}}
{{ end -}}
{{- /* If any parameters are missing, print an error and exit */ -}} {{- /* If any parameters are missing, print an error and exit */ -}}
{{- if not $file -}} {{- if not $file -}}
{{- errorf "%s: %q: Missing required parameters! Got: path=%q!" .Position .Name $file -}} {{- errorf "%s: %q: Missing required parameters! Got: path=%q!" .Position .Name $file -}}
@@ -46,7 +55,7 @@
data-bs-target=".multi-{{ $id }}" data-bs-target=".multi-{{ $id }}"
aria-expanded="false" aria-expanded="false"
aria-controls="body-{{ $id }} footer-{{ $id }}"> aria-controls="body-{{ $id }} footer-{{ $id }}">
<small>{{ strings.TrimPrefix $basePath $file }}</small> <small>{{ if $full }}{{ strings.TrimPrefix $basePath $file }}{{ else }}{{ path.Base $file }}{{ end }}</small>
</a> </a>
</li> </li>
</ul> </ul>

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.16.0", "version": "0.16.2",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.16.0", "version": "0.16.2",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@fortawesome/fontawesome-free": "^6.4.0", "@fortawesome/fontawesome-free": "^6.4.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.16.0", "version": "0.16.2",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator", "description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [ "keywords": [
"hugo", "hugo",