-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support link in code block title (#523)
* feat: support link in code block title * refactor: simplify code block filename link implementation * docs: update syntax-highlighting.md * chore: rename `filename_uri_base` to `base_url` [skip ci] * refactor: use `base_url` int code block implementation --------- Co-authored-by: Xin <[email protected]>
- Loading branch information
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
{{- $class := .Attributes.class | default "" -}} | ||
{{- $filename := .Attributes.filename | default "" -}} | ||
{{- $base_url := .Attributes.base_url | default "" -}} | ||
{{- $lang := .Attributes.lang | default .Type -}} | ||
|
||
|
||
<div class="hextra-code-block hx-relative hx-mt-6 first:hx-mt-0 hx-group/code"> | ||
{{ partial "components/codeblock" (dict "filename" $filename "lang" $lang "content" .Inner "options" .Options) }} | ||
{{- partial "components/codeblock" (dict "filename" $filename "lang" $lang "base_url" $base_url "content" .Inner "options" .Options) -}} | ||
|
||
{{- if or (eq site.Params.highlight.copy.enable nil) (site.Params.highlight.copy.enable) }} | ||
{{- partialCached "components/codeblock-copy-button" (dict "filename" $filename) $filename }} | ||
{{ end }} | ||
{{- if or (eq site.Params.highlight.copy.enable nil) (site.Params.highlight.copy.enable) -}} | ||
{{- partialCached "components/codeblock-copy-button" (dict "filename" $filename) $filename -}} | ||
{{- end -}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters