Thank you for collaborating and your advice is always very useful.
It would be extraordinary if it is loaded only if you are in the post, please help me with it
Thank you for collaborating and your advice is always very useful.
It would be extraordinary if it is loaded only if you are in the post, please help me with it
Hi @jesus.designer!
I’ve just opened a Pull Request with the changes needed for the code-splitting, so it just loads when a pre tag is present.
I’ll try to explain it better on Monday and work on the documentation for this, but if you have any questions don’t hesitate to tell us
Actually it only loads that code when the React component is included, so only when the post has a <pre>
tag.
Mario will prepare the guide next week
By the way, are you using Gutenberg code blocks? Why the brush:
class?
It´s the way of WordPress .com has mark the language.
I have used Syntaxhighlighter Code block, but soon I will change to own WordPress .org
Ohh, I see. I didn’t know that block, only the regular Code
one.
So this one outputs:
<pre class="brush: jscript;" title=""> var a = "A"; </pre>
Yes!
Oh Thx! I’m learning a lot
I have created a proper builder for Now. That means the npx frontity build
happens on the cloud, not on your computer and you can put the build
folder in your gitignore file.
I have not published it yet to npm
but I’ll try to do it as soon as possible
This is the repo:
I’ve published the version 1.0.0 of the builder: https://github.com/frontity/now-builder
Docs are updated as well: https://docs.frontity.org/installation-and-deploy/deploy-on-now
You should be able to remove all the files of your /build
folder, add build
to the .gitignore
file so they don’t get committed to github, change the now.json
file, and get new deploys each time you push code to github.
Let us know if everything works as expected.
I have already updated the blog and it is working
I change the API server to my own WordPress, next steps Yoast API and Gutenberg blocks
Awesome!
@david is working on the yoast plugin and @SantosGuillamot is investigating the best way to support Gutenberg, probably with a package
Oh, and I saw you’ve added disqus comments! That’s great. We had a package in the past for disqus-comments and we’ll migrate it to the new framework as well in the coming months.
Hey @jesus.designer, I’ve been taking a look at your site again. I think you can improve the LightHouse score if:
useInView
hook to lazy load the it when the user scrolls down. Something like this (I’m doing this from memory, I haven’t tested it):const Comments = () => {
// It appears 600px before this div enters the viewport.
const [isVisible, ref] = useInView({ rootMargin: "-600px" });
return (
<div ref={ref}>
{isVisible && <Disqus />}
</div>
}
What do you think? Do you want to try?
Oh! Thank you, I get to work
Updated dependencies and fixed lazy loading of images
Implemented useInView
Embed fonts
But, I have a feeling that the rootMargin parameter is not working, can you help me?
I think so, it worked perfectly for me
Uh, maybe it’s rootMargin: "600px"
. Did you try?
Hey, awesome. The blog post went from 43 to 86 with just those changes
We will add a Performance section in our docs to teach about all these small optimizations.
Simple and powerful tips, Thx