Skip to content

Commit

Permalink
docs: new website
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-ub committed Sep 28, 2024
1 parent be827d6 commit f4bf41f
Show file tree
Hide file tree
Showing 131 changed files with 3,575 additions and 4,981 deletions.
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ pnpm-debug.log*

# macOS-specific files
.DS_Store

# jetbrains setting folder
.idea/
18 changes: 0 additions & 18 deletions docs/.vscode/simple-query.code-snippets

This file was deleted.

47 changes: 47 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Astro Starter Kit: Minimal

```sh
npm create astro@latest -- --template minimal
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/minimal)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/minimal/devcontainer.json)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```text
/
├── public/
├── src/
│ └── pages/
│ └── index.astro
└── package.json
```

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
169 changes: 88 additions & 81 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,97 +1,104 @@
import angular from '@analogjs/astro-angular'
import starlight from '@astrojs/starlight'
import mdx from '@astrojs/mdx'
import sitemap from '@astrojs/sitemap'
import tailwind from '@astrojs/tailwind'
import { transformerMetaHighlight } from '@shikijs/transformers'
import { defineConfig } from 'astro/config'
import AutoImport from 'astro-auto-import'

import { visit } from 'unist-util-visit'
import { siteConfig } from './src/config/site'
import blackout from './theme/dark.json'

import theme from './src/lib/highlighter-theme.json'
// Función recursiva para extraer todos los valores de texto
function extractText(node) {
if (node.type === 'text') {
return node.value
}
if (node.children) {
return node.children.map(extractText).join('')
}
return ''
}

// https://astro.build/config
export default defineConfig({
site: siteConfig.url,
trailingSlash: 'never',
integrations: [
starlight({
title: siteConfig.name,
titleDelimiter: '-',
expressiveCode: {
themes: [theme],
styleOverrides: {
textMarkers: {
markHue: 'rgba(63,63,70,.5)',
},
},
},
logo: { src: './src/assets/logo.svg' },
favicon: '/favicon.ico',
social: {
'github': siteConfig.links.github,
'x.com': siteConfig.links.twitter,
},
sidebar: [
{
label: 'Getting Started',
items: [
{
label: 'Introduction',
slug: 'docs',
},
{
label: 'Installation',
slug: 'docs/installation',
},
{
label: 'components.json',
slug: 'docs/components-json',
},
{
label: 'Theming',
slug: 'docs/theming',
},
{
label: 'CLI',
slug: 'docs/cli',
},
{
label: 'Typography',
slug: 'docs/components/typography',
},
],
},
{
label: 'Components',
autogenerate: {
directory: 'docs/components',
},
},
],
customCss: ['./src/fonts/font-face.css', './src/tailwind.css'],
components: {
Header: './src/components/starlight/header/Header.astro',
SiteTitle: './src/components/starlight/SiteTitle.astro',
SocialIcons: './src/components/starlight/SocialIcons.astro',
Search: './src/components/starlight/Search.astro',
Hero: './src/components/starlight/Hero.astro',
ContentPanel: './src/components/starlight/ContentPanel.astro',
PageTitle: './src/components/starlight/PageTitle.astro',
MarkdownContent: './src/components/starlight/MarkdownContent.astro',
TwoColumnContent: './src/components/starlight/TwoColumnContent.astro',
Sidebar: './src/components/starlight/Sidebar.astro',
Pagination: './src/components/starlight/Pagination.astro',
MobileMenuToggle: './src/components/starlight/MobileMenuToggle.astro',
PageFrame: './src/components/starlight/PageFrame.astro',
PageSidebar: './src/components/starlight/PageSidebar.astro',
},
mdx(),
angular(),
tailwind({
applyBaseStyles: false,
}),
AutoImport({
imports: [
'@/components/ComponentPreview.astro',
'@/components/ComponentSource.astro',
],
sitemap({
serialize(item) {
if (item.url === siteConfig.url) {
item.changefreq = 'daily'
item.lastmod = new Date()
item.priority = 1
}
else {
item.changefreq = 'daily'
item.lastmod = new Date()
item.priority = 0.9
}
return item
},
}),
tailwind(),
angular(),
],
markdown: {
shikiConfig: {
theme: blackout,
transformers: [transformerMetaHighlight()],
},
rehypePlugins: [
() => (tree) => {
visit(tree, 'element', (node) => {
if (node.tagName !== 'pre')
return

const [codeEl] = node.children

if (codeEl.tagName !== 'code')
return

const rawString = extractText(codeEl)

node.properties = node.properties || {}
node.properties.rawString = rawString
})
},
() => (tree) => {
visit(tree, 'element', (node) => {
if (node.tagName !== 'pre')
return

const rawString = node.properties.rawString

// npm install.
if (rawString?.startsWith('npm install')) {
node.properties.npmCommand = rawString
node.properties.yarnCommand = rawString.replace('npm install', 'yarn add')
node.properties.pnpmCommand = rawString.replace('npm install', 'pnpm add')
}

// npx create.
if (rawString?.startsWith('npx create-')) {
node.properties.npmCommand = rawString
node.properties.yarnCommand = rawString.replace('npx create-', 'yarn create ')
node.properties.pnpmCommand = rawString.replace('npx create-', 'pnpm create ')
}

// npx.
if (rawString?.startsWith('npx') && !rawString.startsWith('npx create-')) {
node.properties.npmCommand = rawString
node.properties.yarnCommand = rawString
node.properties.pnpmCommand = rawString.replace('npx', 'pnpm dlx')
}
})
},
],
},
redirects: {
'/docs/components': '/docs/components/accordion',
},
Expand Down
53 changes: 24 additions & 29 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,54 @@
{
"name": "docs",
"name": "playground",
"type": "module",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@analogjs/astro-angular": "^1.7.2",
"@angular-devkit/build-angular": "^18.2.1",
"@angular/animations": "^18.2.1",
"@analogjs/astro-angular": "^1.8.1",
"@angular/animations": "^18.2.5",
"@angular/cdk": "^18.2.1",
"@angular/common": "^18.2.1",
"@angular/compiler": "^18.2.1",
"@angular/compiler-cli": "^18.2.1",
"@angular/core": "^18.2.1",
"@angular/forms": "^18.2.1",
"@angular/language-service": "^18.2.1",
"@angular/platform-browser": "^18.2.1",
"@angular/platform-browser-dynamic": "^18.2.1",
"@angular/platform-server": "^18.2.1",
"@angular/common": "^18.2.5",
"@angular/core": "^18.2.5",
"@astrojs/check": "^0.9.3",
"@astrojs/starlight": "^0.26.1",
"@astrojs/starlight-tailwind": "^2.0.3",
"@astrojs/tailwind": "^5.1.0",
"@astrojs/mdx": "^3.1.7",
"@astrojs/sitemap": "^3.1.6",
"@astrojs/tailwind": "^5.1.1",
"@astrojs/ts-plugin": "^1.10.2",
"@ng-icons/core": "^29.0.0",
"@ng-icons/lucide": "^29.0.0",
"@ng-icons/radix-icons": "^29.0.0",
"@pagefind/default-ui": "^1.1.0",
"@ng-icons/radix-icons": "^29.5.0",
"@radix-ng/primitives": "^0.10.0",
"astro": "^4.14.5",
"astro-auto-import": "^0.4.2",
"astro": "^4.15.9",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"hast": "^1.0.0",
"hast-util-select": "^6.0.2",
"lodash.template": "^4.5.0",
"rehype": "^13.0.1",
"rxjs": "^7.8.1",
"sharp": "^0.32.5",
"tailwind-merge": "^2.4.0",
"tailwindcss": "^3.4.4",
"tailwindcss": "^3.4.13",
"tailwindcss-animate": "^1.0.7",
"tslib": "^2.7.0",
"typescript": "^5.5.3",
"unist-util-visit": "^5.0.0",
"vfile": "^6.0.2",
"zone.js": "~0.14.10"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.2.5",
"@angular/cli": "^18.2.6",
"@angular/compiler": "^18.2.5",
"@angular/compiler-cli": "^18.2.5",
"@angular/language-service": "^18.2.5",
"@angular/platform-browser": "^18.2.5",
"@angular/platform-browser-dynamic": "^18.2.5",
"@angular/platform-server": "^18.2.5",
"@shikijs/transformers": "^1.20.0",
"@types/hast": "^3.0.4",
"@types/lodash.template": "^4.5.1",
"prettier": "^3.3.3"
"typescript": "~5.5.0"
}
}
File renamed without changes.
28 changes: 0 additions & 28 deletions docs/src/assets/logo.svg

This file was deleted.

Loading

0 comments on commit f4bf41f

Please sign in to comment.