profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/damiani/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Keith Damiani damiani Tighten Co. Charlottesville, VA Principal Programmer at @tightenco

damiani/kd-datepicker 1

Date and Time Picker for Vue.js

damiani/aoc-2017 0

Advent Of Code 2017

damiani/aoc-2020 0

Advent of Code 2020

damiani/craft_hacksaw 0

A migrated version of Hacksaw (for ExpressionEngine) made especially for Craft CMS.

damiani/csv 0

Simple CSV generation and consumption for Laravel4

damiani/faktory 0

An attempt to bring the wonders of FactoryGirl to PHP.

damiani/flash-my-lights 0

Quick proof-of-concept for flashing/blinking lights with Laravel and IFTTT

MemberEvent

issue closedtighten/jigsaw

Decorators/Middleware

The only reason I was able to add AMP into my blog was because of the custom parser hack. When thinking about other ways to implement this, I imagined some kind of proxy class, like a Laravel middleware, that can mutate the content.

This would work on "route" level. You can currently provide an array of paths for an article (maybe ['main' => 'post/:slug', 'amp' => 'post/:slug/amp']), so I could attach one of this middlewares to the amp route and convert the HTML to AMP-HTML there.

Is this someone you'd want on Jigsaw? If so, I can come up with an initial implementation and PR it :)

closed time in 14 days

m1guelpf

issue closedtighten/jigsaw

A way to register parsers

To bypass an edge case I ran into, I had to add a register a custom parser. Unfortunately, there's no other way to do it than overwriting the container registration in the bootstrap.php file.

It'd be nice to have a $jigsaw->registerParser() function for situations like this. This function would ideally be able to

  • Register a parser
  • Specify the order in which to register a parser (first or last would work)
  • Be able to register parsers in other places that accept parsers (like the CollectionItemHandler class).

Is this something you'd be interested in having? I can PR it if you want :)

closed time in 14 days

m1guelpf

issue closedtighten/jigsaw

Nested YAML variables overwriting parent array

I have a situation where I need to overwrite a single nested key/value pair inside an array, with YAML Front Matter. For example, consider this array in config.php:

return [
    'foo' => [
        'bar' => true,
        'baz' => 'something',
    ],
   // other config keys
];

Using YAML, I wanted to set baz to something else for a certain page:

---
extends: _layouts.master
section: content
foo:
  baz: 'something else'
---

Doing this currently replaces the/creates a new foo array. So this:

<pre>
    <code>{{ var_dump($page->foo) }}</code>
</pre>

... will output this:

object(TightenCo\Jigsaw\IterableObject)#390 (1) {
  ["items":protected]=>
  array(1) {
    ["baz"]=>
    string(21) "something else"
  }
}

If possible, it would be great if Jigsaw would merge in what you specify in YAML, instead of replacing the/creating a new foo. Hope this makes sense.

Thanks!

closed time in 14 days

cossssmin

issue closedtighten/jigsaw

Nested collections

I find that if I have a long tree of nested objects like this:

subject > topic > course > lesson

I have to include the subject, topic, and course in every lesson file. What if this was stored in the config file somehow like this?

'collections' => [
   'lessons' => [
       'path' => '...',
       'sort'  => '...',
       'variables' => [
             'subject' => '...',
             'topic' => '...',
             'course' => '...',
        ]
   ],
   ...
]

That way I don't have repeat all these variables in every single lesson file. Thoughts?

closed time in 14 days

dgursh

issue closedtighten/jigsaw

Internationalization

Would be cool also to be able to use the trans() helper to load translated content within a static site also...

closed time in 14 days

arenowebdev

release tighten/jigsaw

v1.3.38

released time in 15 days

created tagtighten/jigsaw

tagv1.3.38

Simple static sites with Laravel’s Blade.

created time in 15 days

push eventtighten/jigsaw

Keith Damiani

commit sha 1456ec0ebe4bfaeba5b8c27110f8c60a0754b043

Bump version to v1.3.38

view details

push time in 15 days

push eventtighten/jigsaw

Keith Damiani

commit sha b4cfade4fd49197e0aad7e5d455416e6eba23b09

Generalize cache path in PageDataBindingTest

view details

push time in 15 days

push eventtighten/jigsaw

Alessio

commit sha 250c25b09adad779bba41d14b998c172b16c256d

Give precedence to class based component

view details

Keith Damiani

commit sha 1859464eb2e115a402170de4be09362ee6424cff

Include additional changes from Illuminate\View

view details

Keith Damiani

commit sha c867aafd6a3903e2815efd7e0a45c1f62c568054

Merge pull request #560 from avvertix/bump-component-custom-class-loading-precedence Give precedence to class based component

view details

push time in 15 days

PR merged tighten/jigsaw

Give precedence to class based component

Thanks Tighten team for this static site generator.

Following the latest additions for Blade components support I want to propose a change in the anonymous vs class based component precedence giving precedence to class based ones.

Assuming a Blade template for the component is defined in _components, e.g. _components/image.blade.php, and the corresponding Component class defined, e.g. Image extends Component under the Components namespace, inverting the evaluation criteria for class based components with anonymous components allows to add methods and additional attributes to the component that otherwise would be ignored.

This probably covers my specific case in which I need to define an image component whose Blade file is located under _components/image.blade.php and whose logic, for processing the image file, is defined in the Image component class in the Components namespace. This is required for my experiment in adding support for cache busting and responsive images to the blog I'm working on.

+44 -7

2 comments

1 changed file

avvertix

pr closed time in 15 days

push eventavvertix/jigsaw

Keith Damiani

commit sha 1859464eb2e115a402170de4be09362ee6424cff

Include additional changes from Illuminate\View

view details

push time in 15 days

pull request commenttighten/jigsaw

Give precedence to class based component

This is a great idea, because it seems to bring the component behavior in line with the current version of Illuminate\View that Jigsaw is using and overriding, which has drifted a bit since we first implemented this. There are, however, some additional changes in the base ComponentTagCompiler class that I'd like to pick up ... would you mind if I add a commit to your PR to include those?

avvertix

comment created time in 16 days

push eventtighten/jigsaw

Jacob Baker-Kretzmar

commit sha 365a4b6c03686ed146345e32a35ca9405502ea45

Allow configurable view path separate from site source

view details

Jacob Baker-Kretzmar

commit sha 5458b4b8278d96a1578f3b78bcce257619de2a57

Wip

view details

Keith Damiani

commit sha e4dd07bd9bab5b5ee3bea844494d846483dc6e24

Update tests to include `views` key in buildPath

view details

Keith Damiani

commit sha 77db20a8a2307947be31143f8f3fb3278e98556b

Set 'views' buildPath in BuildCommand to allow 'source' overrides in config

view details

Jacob Baker-Kretzmar

commit sha 5bda8c27cb0d050855358e485b03e11a913430e7

Allow setting custom view path in tests

view details

Jacob Baker-Kretzmar

commit sha 7118ba2930919f3508548f7092bc3756defe9a91

Add test for custom view path

view details

Keith Damiani

commit sha ed8fc8b3d7074ec5929d737131e39adc23e0a667

Merge pull request #564 from tighten/jbk/configurable-view-path Allow configuration of Blade view path

view details

push time in 16 days

delete branch tighten/jigsaw

delete branch : jbk/configurable-view-path

delete time in 16 days

PR merged tighten/jigsaw

Reviewers
Allow configuration of Blade view path enhancement

This PR allows users to configure the location of the Blade view path. This facilitates, for example, storing Blade views somewhere other than source/. Defaults to source/ so should be entirely backwards compatible.

+49 -4

4 comments

4 changed files

bakerkretzmar

pr closed time in 16 days

pull request commenttighten/jigsaw

Allow configuration of Blade view path

Love it, great work!

bakerkretzmar

comment created time in 16 days

issue closedtighten/jigsaw

writeSourceFile should not override the source file

It would be cool if there was a method like writeSourceFile() which would let you modify the contents for the build, but not override the actual source file.

I guess there could be some temporary file content storage and jigsaw could check for every file if it is in that storage before loading it from the source directory.

closed time in 17 days

stancl

issue commenttighten/jigsaw

writeSourceFile should not override the source file

This would add a fair amount of overhead to all builds, particularly on larger sites, so I don't think we'll be adding this at the moment. In v2, we're considering adding more a more robust way to hook into (and modify) a source file during the build, before output, but I don't think that change will be tenable in the current version.

stancl

comment created time in 17 days

issue closedtighten/jigsaw

Inline stylesheet gives asset path is not valid error

Hi all, me again..

I have an odd issue whereby if I use mix in the usual way to get a stylesheet URL, all is well e.g.

<link rel="stylesheet" as=“style” href="{{ mix('/styles/priority.css', 'assets') }}">

Whereas if I want to inline this using {{ inline(mix(...)) }} the site is not build with the following error in the console

Given asset path is not valid: /assets/styles/priority.css?id=2b5d50028ff9afabaaea

Here's my usage...

<style>
{{ inline(mix('styles/priority.css', 'assets')) }}
</style>

I can see the file priority.css in my assets folder in both my /source directory and also in the correct build directory.

Here's a snippet from my webpack.mix.js file which deals with the separate css files..

    mix.setPublicPath('source/assets/');
    mix.disableSuccessNotifications();
    mix.jigsaw({
            watch: ['config.php', 'source/**/*.md', 'source/**/*.php', 'source/_assets/**/*.scss', 'source/_data/*.json', 'source/_assets/**/*.js'],
        })
        .sass('source/_assets/sass/main.scss', 'styles/main.css')
        .sass('source/_assets/sass/priority.scss', 'styles/priority.css')
        .options({
            processCssUrls: false
        })
        .version();

I've managed to find a work-around for this locally by instead relying on php to retrieve the files contents by doing this..

@php include public_path('assets/styles/priority.css') @endphp but it is too brittle for serious use..

Any help is greatly appreciated! :)

closed time in 17 days

imaje89
IssuesEvent

issue closedtighten/jigsaw

Ability to fetch remote collections

Hello, I just had a need to fetch collections from a remote API, and currently, it is possible to fetch only collection items. In this case, I have to set up all the collections before writing a method to fetch the data:

return [
    'collections' => [
        'posts' => [
            'extends' => '_layouts.post',
            'items' => function ($config) {
                $posts = json_decode(file_get_contents('https://jsonplaceholder.typicode.com/posts'));

                return collect($posts)->map(function ($post) {
                    return [
                        'title' => $post->title,
                        'content' => $post->body,
                    ];
                });
            },
        ],
    ],
];

What I need to accomplish is something like this:

return [
    'collections' => function () {
        $collections = json_decode(file_get_contents('http://api.laravel-cms.test/collections/'));

        return collect($collections)->mapWithKeys(function ($collection) {
            return [
                $collection->slug => [
                    'extends' => '_layouts.pages',
                    'items' => collect($collection->entries)->map(
                        fn ($entry) => [
                            'title' => $entry->title,
                            'description' => $entry->description
                        ]
                    ),
                ]
            ];
        });
    },
];

To make it possíble I modified the following code at TightenCo\Jigsaw\File\ConfigFile.php:


    protected function convertStringCollectionsToArray()
    {
        //$collections = $this->config->get('collections');
         $colletions = value(
             $this->config->get('collections')
         );

        if ($collections) {
            $this->config->put('collections', collect($collections)->flatMap(function ($value, $key) {
                return is_array($value) ? [$key => $value] : [$value => []];
            }));
        }
    }
}

Is it worth submitting a PR for this?

Thanks!

closed time in 17 days

leopoletto

issue commenttighten/jigsaw

Ability to fetch remote collections

Yes, I think this would be great! In the process, we should probably rename that method to something more generic like getCollectionsConfig(), since it is now parsing a function as well as an array or string.

leopoletto

comment created time in 17 days

pull request commenttighten/jigsaw

Allow configuration of Blade view path

@bakerkretzmar Tests were failing for me because of missing views keys in our test setup, where we set buildPath in the container directly.

It also led me to realize that defaulting views to /source in jigsaw-core means that users who set their own source directory in config.php, but who don't define a views key there, would end up with views erroneously being set to the default /source, rather than the directory that they had defined.

I think this all works now—tests all pass—but I feel like we should add tests for the actual behavior added in this PR, namely that setting a custom views directory in config works.

bakerkretzmar

comment created time in 17 days

push eventtighten/jigsaw

Keith Damiani

commit sha e4dd07bd9bab5b5ee3bea844494d846483dc6e24

Update tests to include `views` key in buildPath

view details

Keith Damiani

commit sha 77db20a8a2307947be31143f8f3fb3278e98556b

Set 'views' buildPath in BuildCommand to allow 'source' overrides in config

view details

push time in 17 days

push eventtighten/jigsaw-site

Jacob Baker-Kretzmar

commit sha 561b6dd8a2ab7cdd06c7e1320be1c85c0f869f40

Update npm packages and scripts, Mix build script, and formatting

view details

Jacob Baker-Kretzmar

commit sha 49566726cdd09a859cd283226109387ddbd8626c

Remove and ignore compiled assets

view details

Jacob Baker-Kretzmar

commit sha e3325bab2db7e6e86a564e6d9e8bd7d768dfbf35

Convert Less to vanilla CSS (with PostCSS)

view details

Jacob Baker-Kretzmar

commit sha 1bb510614f8ec195df5f5a9f1d33cdfb3bf33b8a

Gitignore cache

view details

Jacob Baker-Kretzmar

commit sha 05673fccde4429962a383775e2aa87b79d45a394

Remove unused colors

view details

Jacob Baker-Kretzmar

commit sha 8f67c819c716d36a1a4856b431f45cc58976d361

Remove `./index.html` from repo

view details

Jacob Baker-Kretzmar

commit sha bc4862c5c78b70e4942df3e7daef8013f351c0a2

Update to Tailwind v2

view details

Jacob Baker-Kretzmar

commit sha dc5ee4c815e097c06dfaf37a699d560777ec8779

Fix visual inconsistencies and consolidate some styles

view details

Jacob Baker-Kretzmar

commit sha 1d1edad018a06c68e06635cbab1953daff9e82c9

Wip

view details

Jacob Baker-Kretzmar

commit sha ae8009ff1182768ab9a916538add786ea87d5b9e

Wip

view details

Keith Damiani

commit sha 1b78b27cc3be7407ec668eac2dfaecf2bace5a8a

Merge pull request #83 from tighten/jbk/postcss Mix 6, PostCSS, and Tailwind v2

view details

push time in 17 days

delete branch tighten/jigsaw-site

delete branch : jbk/postcss

delete time in 17 days

PR merged tighten/jigsaw-site

Mix 6, PostCSS, and Tailwind v2

This PR modernizes the build process for the site somewhat, including switching from Less to PostCSS and upgrading to Laravel Mix 6 and Tailwind 2. Note that this PR targets main, which has already had a couple of PHP 8 and Netlify fixes applied.

  • Update to Laravel Mix 6 and explicitly require Webpack 5.
  • Completely remove Less and related packages and move all styles into app.css.
  • Update Jigsaw/Mix integration to use laravel-mix-jigsaw v2.
  • Upgrade Tailwind to v2:
    • Restructured config and renamed classes according to the upgrade guide.
    • Manually checked for visual parity on most pages.
    • Used an online image differ to check for pixel-perfect visual parity on a few pages.
    • Logo is about 4px wider on sm+ screens now due to a class that was previously missing from the Tailwind config.
    • Main content 'column' down the center of the documentation pages is 1rem wider on large screens.
    • Very small text line heights are slightly smaller in a couple places.
    • Removed unused colors and styles.

A lot more of the styles and markup can probably still be cleaned up further in the future.

Also sneaking into this PR:

  • Remove and gitignore compiled assets.
  • Remove extraneous index.html in the root of this repo.
+19346 -18438

2 comments

28 changed files

bakerkretzmar

pr closed time in 17 days

pull request commenttighten/jigsaw-site

Mix 6, PostCSS, and Tailwind v2

Woohoo! Thanks @bakerkretzmar!

bakerkretzmar

comment created time in 17 days