mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-01-08 20:05:14 +01:00
Compare commits
3 commits
9b3512593a
...
2b11b7e9fb
Author | SHA1 | Date | |
---|---|---|---|
|
2b11b7e9fb | ||
|
6b70757505 | ||
|
776e5c09c0 |
9 changed files with 56 additions and 8 deletions
|
@ -84,3 +84,8 @@
|
|||
.backlink {
|
||||
@apply text-xs font-medium text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100 contrast-more:text-gray-800 contrast-more:dark:text-gray-50;
|
||||
}
|
||||
|
||||
/* For ToC shortcode, Spoiler shortcode, and direct HTML Details snippets. */
|
||||
details > summary {
|
||||
@apply cursor-pointer font-semibold text-primary-700 dark:text-primary-300;
|
||||
}
|
||||
|
|
2
modules/blox-tailwind/assets/dist/wc.min.css
vendored
2
modules/blox-tailwind/assets/dist/wc.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -80,9 +80,10 @@ module:
|
|||
security:
|
||||
funcs:
|
||||
getenv:
|
||||
# Allow HUGO_ and HUGO_BLOX_ vars
|
||||
- ^HUGO_
|
||||
- ^WC_
|
||||
- ^HB_
|
||||
# Allow continuous integration vars
|
||||
- ^CI$
|
||||
outputFormats:
|
||||
backlinks:
|
||||
mediaType: application/json
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{{/* Workaround Hugo concurrency issues (e.g. not detecting Page.Store variables) */}}
|
||||
{{/* https://discourse.gohugo.io/t/persisting-data-across-the-build-of-a-site/41114/6 */}}
|
||||
{{/* Use cases: Page.Store use within shortcodes, blox, and backlinks. */}}
|
||||
{{/* See https://discourse.gohugo.io/t/persisting-data-across-the-build-of-a-site/41114/6 */}}
|
||||
{{- range $page := site.AllPages }}
|
||||
{{- $noop := .Content }}
|
||||
{{ if eq .Type "landing" }}
|
||||
{{ range $index, $block := .Params.sections }}
|
||||
{{/* Do not show sections intended only for the demo site. */}}
|
||||
{{ if or (not $block.demo) ($block.demo | and (eq (os.Getenv "WC_DEMO") "true")) }}
|
||||
{{ if or (not $block.demo) ($block.demo | and (eq (os.Getenv "HUGO_BLOX_DEMO") "true")) }}
|
||||
{{ $block_type := lower ($block.blox | default $block.block) | default "markdown" }}
|
||||
{{ range $r := site.Data.blox_aliases.renames }}
|
||||
{{ $block_type = cond (eq $block_type $r.old) $r.new $block_type }}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{/* Load Hugo Blox */}}
|
||||
{{ range $index, $block := .Params.sections }}
|
||||
{{/* Do not show sections intended only for the demo site. */}}
|
||||
{{ if or (not $block.demo) ($block.demo | and (eq (os.Getenv "WC_DEMO") "true")) }}
|
||||
{{ if or (not $block.demo) ($block.demo | and (eq (os.Getenv "HUGO_BLOX_DEMO") "true")) }}
|
||||
{{ partial "functions/parse_block_v2" (dict "page" $ "block" $block) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
{{ end }}
|
||||
|
||||
{{/* Style */}}
|
||||
{{ if ne (os.Getenv "WC_POSTCSS") "true" }}
|
||||
{{ if ne (os.Getenv "HUGO_BLOX_POSTCSS") "true" }}
|
||||
{{ $styles := resources.Get "dist/wc.min.css" }}
|
||||
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
||||
{{ else }}
|
||||
|
|
23
modules/blox-tailwind/layouts/shortcodes/include.html
Normal file
23
modules/blox-tailwind/layouts/shortcodes/include.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
{{- /*
|
||||
Docs: https://docs.hugoblox.com/reference/markdown/#include
|
||||
|
||||
Parameters
|
||||
----------
|
||||
postional parameter 0 :
|
||||
Path to the Markdown file to include, relative to the `content` folder.
|
||||
|
||||
Example
|
||||
----------
|
||||
{{% include "snippet/intro" %}}
|
||||
*/ -}}
|
||||
|
||||
{{- with .Get 0 }}
|
||||
{{- $page := . -}}
|
||||
{{- with site.GetPage $page }}
|
||||
{{- .RenderShortcodes }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode at %s could not locate %q" $.Name $.Position (printf "content/%s.md" .) }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "Call the %q shortcode in %s with the path of the Markdown file to include." .Name .Position }}
|
||||
{{- end }}
|
|
@ -1,5 +1,5 @@
|
|||
{{/*
|
||||
Docs: https://docs.hugoblox.com/content/writing-markdown-latex/#toggle-list
|
||||
Docs: https://docs.hugoblox.com/reference/markdown/#toggle-lists
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
|
18
modules/blox-tailwind/layouts/shortcodes/toc.html
Normal file
18
modules/blox-tailwind/layouts/shortcodes/toc.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
{{/*
|
||||
Docs: https://docs.hugoblox.com/reference/markdown/#table-of-contents
|
||||
|
||||
Parameters
|
||||
----------
|
||||
mobile_only : true/false (optional)
|
||||
Hide TOC on desktop when TOC is shown in right sidebar?
|
||||
is_open : true/false (optional)
|
||||
Show the TOC in the open, expanded state?
|
||||
*/}}
|
||||
{{ $mobile_only := .Get "mobile_only" | default true }}
|
||||
{{ $is_open := .Get "is_open" | default false }}
|
||||
<details class="print:hidden {{with $mobile_only}}xl:hidden{{end}}" {{with $is_open}}open{{end}}>
|
||||
<summary>{{ i18n "table_of_contents" }}</summary>
|
||||
<div class="text-sm">
|
||||
{{ $.Page.TableOfContents }}
|
||||
</div>
|
||||
</details>
|
Loading…
Reference in a new issue