Skip to content

Commit

Permalink
Merge branch 'main' into tbl-feat-reading-time
Browse files Browse the repository at this point in the history
  • Loading branch information
trueberryless authored Dec 23, 2024
2 parents 0902a29 + fb46bad commit cf1f6ea
Show file tree
Hide file tree
Showing 53 changed files with 3,187 additions and 2,303 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)
12 changes: 12 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "HiDeoo/starlight-blog" }
],
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["starlight-blog-docs"]
}
47 changes: 47 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: autofix.ci

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:

permissions:
contents: read

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}

jobs:
autofix:
name: Format code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8.6.9

- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 18

- name: Install dependencies
run: pnpm install

- name: Format code
run: pnpm format

- name: Run autofix
uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
with:
fail-fast: false
6 changes: 5 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration
name: integration

on:
push:
Expand All @@ -9,6 +9,10 @@ on:
- main
workflow_call:

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}

jobs:
lint_test:
name: Lint & Test
Expand Down
38 changes: 16 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
name: Release
name: release

on:
push:
tags:
- 'v*.*.*'
branches:
- main

jobs:
integration:
name: Integration
uses: ./.github/workflows/integration.yml

publish:
name: Publish
needs:
- integration
changeset:
name: Changeset
if: ${{ github.repository_owner == 'hideoo' }}
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -34,19 +30,17 @@ jobs:
with:
cache: pnpm
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install

- name: Publish
run: pnpm publish --no-git-checks
working-directory: packages/starlight-blog
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- name: Generate changelog
uses: hideoo/changelogithub-action@v1
- name: Create Release Pull Request or Publish
uses: changesets/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: pnpm run version
publish: pnpm changeset publish
commit: 'ci: release'
title: 'ci: release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.14.1
v18.17.1
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.astro
.changeset
.github/blocks
.next
.vercel
Expand All @@ -10,3 +11,4 @@ dist
dist-ssr
out
pnpm-lock.yaml
test-results
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"eslint.experimental.useFlatConfig": true,
"eslint.useFlatConfig": true,
"eslint.validate": [
"javascript",
"javascriptreact",
Expand Down
12 changes: 0 additions & 12 deletions docs/.prettierignore

This file was deleted.

2 changes: 2 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import starlightBlog from 'starlight-blog'
export default defineConfig({
integrations: [
starlight({
description: 'Starlight plugin to add a blog to your documentation.',
locales: {
root: { label: 'English', lang: 'en' },
fr: { label: 'Français', lang: 'fr' },
Expand Down Expand Up @@ -46,6 +47,7 @@ export default defineConfig({
{ label: 'Demo', link: '/blog/' },
],
social: {
blueSky: 'https://bsky.app/profile/hideoo.dev',
github: 'https://github.com/HiDeoo/starlight-blog',
},
title: 'Starlight Blog',
Expand Down
17 changes: 9 additions & 8 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starlight-blog-docs",
"version": "0.14.1",
"version": "0.15.0",
"license": "MIT",
"description": "Starlight plugin to add a blog to your documentation.",
"author": "HiDeoo <[email protected]> (https://hideoo.dev)",
Expand All @@ -11,17 +11,17 @@
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
"lint": "eslint . --cache --max-warnings=0"
},
"dependencies": {
"@astrojs/starlight": "0.28.3",
"@hideoo/starlight-plugins-docs-components": "^0.2.2",
"astro": "4.16.4",
"sharp": "0.32.5",
"@astrojs/starlight": "^0.30.1",
"@hideoo/starlight-plugins-docs-components": "^0.3.0",
"astro": "^5.0.5",
"sharp": "^0.33.5",
"starlight-blog": "workspace:*"
},
"engines": {
"node": ">=18.14.1"
"node": ">=18.17.1"
},
"packageManager": "[email protected]",
"private": true,
Expand All @@ -36,7 +36,8 @@
"homepage": "https://github.com/HiDeoo/starlight-blog",
"repository": {
"type": "git",
"url": "https://github.com/HiDeoo/starlight-blog.git"
"url": "https://github.com/HiDeoo/starlight-blog.git",
"directory": "docs"
},
"bugs": "https://github.com/HiDeoo/starlight-blog/issues"
}
Binary file added docs/src/assets/showcase/biomejs.dev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/src/content/config.ts → docs/src/content.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { docsLoader, i18nLoader } from '@astrojs/starlight/loaders'
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'
import { defineCollection } from 'astro:content'
import { blogSchema } from 'starlight-blog/schema'

export const collections = {
docs: defineCollection({
loader: docsLoader(),
schema: docsSchema({
extend: (context) => blogSchema(context),
}),
}),
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
i18n: defineCollection({ loader: i18nLoader(), schema: i18nSchema() }),
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ tags:

Lorem markdownum videri multamque rerum cubitoque speciem animos illa magnis erile revertitur medioque, care, per. Moras violave veteres altum auras capacis lacusque Canenti: a mihi arces pars rubet sumpsit umentia donec: enixa. Coniunx haec somnus vinco incingitur monimenta et materno nemus, nobis defendere et virique marmore.

:::note
import { Aside } from '@astrojs/starlight/components'

<Aside>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean consequat nulla id ante aliquam, sed tempor erat fringilla.

```
address_google.public_cross(query_mebibyte + adc_utility_bar, 92);
```

:::
</Aside>

```
if (gigahertz_kernel + 1 + hexadecimal_grep_css(device, popPretestDisk(cron_screenshot_e))) {
Expand All @@ -38,7 +41,7 @@ if (desktop.state_cloud(station_trojan, addressSystem, saas_postscript_disk)) {
}
```

Umbram Aram doloris oraque Eurystheus sive **velleris**. **Flumina currendo fert**, siccat, non hanc quod spreto, quem.
Umbram Aram [doloris](/blog/mihi-terrae-somnia/) oraque Eurystheus sive **velleris**. **Flumina currendo fert**, siccat, non hanc quod spreto, quem.

## Demittere remis

Expand Down
6 changes: 4 additions & 2 deletions docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,20 @@ import { PackageManagers } from '@hideoo/starlight-plugins-docs-components'
})
```

3. Starlight Blog uses Astro’s [content collections](https://docs.astro.build/en/guides/content-collections/), which are configured in the `src/content/config.ts` file.
3. Starlight Blog uses Astro’s [content collections](https://docs.astro.build/en/guides/content-collections/), which are configured in the `src/content.config.ts` file.

Update the content config file to add support for customizing individual blog posts using their frontmatter:

```diff lang="ts"
// src/content/config.ts
// src/content.config.ts
import { defineCollection } from 'astro:content';
import { docsLoader } from '@astrojs/starlight/loaders';
import { docsSchema } from '@astrojs/starlight/schema';
+import { blogSchema } from 'starlight-blog/schema'

export const collections = {
docs: defineCollection({
loader: docsLoader(),
schema: docsSchema({
+ extend: (context) => blogSchema(context)
})
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hero:
- text: Demo
link: /blog
variant: minimal
icon: external
icon: right-arrow
---

import { Card, CardGrid } from '@astrojs/starlight/components'
Expand Down
5 changes: 5 additions & 0 deletions docs/src/content/docs/resources/showcase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ Starlight Blog is already being used in production. These are some of the sites
href: 'https://openresource.dev/articles/',
title: 'Open {re}Source',
},
{
thumbnail: import('../../../assets/showcase/biomejs.dev.png'),
href: 'https://biomejs.dev/blog/',
title: 'Biome',
},
]}
/>

Expand Down
2 changes: 0 additions & 2 deletions docs/src/env.d.ts

This file was deleted.

File renamed without changes.
38 changes: 17 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{
"name": "starlight-blog-monorepo",
"version": "0.14.1",
"version": "0.15.0",
"license": "MIT",
"description": "Starlight plugin to add a blog to your documentation.",
"author": "HiDeoo <[email protected]> (https://hideoo.dev)",
"type": "module",
"scripts": {
"test": "pnpm --stream -r test",
"lint": "pnpm -r lint",
"prepare": "husky install"
"lint": "astro check --noSync && pnpm -r lint",
"format": "prettier -w --cache --ignore-unknown .",
"version": "pnpm changeset version && pnpm i --no-frozen-lockfile"
},
"devDependencies": {
"@hideoo/eslint-config": "3.0.0",
"@hideoo/prettier-config": "2.0.0",
"@hideoo/tsconfig": "2.0.1",
"astro": "4.16.4",
"eslint": "8.56.0",
"husky": "8.0.3",
"lint-staged": "14.0.1",
"prettier": "3.0.3",
"prettier-plugin-astro": "0.12.0",
"typescript": "5.2.2"
"@astrojs/check": "^0.9.4",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.10",
"@hideoo/eslint-config": "^4.0.0",
"@hideoo/prettier-config": "^2.0.0",
"@hideoo/tsconfig": "^2.0.1",
"astro": "^5.0.5",
"eslint": "^9.17.0",
"prettier": "^3.4.2",
"prettier-plugin-astro": "^0.14.1",
"typescript": "^5.7.2"
},
"engines": {
"node": ">=18.14.1"
"node": ">=18.17.1"
},
"packageManager": "[email protected]",
"private": true,
Expand All @@ -40,11 +42,5 @@
"type": "git",
"url": "https://github.com/HiDeoo/starlight-blog.git"
},
"bugs": "https://github.com/HiDeoo/starlight-blog/issues",
"lint-staged": {
"*": [
"prettier -w -u --cache",
"eslint --cache --no-warn-ignored --max-warnings=0"
]
}
"bugs": "https://github.com/HiDeoo/starlight-blog/issues"
}
1 change: 1 addition & 0 deletions packages/starlight-blog/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src
test-results
Loading

0 comments on commit cf1f6ea

Please sign in to comment.