-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate from Gatsby.js to Eleventy #103
Comments
This will likely be a separate process, but it would be cool to also update how I get content into the blog. Currently I'm writing in Bear/Notion/Trello, copying and pasting into VS Code, and committing via Git. It would be really cool to automate this so that content could go directly from my editor to the website. It's certainly possible with Notion (#98). |
Currently following this tutorial and enjoying the magical feeling it creates. |
Adding Time To Read to Eleventy
|
Adding Blog Posts By Tag List Page
|
Adding Tag List Page (with post counts)
|
Dark Mode Toggle |
Formatting post dates
const { DateTime } = require("luxon")
eleventyConfig.addFilter("postDate", (dateString) => DateTime.fromISO(dateString).toLocaleString(DateTime.DATE_MED)) |
Other random tweaks:
|
Filtering Specific Tag from listfilter: Line 85 in 47d746c
usage: simpixelated.com/src/blog.html Line 9 in 47d746c
|
Group posts by yearWhile I wanted to accomplish this with just Nunjucks filters, I couldn't figure out how to sort the years correctly. No matter what I did it wanted to go in descending order. First I added a custom attribute (computed data) to my posts like: module.exports = {
eleventyComputed: {
year: data => new Date(data.date).getFullYear()
}
}; and then I used it in the templates like so:
Like I said, this didn't work, so I eventually gave up and just used a custom collection: Lines 79 to 90 in 2591045
|
Social Share CardsI already have social share cards generated from https://github.com/emgoto/gatsby-plugin-react-social-cards so I want to use those. I accomplished that by adding a JavaScript data file in my simpixelated.com/src/posts/posts.11tydata.js Lines 1 to 9 in 5e6ef25
However, the beauty of that plugin is that it dynamically generated new social share cards for every post AND it updated existing posts if the data changed, all based on my own React component for styling. I would need to do something similar for Eleventy. Dynamic GenerationMost existing plugins and tutorials used Cloudinary, but I wanted something similar to my existing setup which would allow full control of the image by taking a screenshot of a page I designed.
The ☝️ 11ty tutorial above strangely uses Eleventy to create a .json script and populates a template with client-side JavaScript, instead of just having Eleventy generate the pages themselves with templates. It's a good base but needs to be modified to make it work the way I prefer. Found: 11ty/eleventy#712 (comment) Added a new layout that is used when a different build mode is run. Then I created a |
Deploy speed on Netlify went from 1-2 min to ~40 sec |
I've been using Gatsby.js for over 2 years now and while it is a pleasant publishing experience (mostly), it has been an extremely frustrating development experience. The problem isn't Gatsby itself, but the ecosystem, which includes the worst aspects of the entire JavaScript ecosystem: plugins for everything; unmaintained libraries, broken peer dependencies, etc. It feels like I spend more time fixing dependency errors than I do writing and publishing.
It seems I'm not the only one with these issues:
So I'm looking into alternatives. Here's my list of needs/wants:
Currently looking hard at Eleventy, but I'm open to alternatives.
The Process
stable
TODO:
The text was updated successfully, but these errors were encountered: