Skip to content

Things to remember

Updated: at 11:33 PM

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

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:

CommandAction
npm installInstalls dependencies
npm run devStarts local dev server at localhost:4321
npm run buildBuild your production site to ./dist/
npm run previewPreview your build locally, before deploying
npm run format:checkCheck code format with Prettier
npm run formatFormat codes with Prettier
npm run syncGenerates TypeScript types for all Astro modules. Learn more.
npm run czCommit code changes with commitizen
npm run lintLint with ESLint
docker compose up -dRun AstroPaper on docker, You can access with the same hostname and port informed on dev command.
docker compose run app npm installYou 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.