Directory
Getting started with directory template.
This guide will walk you through the steps of installing, running locally, customizing, managing data for, and deploying the New UI directory template.
Structure
Once you’ve downloaded the template, you’ll find these folders and files inside:
.
├── public
│ └── icon.png
├── src
│ ├── components
│ │ ├── Card.css
│ │ ├── Card.jsx
│ │ ├── CardsContainer.css
│ │ ├── CardsContainer.jsx
│ │ ├── CategoryNav.css
│ │ ├── CategoryNav.jsx
│ │ ├── CategoryNavItem.css
│ │ ├── CategoryNavItem.jsx
│ │ └── Dashboard.jsx
│ ├── data
│ │ └── tools.json
│ ├── layouts
│ │ ├── Layout.astro
│ │ └── theme.js
│ ├── pages
│ │ └── index.astro
│ └── env.d.ts
├── .gitignore
├── astro.config.mjs
├── LICENSE.txt
├── package.json
├── pnpm-lock.yaml
├── README.md
└── tsconfig.json
Stack
- Astro
Prerequisites
- Node.js -
v20.9.0
or higher - Text editor
- Terminal
Installation
To install navigate into template folder and install the dependencies.
cd directory-XXX
pnpm i
Running locally
Start the development server.
pnpm run dev
If all goes well, you should be able to view the template running locally at http://localhost:4321/.
Template will listen for live file changes in your src/
folder, saving you the need to restart the server as you make changes during development.
Success! You are now ready to start customization.
If you aren’t able to run template in the browser, go back to the terminal where you ran the dev command and look to see if an error occurred, or if template is being served at a different URL than the one linked to above.
Customizing entries
The tools.json
file, located within the src/data/
folder, contains the directory entries. The development preview will update immediately upon any changes made to this file.
{
"tools": [
{
"title": "Tab Title",
"category": "category",
"content": [
{
"title": "Entry 01",
"body": "Description comes here.",
"tag": "Tag",
"url": "https://new-ui.com/templates"
},
{
"title": "Entry 02",
"body": "Description comes here.",
"tag": "Tab",
"url": "https://new-ui.com/templates/directory"
}
]
}
]
}
Building the app
Run build command to build the page.
pnpm run build
By default, the build output will be placed at dist/
. You may deploy this dist folder to any of your preferred platforms.
Deploying
Deploying your template is quick and easy. You can choose from several hosting providers and deploy using either their website dashboard or command-line interface (CLI).
A fast way to deploy your directory is to connect your online Git repository (like GitHub, GitLab, or Bitbucket) to a host provider. This lets you take advantage of continuous deployment using Git.
These host platforms automatically detect changes to your template’s code in your Git repository. They then build your site and deploy it to the web, using either a custom URL or your personal domain.
For detailed instructions on deploying your directory template on different platforms, please visit the Astro deployment guides.