Skip to content

ProjectLayout

yCENzh edited this page Sep 19, 2026 · 1 revision

Project layout

After npx shirones init:

my-blog/
├── astro.config.mjs          # the only Astro config you touch
├── tsconfig.json             # theme path aliases (@/, @components/, …)
├── package.json
├── pnpm-workspace.yaml       # pnpm install-script approvals
├── src/
│   ├── content.config.ts     # collection definitions (generated)
│   ├── components/           # empty until you override something
│   └── layouts/              # empty until you override something
├── shirones/
│   ├── config/               # site configuration — yours to edit
│   │   └── data/             # friends, projects, skills, timeline, …
│   └── content/              # your writing
│       ├── posts/
│       ├── moments/
│       ├── spec/
│       └── series/
└── public/                   # favicons, static assets

Generated along the way, and safe to delete:

├── .astro/                   # Astro's typegen and content cache
├── .shirones/
│   ├── loaded/               # esbuild bundles of your config modules
│   └── fonts/                # subsetted .woff2 files
├── .shirones-backup/         # only appears after `init --force`
└── dist/                     # build output

What is yours

shirones/config/ — every file here shadows the theme's default of the same name. Edit freely. Deleting a file falls back to the theme's version, which is the easy way to undo a config you have outgrown.

shirones/config/data/ — the list-shaped content: friends, projects, skills, games, devices, timeline entries, anime, compass. These are TypeScript modules rather than markdown because the pages that render them want typed records.

shirones/content/ — your writing. Four collections, described in Content.

src/components/ and src/layouts/ — empty by default. Anything you put here that mirrors a theme path replaces that theme file. See Overriding components.

public/ — favicons and anything you want served verbatim.

astro.config.mjs — starts as a near-empty file:

import { defineConfig } from "astro/config";
import shirones from "shirones";

export default defineConfig({
  integrations: [shirones()],
});

Site URL, base path, trailing slashes, image endpoint, fonts, markdown processor, Vite plugins and the bundled integrations are all set by the integration. You add to this file when you want to override one of those, and everything you accept is in Integration options.

What is generated

src/content.config.ts is generated by init from the theme's collection manifest. It defines the four collections and imports their schemas from the package:

import { defineCollection } from "astro:content";
import { glob } from "astro/loaders";
import { postSchema, momentSchema, specSchema, seriesSchema } from "shirones/collections";

export const collections = {
  posts: defineCollection({
    loader: glob({ base: "./shirones/content/posts", pattern: "**/*.{md,mdx}" }),
    schema: postSchema,
  }),
  // …
};

Schemas are inline rather than hidden behind a helper because Astro's typegen has to be able to see them. Edit the base paths if you move your content directory. Do not hand-edit the schemas — they come from the theme, and init --update will not touch this file's generated parts but will not fix a schema you rewrote either.

What you do not have

There is no src/pages/. The theme's pages live inside the package and are registered with injectRoute at config time. That is why astro dev serves /archive, /tags, /friends and the rest even though your project has no page files.

If you want your own pages, add src/pages/ normally — Astro merges them with the injected routes. To drop a theme page instead of adding one, use excludeRoutes:

shirones({ excludeRoutes: ["/anime", "/devices"] })

There is no svelte.config.js. The theme's Svelte components use <style lang="stylus">, and the integration supplies vitePreprocess itself. Editor tooling may want a svelte.config.js for IntelliSense; the build does not.

Importing from the package

Three entry points are public:

import shirones from "shirones";                    // the integration
import { postSchema } from "shirones/collections";  // collection schemas
import type { SiteConfig } from "shirones/types/config";  // types

shirones/src/... paths resolve, and the theme's own code uses them internally, but they are not part of the contract and move between releases. If you need a theme file, mirror its path in your own src/ tree instead — that is the override mechanism, and it is stable.

Next

Clone this wiki locally