Writer
Getting started with writer template, a minimal blog template for developers and writers.
This guide will walk you through the steps of installing, running locally, customizing, managing content for, and deploying the New UI writer template.
Structure
Once you’ve downloaded the template, you’ll find these folders and files inside:
.
├── public/
├── src
│ ├── components/
│ ├── content/
│ ├── layouts/
│ ├── pages/
│ ├── styles/
│ └── utils/
├── astro.config.mjs
├── package.json
├── README.md
└── tsconfig.json
Stack
- Astro
Prerequisites
- Node.js -
v22.8.0or higher - Text editor
- Terminal
Installation
To install navigate into template folder and install the dependencies.
cd template-writer-XXX
bun i
Running locally
Start the development server.
bun 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.
Configuration
Configure the site by updating the src/config.ts file.
title:— title of the site.description:— description of the site.
Changing theme
The default theme is set to light. To change it, update the data-new-ui-theme attribute located within the src/layouts/BaseLayout.astro file.
<html lang={language} data-new-ui-theme="light">
| Available themes | Value |
|---|---|
| Light | light |
| Light warm (Default) | light--warm |
| Light cold | light--cold |
| Dark | dark |
| Dark warm | dark--warm |
| Dark cold | dark--cold |
Customizing blog content
The .md files, located within the src/content/posts/ folder, contain the blog entries. The development preview will update immediately upon any changes made to this file. Example file:
---
title: "Title of the post"
pubDate: YYYY-MM-DD
---
Add the content for your post here ...
Note: To mark a post as a draft, start the filename with an underscore
_to hide it from publishing.
Building the app
Run build command to build the page.
bun 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.