Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
trueberryless authored Jan 19, 2025
0 parents commit 2d8d4b7
Show file tree
Hide file tree
Showing 29 changed files with 5,923 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["docs"]
}
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# EditorConfig is awesome: https://EditorConfig.org

root = true

[*]
charset = utf-8
indent_size = 2
indent_style = tab
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# documentation, utils
[*.{md,mdx,diff}]
trim_trailing_whitespace = false
39 changes: 39 additions & 0 deletions .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Changesets
on:
push:
branches:
- main
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
version:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v3
- name: Setup Node.js based on .node-version
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version-file: ".node-version"
cache: "pnpm"
- name: Install Dependencies
run: pnpm install --frozen-lockfile
shell: bash

- name: create and publish versions
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- main

jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome check --write
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5
with:
commit_message: "Biome format"
branch: ${{ github.head_ref }}
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.5.1
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 NAME

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Starlight Theme Template

Follow these steps to create your new Starlight theme.

- [ ] Update the package name, author, and URL in [packages/theme/package.json](packages/theme/package.json) and the [README](packages/theme/README.md), and remove `"private": true` from `package.json`.
- [ ] Update the dependency in [apps/docs/package.json](apps/docs/package.json) and [apps/docs/astro.config.ts](apps/docs/astro.config.ts) to your new theme package name.
- [ ] Update the [LICENSE](LICENSE) to include your name.
- [ ] Add your theme name/description/logos to the docs in [apps/docs/astro.config.ts](apps/docs/astro.config.ts).
- [ ] Add your custom styles to [packages/theme/styles/theme.css](packages/theme/styles/theme.css).
- [ ] Take a fancy screenshot of your theme and place it in [assets/preview.png](assets/preview.png)
- [ ] Add an `NPM_TOKEN` env variable to your GitHub repo.
- [ ] Deploy the docs to your favorite hosting provider.
- [ ] Run `pnpm changeset` and give your project a major bump for an initial release.
- [ ] Push/merge to main, and publish a release by merging the changeset PR.
- [ ] Delete this file, and run `ln -s packages/theme/README.md README2.md` to create a symlink to your package README, and share your theme with the world!
31 changes: 31 additions & 0 deletions apps/docs/astro.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import starlight from "@astrojs/starlight";
import { defineConfig } from "astro/config";
import theme from "starlight-theme-template";

// https://astro.build/config
export default defineConfig({
site: "https://starlight-theme-theme.netlify.app",
integrations: [
starlight({
title: "Starlight Theme Template",
favicon: "/favicon.svg",
social: {
github: "https://github.com/TheOtterlord/starlight-theme-template",
},
sidebar: [
{
label: "Guides",
items: [
// Each item here is one entry in the navigation menu.
{ label: "Install", slug: "guides/install" },
],
},
{
label: "Reference",
autogenerate: { directory: "reference" },
},
],
plugins: [theme()],
}),
],
});
22 changes: 22 additions & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "docs",
"type": "module",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "catalog:",
"@astrojs/starlight": "catalog:",
"astro": "catalog:",
"sharp": "catalog:",
"starlight-package-managers": "^0.8.0",
"starlight-theme-template": "workspace:*",
"typescript": "catalog:"
}
}
1 change: 1 addition & 0 deletions apps/docs/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/src/assets/houston.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions apps/docs/src/content.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineCollection } from "astro:content";
import { docsLoader } from "@astrojs/starlight/loaders";
import { docsSchema } from "@astrojs/starlight/schema";

export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
};
31 changes: 31 additions & 0 deletions apps/docs/src/content/docs/guides/install.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Install Theme
description: Install the template theme for Starlight.
---

import { Steps } from '@astrojs/starlight/components';
import { PackageManagers } from 'starlight-package-managers'

<Steps>

1. Install the theme package to your project with your preferred package manager:
<PackageManagers pkg="starlight-theme-template"/>

2. Add the theme to your Starlight config.
```ts title="astro.config.mjs" ins={1,9}
import theme from "starlight-theme-template";

export default defineConfig({
// ...
integrations: [
starlight({
// ...
plugins: [
theme()
]
})
]
})
```

</Steps>
13 changes: 13 additions & 0 deletions apps/docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Starlight Theme Template
description: A theme plugin template Starlight
template: splash
hero:
tagline: A theme plugin template Starlight
image:
file: ../../assets/houston.png
actions:
- text: Install Theme
link: /guides/install
icon: right-arrow
---
93 changes: 93 additions & 0 deletions apps/docs/src/content/docs/reference/components.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
title: Components
---

import { Card } from '@astrojs/starlight/components';
import { LinkCard } from '@astrojs/starlight/components';
import { Aside } from '@astrojs/starlight/components';
import { Badge } from '@astrojs/starlight/components';
import { Code } from '@astrojs/starlight/components';
import { FileTree } from '@astrojs/starlight/components';
import { Icon } from '@astrojs/starlight/components';
import { LinkButton } from '@astrojs/starlight/components';
import { Steps } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';

## Card
<Card title="Check this out" icon="star">Interesting content you want to highlight.</Card>

## Link Card
<LinkCard title="Example Guide" href="/guides/install/" description="Description goes here!" />

## Asides
<Aside>Some content in an aside.</Aside>
<Aside type="caution">Some cautionary content.</Aside>
<Aside type="tip">

Other content is also supported in asides.

```js
// A code snippet, for example.
```

</Aside>
<Aside type="danger">Do not give your password to anyone.</Aside>

## Badge
<Badge text="Note" variant="note" />
<Badge text="Success" variant="success" />
<Badge text="Tip" variant="tip" />
<Badge text="Caution" variant="caution" />
<Badge text="Danger" variant="danger" />
<Badge text="New" size="small" />
<Badge text="New and improved" size="medium" />
<Badge text="New, improved, and bigger" size="large" />

## Code
export const exampleCode = `console.log('This could come from a file or CMS!');`;
export const fileName = 'example.js';
export const highlights = ['file', 'CMS'];

<Code code={exampleCode} lang="js" title={fileName} mark={highlights} />

## File Tree
<FileTree>

- astro.config.mjs
- package.json
- src
- components
- **Header.astro**
- Title.astro
- pages/

</FileTree>

## Icons
<Icon name="star" />
<Icon name="starlight" label="The Starlight logo" />

## Link Button
<LinkButton href="/guides/install/">Installation Guide</LinkButton>
<LinkButton href="/guides/install/" variant="secondary">
Installation Guide
</LinkButton>

## Tabs
<Tabs>
<TabItem label="Stars">Sirius, Vega, Betelgeuse</TabItem>
<TabItem label="Moons">Io, Europa, Ganymede</TabItem>
</Tabs>

## Steps
<Steps>

1. Import the component into your MDX file:

```js
import { Steps } from '@astrojs/starlight/components';
```

2. Wrap `<Steps>` around your ordered list items.

</Steps>
2 changes: 2 additions & 0 deletions apps/docs/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
3 changes: 3 additions & 0 deletions apps/docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "astro/tsconfigs/strict"
}
Binary file added assets/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"files": {
"ignoreUnknown": true,
"ignore": ["**/.astro/**", "**/package.json", "**/dist/**"]
}
}
Loading

0 comments on commit 2d8d4b7

Please sign in to comment.