-
Notifications
You must be signed in to change notification settings - Fork 3
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
Replace Pug with Preact #21
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also rename `feed-rss` layout to `FeedAtom` because the feeds are actually Atom (but I call them RSS/Atom because I think the term "RSS" is more common)
It was only needed in Pug templates
Only `site.js` is used in content files (Markdown), so it'll remain under `data/`. Moving the files out from `data/` simplifies the global scope. Previously they had to be under `data/` because JS files can't be imported from Pug files, so I had to add the stuff to the global scope. `utils/utils.js` looks silly, but I'll tackle it soon.
Allows importing the file with just `.../utils` instead of `.../utils/utils`
Not a fan of these; I might create separate listings for drafts and scheduled posts...
Consistency!
✔️ Deploy Preview for mtsknn ready! 🔨 Explore the source changes: 01de3f3 🔍 Inspect the deploy log: https://app.netlify.com/sites/mtsknn/deploys/615b4183cbb5d01eea6d95d5 😎 Browse the preview: https://deploy-preview-21--mtsknn.netlify.app |
Simple benchmarks from Netlify before and after the PR:
Nice. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hope I didn't break anything... 😅
Why ditch Pug? Because:
.classname
syntax with classes that contain some special characters like a colon (:
). So instead of e.g.ul.px-2.md:px-4
, you have to type eitherul.px-2(class="md:px-4")
orul(class="px-2 md:px-4")
.I'm using HTM instead of JSX because HTM doesn't require a transpiler. HTM is OK, but JSX would be better. See my blog post JSX vs HTM for some differences.
Now that I'm using Preact, I can later implement partial hydration and use Preact and these same components in the browser as well.