<commit_before><!--
lightSlider + lightGallery hugo integration

This requires the SourceJSON extension from <NAME>.

https://github.com/SchumacherFM/hugo/tree/dynamicPagesWithJsonCsv

Params:
    name:       css #id of your slider
    url:        path or url of your slider.json
    includejs:  add a jquery.min.js, lightGallery.min.js and jquery.lightSlider.min.js include.

Creates a lightSlider on your page, call it with: {{/*

    {{% lightslider name="<your-slider-name>" url="<url_or_path-to-your-slider.json" [includejs="true"] %}}

*/}}

Example: {{/*

    {{% lightslider name="post_pcengines_apu1d4_slider1" url="data/post/pcengines_apu1d4.json" includejs="true" %}}

*/}}
-->
{{ if $.Get "includejs" }}
        <script src="{{ $.Page.Site.BaseUrl }}/js/jquery.min.js"></script>
        <script src="{{ $.Page.Site.BaseUrl }}/js/lightGallery.min.js"></script>
        <script src="{{ $.Page.Site.BaseUrl }}/js/jquery.lightSlider.min.js"></script>
{{ end }}

{{ with .Get "url" }}
    {{ $url := . }}
    {{ with $.Get "name" }}
        {{ $name := . }}
        <ul id="{{ $name }}" class="cs-hidden">
        {{ $data := getJson $url }}
        {{ range $data.items }}
            {{ $item := . }}
            <li data-thumb="{{ $item.thumb }}" data-src="{{ $item.full }}">
                <img src="{{ $item.full }}" />
            </li>
        {{ end }}
        </ul>

        <script>
        $(document).ready(function() {
            $('#{{ $name }}').lightSlider({
               gallery: true,
               {{ if isset $data.settings "item" }}item: {{ index $data.settings "item" }},{{ end }}
               {{ if isset $data.settings "thumbItem" }}thumbItem: {{ index $data.settings "thumbItem" }},{{ end }}
               {{ if isset $data.settings "slideMargin" }}slideMargin: {{ index $data.settings "slideMargin" }},{{ end }}
               {{ if isset $data.settings "currentPagerPosition" }}currentPagerPosition: {{ index $data.settings "currentPagerPosition" }},{{ end }}
               {{ if isset $data.settings "slideMove" }}slideMove: {{ index $data.settings "slideMove" }},{{ end }}
               {{ if isset $data.settings "easing" }}easing: {{ index $data.settings "easing" }},{{ end }}
               {{ if isset $data.settings "speed" }}speed: {{ index $data.settings "speed" }},{{ end }}
               responsive : [
               {{ range $data.settings.responsive }}
                    {{ $responsive := . }}
                    {
                        {{ if isset $responsive "breakpoint" }}breakpoint: {{ index $responsive "breakpoint" }},{{ end }}
                        {{ if isset $responsive "settings" }}
                        settings: {
                            {{ if isset $responsive.settings "item" }}item: {{ index $responsive.settings "item" }},{{ end }}
                            {{ if isset $responsive.settings "slideMove" }}slideMove: {{ index $responsive.settings "slideMove" }},{{ end }}
                            {{ if isset $responsive.settings "slideMargin" }}slideMargin: {{ index $responsive.settings "slideMargin" }},{{ end }}
                        }
                        {{ end }}
                    },
               {{ end }}
               ],
               onSliderLoad: function() {
                   $("#{{ $name }}").lightGallery();
               }
               });
            });
        </script>
    {{ end }}
{{ end }}
<commit_msg>Also update the shortecodes docs, see issue #1.<commit_after><!--
lightSlider + lightGallery hugo integration

Params:
    name:       css #id of your slider
    url:        path or url of your slider.json
    includejs:  add a jquery.min.js, lightGallery.min.js and jquery.lightSlider.min.js include.

Creates a lightSlider on your page, call it with: {{/*

    {{% lightslider name="<your-slider-name>" url="<url_or_path-to-your-slider.json" [includejs="true"] %}}

*/}}

Example: {{/*

    {{% lightslider name="post_pcengines_apu1d4_slider1" url="data/post/pcengines_apu1d4.json" includejs="true" %}}

*/}}
-->
{{ if $.Get "includejs" }}
        <script src="{{ $.Page.Site.BaseUrl }}/js/jquery.min.js"></script>
        <script src="{{ $.Page.Site.BaseUrl }}/js/lightGallery.min.js"></script>
        <script src="{{ $.Page.Site.BaseUrl }}/js/jquery.lightSlider.min.js"></script>
{{ end }}

{{ with .Get "url" }}
    {{ $url := . }}
    {{ with $.Get "name" }}
        {{ $name := . }}
        <ul id="{{ $name }}" class="cs-hidden">
        {{ $data := getJson $url }}
        {{ range $data.items }}
            {{ $item := . }}
            <li data-thumb="{{ $item.thumb }}" data-src="{{ $item.full }}">
                <img src="{{ $item.full }}" />
            </li>
        {{ end }}
        </ul>

        <script>
        $(document).ready(function() {
            $('#{{ $name }}').lightSlider({
               gallery: true,
               {{ if isset $data.settings "item" }}item: {{ index $data.settings "item" }},{{ end }}
               {{ if isset $data.settings "thumbItem" }}thumbItem: {{ index $data.settings "thumbItem" }},{{ end }}
               {{ if isset $data.settings "slideMargin" }}slideMargin: {{ index $data.settings "slideMargin" }},{{ end }}
               {{ if isset $data.settings "currentPagerPosition" }}currentPagerPosition: {{ index $data.settings "currentPagerPosition" }},{{ end }}
               {{ if isset $data.settings "slideMove" }}slideMove: {{ index $data.settings "slideMove" }},{{ end }}
               {{ if isset $data.settings "easing" }}easing: {{ index $data.settings "easing" }},{{ end }}
               {{ if isset $data.settings "speed" }}speed: {{ index $data.settings "speed" }},{{ end }}
               responsive : [
               {{ range $data.settings.responsive }}
                    {{ $responsive := . }}
                    {
                        {{ if isset $responsive "breakpoint" }}breakpoint: {{ index $responsive "breakpoint" }},{{ end }}
                        {{ if isset $responsive "settings" }}
                        settings: {
                            {{ if isset $responsive.settings "item" }}item: {{ index $responsive.settings "item" }},{{ end }}
                            {{ if isset $responsive.settings "slideMove" }}slideMove: {{ index $responsive.settings "slideMove" }},{{ end }}
                            {{ if isset $responsive.settings "slideMargin" }}slideMargin: {{ index $responsive.settings "slideMargin" }},{{ end }}
                        }
                        {{ end }}
                    },
               {{ end }}
               ],
               onSliderLoad: function() {
                   $("#{{ $name }}").lightGallery();
               }
               });
            });
        </script>
    {{ end }}
{{ end }}

{'fraction_non_alphanumeric': 0.18350515463917524, 'fraction_numerical': 0.0016200294550810016, 'mean_word_length': 1.8984208279982928, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 34, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5377414', 'n_tokens_mistral': 1935, 'n_tokens_neox': 1926, 'n_words': 441}