diff --git a/site/content/docs/5.3/examples/_index.md b/site/content/docs/5.3/examples/_index.md index dbba4d7605..e98b76df48 100644 --- a/site/content/docs/5.3/examples/_index.md +++ b/site/content/docs/5.3/examples/_index.md @@ -6,88 +6,3 @@ aliases: - "/examples/" - "/docs/examples/" --- - -{{< callout info >}} -**Some examples are missing here.** - -They are tracked in [#410](https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/issues/410) and will be shipped as soon as possible. - -One of the missing examples has priority? Feel free to contact a member of the [Core team]({{< docsref "/about/team" >}}) or add a comment directly [in the corresponding issue](https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/issues/410) to let us know. -{{}} - -{{< list-examples.inline >}} -{{ range $entry := $.Site.Data.examples -}} -
-

{{ $entry.category }}

-

{{ $entry.description }}

- {{ if eq $entry.category "RTL" -}} -
-

- RTL is still experimental and will evolve with feedback. Spotted something or have an improvement to suggest? -

-

Please open an issue.

-
- {{ end -}} - {{ if eq $entry.category "Starters" -}} -
-

- To get working Boosted examples based on the Bootstrap ones, you need to replace all bootstrap occurrences with boosted in some files. -

-

- You may need to tweak a bit Sass files and add a src/fonts directory to import font family properly in your project. - "Import Boosted" sections in our Parcel, Vite or Webpack guides could help you. -

-
- {{ end -}} - {{ range $i, $example := $entry.examples -}} - {{- $len := len $entry.examples -}} - {{ if (eq $i 0) }}
{{ end }} - {{ if $entry.external -}} -
- -
-

- - {{ $example.name }} - -

-

{{ $example.description }}

-

- {{- $indexPath := "index.html" -}} - {{- if $example.indexPath -}} - {{- $indexPath = $example.indexPath -}} - {{- end }} - - - Edit in StackBlitz - -

-
-
- {{ else -}} - - {{- end }} - {{ if (eq (add $i 1) $len) }}
{{ end -}} - {{ end -}} -
-{{ end -}} -{{< /list-examples.inline >}} diff --git a/site/content/docs/5.3/getting-started/parcel.md b/site/content/docs/5.3/getting-started/parcel.md index 3054a258ea..99aa7a0d80 100644 --- a/site/content/docs/5.3/getting-started/parcel.md +++ b/site/content/docs/5.3/getting-started/parcel.md @@ -121,7 +121,7 @@ With dependencies installed and our project folder ready for us to start coding, npm start ``` - Parcel dev server running + ![Parcel dev server running](/assets/img/guides/parcel-dev-server.png) In the next and final section to this guide, we'll import all of Boosted's CSS and JavaScript. @@ -169,7 +169,7 @@ Importing Boosted into Parcel requires three imports, two into our `styles.scss` 4. **And you're done! 🎉** With Boosted's source Sass and JS fully loaded, your local development server should now look like this: - Parcel dev server running with Boosted + ![Parcel dev server running with Boosted](/assets/img/guides/parcel-dev-server-boosted.png) Now you can start adding any Boosted components you want to use. Be sure to [check out the complete Parcel example project](https://github.com/twbs/examples/tree/main/parcel) for how to include additional custom Sass and optimize your build by importing only the parts of Boosted's CSS and JS that you need. diff --git a/site/content/docs/5.3/getting-started/vite.md b/site/content/docs/5.3/getting-started/vite.md index d35dc5d911..214f505359 100644 --- a/site/content/docs/5.3/getting-started/vite.md +++ b/site/content/docs/5.3/getting-started/vite.md @@ -142,7 +142,7 @@ With dependencies installed and our project folder ready for us to start coding, npm start ``` - Vite dev server running + ![Vite dev server running](/assets/img/guides/vite-dev-server.png) In the next and final section to this guide, we’ll import all of Boosted’s CSS and JavaScript. @@ -191,7 +191,7 @@ In the next and final section to this guide, we’ll import all of Boosted’s C 4. **And you're done! 🎉** With Boosted's source Sass and JS fully loaded, your local development server should now look like this: - Vite dev server running with Boosted + ![Vite dev server running with Boosted](/assets/img/guides/vite-dev-server-boosted.png) Now you can start adding any Boosted components you want to use. Be sure to [check out the complete Vite example project](https://github.com/twbs/examples/tree/main/vite) for how to include additional custom Sass and optimize your build by importing only the parts of Boosted's CSS and JS that you need. diff --git a/site/content/docs/5.3/getting-started/webpack.md b/site/content/docs/5.3/getting-started/webpack.md index 7fbf12da12..a4191b7ab7 100644 --- a/site/content/docs/5.3/getting-started/webpack.md +++ b/site/content/docs/5.3/getting-started/webpack.md @@ -152,7 +152,7 @@ With dependencies installed and our project folder ready for us to start coding, npm start ``` - Webpack dev server running + ![Webpack dev server running](/assets/img/guides/webpack-dev-server.png) In the next and final section to this guide, we'll set up the Webpack loaders and import all of Boosted's CSS and JavaScript. @@ -265,7 +265,7 @@ Importing Boosted into Webpack requires the loaders we installed in the first se 4. **And you're done! 🎉** With Boosted's source Sass and JS fully loaded, your local development server should now look like this: - Webpack dev server running with Boosted + ![Webpack dev server running with Boosted](/assets/img/guides/webpack-dev-server-boosted.png) Now you can start adding any Boosted components you want to use. Be sure to [check out the complete Webpack example project](https://github.com/twbs/examples/tree/main/webpack) for how to include additional custom Sass and optimize your build by importing only the parts of Boosted's CSS and JS that you need. diff --git a/site/layouts/_default/_markup/render-image.html b/site/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000000..fd089f7be1 --- /dev/null +++ b/site/layouts/_default/_markup/render-image.html @@ -0,0 +1,8 @@ +{{- $originalSrc := .Destination | safeURL -}} +{{- $localImgPath := path.Join "/site/static/docs" site.Params.docs_version $originalSrc -}} +{{- /* This shouldn't be needed but we have a weird folder structure with version included... */ -}} +{{- $src := urls.JoinPath "/docs" site.Params.docs_version $originalSrc -}} +{{- $config := imageConfig $localImgPath -}} +{{- $classes := "d-block img-fluid" -}} + +{{ .Text }} diff --git a/site/layouts/_default/single.html b/site/layouts/_default/single.html index 780db705ac..57e009380a 100644 --- a/site/layouts/_default/single.html +++ b/site/layouts/_default/single.html @@ -39,6 +39,11 @@

{{ .Title | markdownify }}

{{ end }} {{ .Content }} + + {{ if eq .Title "Examples" -}} + {{ partial "examples/main" . }} + + {{- end }}
diff --git a/site/layouts/partials/examples/main.html b/site/layouts/partials/examples/main.html new file mode 100644 index 0000000000..bac2527fa8 --- /dev/null +++ b/site/layouts/partials/examples/main.html @@ -0,0 +1,74 @@ +{{ range $entry := $.Site.Data.examples -}} +
+

{{ $entry.category }}

+

{{ $entry.description }}

+ {{ if eq $entry.category "RTL" -}} +
+

+ RTL is still experimental and will evolve with feedback. Spotted something or have an improvement to suggest? +

+

Please open an issue.

+
+ {{ end -}} + {{ if eq $entry.category "Starters" -}} +
+

+ To get working Boosted examples based on the Bootstrap ones, you need to replace all bootstrap occurrences with boosted in some files. +

+

+ You may need to tweak a bit Sass files and add a src/fonts directory to import font family properly in your project. + "Import Boosted" sections in our Parcel, Vite or Webpack guides could help you. +

+
+ {{ end -}} + {{ range $i, $example := $entry.examples -}} + {{- $len := len $entry.examples -}} + {{ if (eq $i 0) }}
{{ end }} + {{ if $entry.external -}} +
+ +
+

+ + {{ $example.name }} + +

+

{{ $example.description }}

+

+ {{- $indexPath := default "index.html" $example.indexPath -}} + {{- $stackBlitzUrl := printf "%s%s%s" (urls.JoinPath "https://stackblitz.com/github/twbs" $example.url) "?file=" ($indexPath | urlquery) }} + + + Edit in StackBlitz + +

+
+
+ {{ else -}} + + {{- end }} + {{ if (eq (add $i 1) $len) }}
{{ end -}} + {{ end -}} +
+{{ end -}} diff --git a/site/layouts/partials/home/orange-design-system.html b/site/layouts/partials/home/orange-design-system.html index f3940e7d84..9233bcc8ea 100644 --- a/site/layouts/partials/home/orange-design-system.html +++ b/site/layouts/partials/home/orange-design-system.html @@ -15,13 +15,9 @@

Orange Design System for web

- Boosted design guidelines + {{ partial "responsive-img" (dict "context" . + "imgPath" "/assets/img/boosted-guidelines.png" + "alt" "Boosted design guidelines" + "classes" "d-block mt-3") }}
diff --git a/site/layouts/partials/responsive-img.html b/site/layouts/partials/responsive-img.html new file mode 100644 index 0000000000..06aafb6aa7 --- /dev/null +++ b/site/layouts/partials/responsive-img.html @@ -0,0 +1,22 @@ +{{- /* + Accepts context, classes, imgPath, alt and lazyload +*/ -}} + +{{- $lazy := .lazyload | default true -}} +{{- $classes := slice "img-fluid" "mx-auto" | append (slice .classes) -}} + +{{- $basePath := path.Join "/docs" .context.Site.Params.docs_version (path.Dir .imgPath) -}} +{{- $basename := path.BaseName .imgPath -}} +{{- $ext := path.Ext .imgPath -}} +{{- $imgPath := path.Join $basePath (printf "%s%s" $basename $ext) -}} +{{- $imgPath2x := path.Join $basePath (printf "%s@2x%s" $basename $ext) -}} + +{{- with (imageConfig (path.Join "/site/static" $imgPath)) }} +{{ $.alt }} +{{- end }} diff --git a/site/static/docs/5.3/assets/img/boosted-guidelines.png b/site/static/docs/5.3/assets/img/boosted-guidelines.png index 77f8296279..b1d5249dae 100644 Binary files a/site/static/docs/5.3/assets/img/boosted-guidelines.png and b/site/static/docs/5.3/assets/img/boosted-guidelines.png differ diff --git a/site/static/docs/5.3/assets/img/boosted-guidelines@2x.png b/site/static/docs/5.3/assets/img/boosted-guidelines@2x.png index a16fe28cd1..8d97b99318 100644 Binary files a/site/static/docs/5.3/assets/img/boosted-guidelines@2x.png and b/site/static/docs/5.3/assets/img/boosted-guidelines@2x.png differ