GithubHelp home page GithubHelp logo

Comments (3)

tnylea avatar tnylea commented on August 10, 2024 1

Thanks @marcfilleul

Really appreciate it! I'm super pumped about this project. I was often looking for a Simple Static Site Generator, but hadn't really found one that made me happy or excited. That's why Static was born 😄

That Eleventy fetch package would probably work really well. Do you know the JSON format that is output from Airtable?

Here are a few ways we might do that

Using the Markdown as content

As long as the Markdown files get placed in the content folder it should be able to parse it. If it has frontmatter, you should be able to access it like normal.

On the otherhand if you wanted to loop through data such as a set of posts, you could add that as a collection.

Using the data in a collection

If you want to use that data as a collection, you could create it as a JSON file, such as posts.json in the collections folder. This could change down the road, but for now collections only work with a flat array of JSON data, like this:

[
    {
        "title": "Title Here",
        "description" : "description here..."
    },
    {
        "title": "Title 2 Here",
        "description" : "description 2 here..."
    },
    {
        "title": "Title 3 Here",
        "description" : "description 3 here..."
    }
]

Whereas this would not work:

[
    {
        "title": "Title Here",
        "description" : "description here...",
        "date" : {
            "month" : "Jan",
            "year" : "2018"
        }
    }
]

Unless you transformed that data 👆 into a flat array and then placed it to the collections folder.

I've also thought about the idea of adding a 'Plugin' system, where you could build additional functionality into Static by leveraging events throughout the build process. Let me know your thoughts 😁

Thanks as well for being the first issue submitter 👏

from static.

marcfilleul avatar marcfilleul commented on August 10, 2024

I realize I should try to work on it before asking so let's pause this issue for now ;)

I'm going to try eleventy-fetch to fetch external json data and see if I can make it work.

Regarding the Airtable flavoured markdown coming from my json data, I will make some tests too.

from static.

marcfilleul avatar marcfilleul commented on August 10, 2024

Thanks a lot for the detailed answer!
My json output from Airtable is not a flat array so it will spare me some time scratching my head 😅

I made some tests to see how far I could go compared to the Astro starter I've tailored for my clients.
There are too many limitations for my needs currently but I will follow this great journey!

I'll be happy to use Static for side projects and to help with feedbacks or ideas.

Keep up the good work 👏
Best regards.

from static.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.