Skip to content

DefGuard/defguard.github.io

Repository files navigation

defguard website

Defguard website built on Astro!

Editing content

Most of the content is written in HTML but some parts ware made with ease of configuration in mind.

JSON

Files inside data dare written in JSON format and contain configuration such as what items are shown in navigation and footer. Those configs are data only and so are not in Markdown

Markdown

Files that build content on website are written in .mdx files and are stored in collections within src/content directory.

Formatter

Every content file begins with special section that defines additional information for that file's context, for example title, order of display etc. You can find definitions of this information inside content.ts.

Content editing notes

Pricing

Pricing is a special case where we need to render MDX directly on client side only, this means importing any components in pricing collection is forbidden because it will not work. Raw HTML is still OK since we render it through rehype-raw.

Editor recommendation

VSCode is by far the easiest to setup.

Recommended extensions

To get syntax highlights and all the good stuff, first you need to have installed Node.js and dependencies for this project installed, look in Development section.

Extensions to install:

Development

Installing Node.js

Version of Node.js should be the same Major as the one specified in .nvmrc file.

Official source

Follow instructions from official site.

Node version manager (NVM)(Recommended for development)

Supports using dirreferent version of Node.js for each project.

After correct install, in root of the project use (once):

nvm install

And then:

nvm use

Installing dependencies

Make sure package manager pnpm is installed. If not use this command to install it:

npm i -g pnpm

Then run install dependencies with:

pnpm install

And then run development server with:

pnpm dev

Building project

With correct Node.js environment run:

pnpm build

After that, built project should be in dist directory inside project root.