As this site means lots of new learning for me I figured I should add a couple of things to a list that I can go back to. This is that list.
Table of contents
Open Table of contents
To-do
- Fix the search (I seem to have broken it)
- Sort out icons for Fediverse services (instead of Mastodon icons, as I don’t use Mastodon)
Npm and Ncu stuff
Updating things to the latest/greatest is a good thing. With javascript based modern websites this can be a challenge as they are basically long strings on dependencies. It was a great relief to find a way to make that updating somewhat easier.
ncu -i
is a good thing. The manual for it can be found here. That also means ncu -i --target minor
can be a good thing to run now and then, as it will also check for minor dependencies. When running it just now it actually updated Astro itself, so yeah, probably good to run this fairly regularly.
Some other general helpful commands for Astro in general and this theme in particular:
Command | Action |
---|---|
npm install | Installs dependencies |
npm run dev | Starts local dev server at localhost:4321 |
npm run build | Build your production site to ./dist/ |
npm run preview | Preview your build locally, before deploying |
npm run format:check | Check code format with Prettier |
npm run format | Format codes with Prettier |
npm run sync | Generates TypeScript types for all Astro modules. Learn more. |
npm run cz | Commit code changes with commitizen |
npm run lint | Lint with ESLint |
docker compose up -d | Run AstroPaper on docker, You can access with the same hostname and port informed on dev command. |
docker compose run app npm install | You can run any command above into the docker container. |
General file handling
There are a couple of options for handling snippets and templates etc in nvim, but all of them are a bit clunky to operate if you manage to get them setup properly. This might be where I have failed, but regardless, I’ve found it easier/simpler/quicker to create a template-post.md
and then just cat template-post.md > new-amazing-post.md
than fiddle with, and remember short keys for, getting the template in to a snippet that I somehow implement in a new post. Sometimes simple is better, and it most definitely does the job.