Compare commits

...

20 Commits

Author SHA1 Message Date
Mark Dumay
d29759da9b Merge pull request #555 from gethinode/develop
Refine base layout
2023-10-14 07:47:29 +02:00
Mark Dumay
4b3a2e441b Merge branch 'main' into develop 2023-10-14 07:31:42 +02:00
mark
a8b8d07bf4 Refine featured configuration 2023-10-14 07:31:07 +02:00
mark
34410446f3 Update build stats 2023-10-14 07:30:40 +02:00
mark
13098a351d Configure featured layout 2023-10-14 07:30:33 +02:00
mark
d071fa03a6 Update build stats 2023-10-14 07:30:13 +02:00
Mark Dumay
6ff65c37ac Merge pull request #551 from aefly/french-translation
Update French Translation with latest hinode version
2023-10-12 13:41:42 +02:00
aefly
e03396490e Update components.md 2023-10-12 13:16:41 +02:00
Mark Dumay
ad453b6400 Merge branch 'main' into develop 2023-10-12 13:11:03 +02:00
mark
500a572a9c Bump package release 2023-10-12 13:09:49 +02:00
mark
f3bffcb5fb Improve featured section layout 2023-10-12 13:08:33 +02:00
mark
30305ffd1c Fix scroll offset for display headings 2023-10-12 13:07:52 +02:00
mark
62f2e33b64 Fix anchorization of section titles 2023-10-12 13:07:13 +02:00
mark
24d655ec76 Fix typo 2023-10-12 13:06:45 +02:00
mark
7668f795da Support word wrap config of nav 2023-10-12 13:06:31 +02:00
Mark Dumay
96a5853333 Merge branch 'main' into french-translation 2023-10-12 07:05:30 +02:00
github-actions[bot]
6b767410dc Merge pull request #553 from gethinode/dependabot/npm_and_yarn/eslint-plugin-n-16.2.0
Bump eslint-plugin-n from 16.1.0 to 16.2.0
2023-10-11 13:41:24 +00:00
dependabot[bot]
3f8dd1d457 Bump eslint-plugin-n from 16.1.0 to 16.2.0
Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 16.1.0 to 16.2.0.
- [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases)
- [Commits](https://github.com/eslint-community/eslint-plugin-n/compare/16.1.0...16.2.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-n
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 13:35:04 +00:00
aefly
8cb501186a Update components.md 2023-10-11 08:08:12 +02:00
Mark Dumay
bdfe42b22f Merge pull request #550 from gethinode/main
Sync with main
2023-10-10 10:21:37 +02:00
13 changed files with 113 additions and 81 deletions

View File

@@ -30,3 +30,7 @@ h6 {
margin-top: $spacer;
scroll-margin-top: $navbar-offset;
}
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
scroll-margin-top: $navbar-offset;
}

View File

@@ -48,7 +48,7 @@
[home.feature]
orientation = "horizontal"
color = "primary"
colWidth = 6
width = 4
# toml-docs-end home
# toml-docs-start navigation

View File

@@ -36,6 +36,11 @@
fullCover = false
centerHeadline = false
style = ""
[home.feature]
orientation = "horizontal"
color = "primary"
width = 4
align = "start"
[navigation]
anchor = true

View File

@@ -11,11 +11,21 @@ thumbnail:
authorURL: https://unsplash.com/@ryoji__iwata
origin: Unsplash
originURL: https://unsplash.com/photos/5siQcvSxCP8
modules: ["katex", "leaflet"]
modules: ["katex", "leaflet", "lottie"]
---
Hinode propose plusieurs shortcodes en plus des [éléments Bootstrap]({{< relref "bootstrap-elements" >}}) courants. Consultez la [documentation officielle]({{< param "links.hinode_docs" >}}) pour plus de détails.
## Animation
À titre d'exemple, le shortcode suivant affiche une animation qui se déclenche au survol.
<!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}}
{{</* animation data="gatin.json" auto=false hover=true class="col-6 mx-auto" */>}}
{{< /example >}}
<!-- markdownlint-enable MD037 -->
## Formule (KaTeX)
À titre d'exemple, le markdown suivant affiche deux formules en utilisant la bibliothèque de composition typographique KaTeX.

View File

@@ -124,7 +124,7 @@
"col-lg-8",
"col-md-10",
"col-md-2",
"col-md-6",
"col-md-4",
"col-md-8",
"col-md-auto",
"col-sm-12",
@@ -238,7 +238,6 @@
"justify-content-between",
"justify-content-center",
"justify-content-end",
"justify-content-md-start",
"justify-content-start",
"lead",
"leaflet-map",
@@ -317,6 +316,7 @@
"ps-1",
"ps-3",
"ps-xl-3",
"pt-4",
"pt-5",
"pt-md-3",
"px-3",
@@ -371,12 +371,12 @@
"text-decoration-none",
"text-end",
"text-info",
"text-md-start",
"text-muted",
"text-nowrap",
"text-right",
"text-secondary",
"text-sm-start",
"text-start",
"text-uppercase",
"theme-icon",
"theme-icon-active",

View File

@@ -43,7 +43,6 @@
"col",
"col-12",
"col-6",
"col-8",
"col-md-2",
"col-md-6",
"col-md-8",
@@ -95,7 +94,6 @@
"fs-5",
"fw-30",
"fw-bold",
"gap-3",
"h-100",
"hstack",
"img-fluid",

View File

@@ -1,18 +1,31 @@
{{- define "main" -}}
{{- $page := . -}}
{{- $orientation := "horizontal" -}}
{{- $orientation := site.Params.list.feature.orientation | default "horizontal" -}}
{{- $width := site.Params.list.feature.width | default 6 -}}
{{- $justify := site.Params.list.feature.justify | default "center" -}}
{{- $align := site.Params.list.feature.align | default "center" -}}
{{- $sections := slice -}}
{{- $sections = $sections | append $page.Type -}}
{{ with $page.Params.sections }}
{{ $sections = $sections | append . }}
{{ end }}
{{- $actions := $page.Params.actions -}}
{{- $headings := slice -}}
{{- $layout := $page.Params.layout -}}
{{ if $page.IsHome }}
{{- $orientation = site.Params.home.feature.orientation | default "horizontal" -}}
{{- $orientation = or site.Params.home.feature.orientation $orientation -}}
{{- $width = or site.Params.home.feature.width $width -}}
{{- $justify = or site.Params.home.feature.justify $justify -}}
{{- $align = or site.Params.home.feature.align $align -}}
{{- $actions = (or $actions site.Params.featured.actions) -}}
{{- $sections = site.Params.home.sections -}}
{{- if not $sections -}}
{{ range $section := site.Sections }}
{{ $sections = $sections | append $section.Type }}
{{- if not $page.Params.sections -}}
{{- with site.Params.home.sections }}
{{ $sections = $sections | append . }}
{{ else }}
{{ range $section := site.Sections }}
{{ $sections = $sections | append $section.Type }}
{{ end }}
{{ end }}
{{- end -}}
{{ else }}
@@ -22,11 +35,6 @@
{{- $headings = $headings | append .Title -}}
{{- end -}}
{{- end -}}
{{ $sections = $sections | append $page.Type }}
{{ with $page.Params.sections }}
{{ $sections = $sections | append . }}
{{ end }}
{{ end }}
{{/* Generate section content first to determine headings */}}
@@ -55,7 +63,7 @@
"section" $section
"home" $page.IsHome
"simple" (eq $section $page.Section)
"nested" $page.IsHome
"nested" (and $page.IsHome (eq $section $page.Section))
"thumbnail" $thumbnail
"icon" $icon
"content" $content
@@ -71,7 +79,15 @@
{{/* Display featured section */}}
{{- if or (eq $layout "featured") $page.IsHome -}}
{{- partial "list/featured.html" (dict "page" . "headings" $headings "actions" $actions "orientation" $orientation) -}}
{{- partial "list/featured.html" (dict
"page" .
"headings" $headings
"actions" $actions
"orientation" $orientation
"width" $width
"justify" $justify
"align" $align)
-}}
{{- end -}}
{{/* Display main content */}}

View File

@@ -20,27 +20,6 @@
{{- end -}}
{{- end -}}
<div class="container-fluid p-4 px-xxl-0">
{{ with $title }}<p class="display-4 mt-3{{ if and page.IsHome site.Params.home.centerHeadline }} text-center{{ end }}">{{ . }}</p>{{ end }}
{{ with $description }} <p class="lead mb-5">{{ . }}</p>{{ end }}
{{- if $content -}}
<div class="row row-cols-1 row-cols-lg-3 pt-5">
<div class="col col-lg-3 d-none d-lg-block"></div>
<div class="col col-sm-12 col-lg-6 text-center">
<div class="row row-cols-1{{ if ne $sectionHeader "justify-content-center" }} row-cols-sm-2{{ end }} row-gap-5 p-0 align-items-center flex-fill">
{{- if eq $sectionHeader "justify-content-center" -}}
<div class="col p-0 w-50 mx-auto pb-5">{{ partial "partials/section-header-img.html" (dict "title" $title "thumbnail" $thumbnail "icon" $icon )}}</div>
<div class="col fs-md-5 fs-6">{{ $content }}</div>
{{- else if eq $sectionHeader "justify-content-end" -}}
<div class="col p-0">{{ partial "partials/section-header-img.html" (dict "title" $title "thumbnail" $thumbnail "icon" $icon )}}</div>
<div class="col fs-md-5 fs-6 text-sm-start">{{ $content }}</div>
{{- else -}}
<div class="col fs-md-5 fs-6 text-sm-start">{{ $content }}</div>
<div class="col p-0">{{ partial "partials/section-header-img.html" (dict "title" $title "thumbnail" $thumbnail "icon" $icon )}}</div>
{{- end -}}
</div>
</div>
<div class="col col-lg-3 d-none d-lg-block"></div>
</div>
{{- end -}}
</div>
{{ with $title }}<p id="{{ anchorize . }}" class="display-4 pt-4{{ if and page.IsHome site.Params.home.centerHeadline }} text-center{{ end }}">{{ . }}</p>{{ end }}
{{ with $description }} <p class="lead mb-5">{{ . }}</p>{{ end }}
{{ $content }}

View File

@@ -35,6 +35,7 @@
{{- $vertical := "false" -}}
{{- $width := 100 -}}
{{- $ratio := "" -}}
{{- $wrap := false -}}
{{- with (index site.Params.sections $section) -}}
{{- with index . "title" }}{{ $title = or $.title . }}{{ end -}}
@@ -59,6 +60,7 @@
{{- with index . "width" }}{{ $width = . }}{{ end -}}
{{- with index . "kind" }}{{ $kind = . }}{{ end -}}
{{- with index . "ratio" }}{{ $ratio = . }}{{ end -}}
{{- with index . "wrap" }}{{ $wrap = . }}{{ end -}}
{{- end -}}
{{ if ne (printf "%T" $nested) "bool" }}
{{ errorf "partial [assets/section-list.html] - Invalid value for param 'nested'"}}
@@ -151,6 +153,7 @@
"type" $type
"vertical" $vertical
"width" $width
"wrap" $wrap
)
-}}
{{- else -}}

View File

@@ -2,43 +2,57 @@
{{- $headings := .headings -}}
{{- $orientation := .orientation | default "stacked" -}}
{{- $actions := .actions -}}
{{- $colWidth := .colWidth | default 6 }}
{{- $width := .width | default 6 }}
{{- if or (lt $width 1) (gt $width 12) -}}
{{- $width = 6 -}}
{{- warnf "partial [list/featured.html] - Invalid column width: %d" $width -}}
{{ end -}}
{{- $justify := .justify | default "center" -}}
{{- $supportedJustify := slice "start" "end" "center" "between" "around" "evenly" -}}
{{- if not (in $supportedJustify $justify) -}}
{{- errorf "partial [list/featured.html] - Invalid value for param 'justify': %s" $justify -}}
{{- end -}}
{{- $align := .align | default "center" -}}
{{- $supportedAlign := slice "start" "end" "center" -}}
{{- if not (in $supportedAlign $align) -}}
{{- errorf "partial [list/featured.html] - Invalid value for param 'align': %s" $align -}}
{{- end -}}
{{- define "partials/list/featured-body.html" }}
{{- $page := .page -}}
{{- $headings := .headings -}}
{{- $orientation := .orientation | default "stacked" -}}
{{- $actions := .actions -}}
{{- $align := .align | default "center" -}}
<div class="row justify-content-end">
<div class="text-center {{ if ne $orientation "stacked" }} text-md-start{{ end }} col-md-8">
{{ with $page.Title }}<p class="display-4">{{ . }}</p>{{ end }}
<span class="fs-5 text-muted">{{ $page.Description }}</span>
<div class="text-{{ $align }}">
{{ with $page.Title }}<p class="display-4">{{ . }}</p>{{ end }}
<span class="fs-5 text-muted">{{ $page.Description }}</span>
{{ if $actions }}
<div class="hstack gap-3 justify-content-center{{ if ne $orientation "stacked" }} justify-content-md-start{{ end }} pt-5 pt-md-3">
{{ range $actions }}
{{ partial "assets/button.html" (dict "href" .url "icon" .icon "title" .title "outline" .outline "order" "last" "justify" "start") }}
{{ end }}
</div>
{{ end }}
</div>
{{ if $actions }}
<div class="hstack{{ if gt (len $actions) 1 }} gap-3{{ end }} justify-content-{{ $align}} pt-5 pt-md-3">
{{ range $actions }}
{{ partial "assets/button.html" (dict "href" .url "icon" .icon "title" .title "outline" .outline "order" "last" "justify" "start") }}
{{ end }}
</div>
{{ end }}
</div>
{{- end -}}
{{- define "partials/list/featured-illustration.html" }}
{{- $page := .page -}}
{{- $style := printf "img-wrap mx-auto mx-md-0 %s" .style -}}
{{ with $page.Params.icon }}
{{ if eq (lower (path.Ext .)) ".json" }}
{{ partial "assets/animation.html" (dict "data" . "loop" false "hover" true "class" "col-8 mx-auto text-center") }}
{{ partial "assets/animation.html" (dict "data" . "loop" false "hover" true "class" "col-6 mx-auto text-center") }}
{{ else }}
{{ partial "assets/icon.html" (dict "icon" . "wrapper" "col-8 mx-auto text-center")}}
{{ partial "assets/icon.html" (dict "icon" . "wrapper" "col-6 mx-auto text-center")}}
{{ end }}
{{ else }}
{{- $thumbnail := (or (and (reflect.IsMap $page.Params.Thumbnail) $page.Params.Thumbnail.url) $page.Params.Thumbnail) -}}
{{- if $thumbnail }}
{{ partial "assets/image.html" (dict "url" $thumbnail "ratio" "16x9" "outerClass" "img-wrap col-8 mx-auto mx-md-0 pb-5 pb-md-0" "innerClass" "rounded" "title" .Site.Title) }}
{{ partial "assets/image.html" (dict "url" $thumbnail "ratio" "16x9" "outerClass" $style "innerClass" "rounded" "title" .Site.Title) }}
{{ end }}
{{ end }}
{{- end -}}
@@ -48,18 +62,21 @@
{{ if and (not $page.IsHome) site.Params.navigation.breadcrumb }}
<div>{{ partial "assets/breadcrumb.html" $page }}</div>
{{ end -}}
{{ if eq $orientation "stacked" }}
<div class="col-12 col-md-{{ $colWidth }} m-auto text-center h-100">
{{ partial "partials/list/featured-illustration.html" (dict "page" $page) }}
{{ partial "partials/list/featured-body.html" (dict "page" $page "headings" $headings "orientation" $orientation "actions" $actions) }}
</div>
{{ else }}
<div class="row row-cols-1 row-cols-md-2 flex-fill">
<div class="col col-12 col-md-{{ $colWidth }} order-1 order-md-0 my-md-auto">
<div class="row justify-content-center flex-fill">
<div class="col-12 col-md-{{ $width }} m-auto text-center">
{{ partial "partials/list/featured-illustration.html" (dict "page" $page "style" "pb-4") }}
{{ partial "partials/list/featured-body.html" (dict "page" $page "headings" $headings "orientation" $orientation "actions" $actions) }}
</div>
<div class="col col-12 col-md-{{ sub 12 $colWidth }} order-0 order-md-1 text-center my-md-auto align-items-end">
{{ partial "partials/list/featured-illustration.html" (dict "page" $page) }}
</div>
{{ else }}
<div class="flex-fill row row-cols-1 row-cols-md-2 justify-content-{{ $justify }}">
<div class="col col-12 col-md-{{ $width }} order-1 order-md-0 my-md-auto">
{{ partial "partials/list/featured-body.html" (dict "page" $page "headings" $headings "orientation" $orientation "actions" $actions "align" $align) }}
</div>
<div class="col col-12 col-md-{{ if gt $width 6 }}{{ sub 12 $width }}{{ else }}{{ $width }}{{ end }} order-0 order-md-1 text-center my-md-auto">
{{ partial "partials/list/featured-illustration.html" (dict "page" $page "style" "pb-4 pb-md-0") }}
</div>
</div>
{{ end }}

View File

@@ -1,5 +1,5 @@
<!--
Displays a Bootstrap card that links to a page. Any inner text is used as description The shortcode supports the
Displays a Bootstrap card that links to a page. Any inner text is used as description. The shortcode supports the
following arguments:
"path" Optional path of the page. If omitted, specify the title, icon, thumbnail, and body as needed.
"title" Optional title of the card.

18
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@gethinode/hinode",
"version": "0.21.0-alpha",
"version": "0.21.0-alpha2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@gethinode/hinode",
"version": "0.21.0-alpha",
"version": "0.21.0-alpha2",
"license": "MIT",
"devDependencies": {
"@fullhuman/postcss-purgecss": "^5.0.0",
@@ -18,7 +18,7 @@
"eslint": "^8.51.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.1.0",
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-promise": "^6.1.1",
"hugo-bin": "^0.115.0",
"markdownlint-cli2": "^0.10.0",
@@ -2759,9 +2759,9 @@
}
},
"node_modules/eslint-plugin-n": {
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.1.0.tgz",
"integrity": "sha512-3wv/TooBst0N4ND+pnvffHuz9gNPmk/NkLwAxOt2JykTl/hcuECe6yhTtLJcZjIxtZwN+GX92ACp/QTLpHA3Hg==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.2.0.tgz",
"integrity": "sha512-AQER2jEyQOt1LG6JkGJCCIFotzmlcCZFur2wdKrp1JX2cNotC7Ae0BcD/4lLv3lUAArM9uNS8z/fsvXTd0L71g==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
@@ -11504,9 +11504,9 @@
}
},
"eslint-plugin-n": {
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.1.0.tgz",
"integrity": "sha512-3wv/TooBst0N4ND+pnvffHuz9gNPmk/NkLwAxOt2JykTl/hcuECe6yhTtLJcZjIxtZwN+GX92ACp/QTLpHA3Hg==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.2.0.tgz",
"integrity": "sha512-AQER2jEyQOt1LG6JkGJCCIFotzmlcCZFur2wdKrp1JX2cNotC7Ae0BcD/4lLv3lUAArM9uNS8z/fsvXTd0L71g==",
"dev": true,
"requires": {
"@eslint-community/eslint-utils": "^4.4.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.21.0-alpha",
"version": "0.21.0-alpha2",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",
@@ -76,7 +76,7 @@
"eslint": "^8.51.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.1.0",
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-promise": "^6.1.1",
"hugo-bin": "^0.115.0",
"markdownlint-cli2": "^0.10.0",