Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
# Absolute path to the root of the docs source repository.
# This directory must contain en/components/toc.yml and en/components/*.md
#
# Windows example: DOCS_SOURCE_PATH=C:/Repos/docs/igniteui-docfx
# macOS/Linux: DOCS_SOURCE_PATH=/home/user/repos/igniteui-docfx
# Windows example: DOCS_SOURCE_PATH=C:/Repos/docs/my-docs-source
# macOS/Linux: DOCS_SOURCE_PATH=/home/user/repos/my-docs-source
DOCS_SOURCE_PATH=
141 changes: 13 additions & 128 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,132 +1,17 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import { buildSidebarFromToc, siteMetaIntegration } from './src/integration';
import { getPlatformHead } from './src/platform';
import path from 'node:path';
import { loadEnv } from 'vite';

// Load .env into process.env — Vite/Astro does this for the browser bundle
// but NOT for astro.config.ts itself, so we do it explicitly here.
const env = loadEnv('', process.cwd(), '');
Object.assign(process.env, env);

// ---------------------------------------------------------------------------
// Source paths — set via DOCS_SOURCE_PATH env var.
// For local development copy .env.example to .env and set an absolute path:
// DOCS_SOURCE_PATH=C:/Repos/docs/igniteui-docfx (Windows)
// DOCS_SOURCE_PATH=/home/user/repos/igniteui-docfx (macOS/Linux)
// Root astro.config.ts — NOT used for production builds.
//
// The actual docs sites are built via:
// docs/angular/astro.config.ts → Angular docs
// docs/xplat/astro.config.ts → React / Blazor / Web Components docs
//
// Both call createDocsSite() from src/integration.ts which assembles the
// full Astro configuration (plugins, sidebar, head entries, etc.).
//
// This file exists only so Astro tooling (language server, CLI) has a
// valid config when opened from the repo root.
// ---------------------------------------------------------------------------

if (!process.env.DOCS_SOURCE_PATH) {
throw new Error(
'[docs-template] DOCS_SOURCE_PATH env var is required. ' +
'Copy .env.example to .env and set an absolute path to the docs source repo root.'
);
}

const SOURCE_ROOT = path.resolve(process.env.DOCS_SOURCE_PATH);
const COMPONENTS = path.join(SOURCE_ROOT, 'en/components');
const TOC_PATH = path.join(SOURCE_ROOT, 'en/components/toc.yml');

process.env.DOCS_SOURCE_PATH = COMPONENTS;

const sidebar = buildSidebarFromToc({
tocPath: TOC_PATH,
docsDir: COMPONENTS,
exclude: [
/^grids_templates\//i,
/^style-guide\.md$/i,
/^themes\/sass\/presets\//i,
/^themes\.md$/i,
],
});
import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({
site: 'localhost:4321',
trailingSlash: 'never',
compressHTML: true,
build: {
assets: '_assets',
},
vite: {
css: {
preprocessorOptions: {
scss: {
loadPaths: [path.join(process.cwd(), 'node_modules')],
silenceDeprecations: ['if-function'],
},
},
},
},
integrations: [
starlight({
title: 'Ignite UI for Angular',
logo: {
src: './public/favicon.svg',
},
social: [
{ icon: 'github', label: 'GitHub', href: 'https://github.com/IgniteUI/igniteui-angular' },
],
sidebar,
// Prepend the packaged theme entry so consuming projects get the theme.
customCss: [
'./src/styles/ig-theme.scss',
],
head: [
// Platform CDN assets — driven by platform below
...getPlatformHead('angular', 'en'),
// Angular-specific Ignite UI component bundle (repo-specific, not in shared registry)
// { tag: 'link', attrs: { rel: 'stylesheet', href: 'https://www.infragistics.com/products/ignite-ui-angular/angular/bundles/igniteui.f5cfb48022e69dd66658.css' } },
// highlight.js for code-tab syntax highlighting inside code-view widgets
{ tag: 'link', attrs: { rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/vs2015.min.css' } },
{ tag: 'script', attrs: { src: 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js', defer: true } },
],
editLink: {
baseUrl: 'https://github.com/IgniteUI/igniteui-docfx/edit/master/en/components/',
},
components: {
PageFrame: './src/components/overrides/CustomPageFrame.astro',
Head: './src/components/overrides/Head.astro',
Header: './src/components/overrides/Header.astro',
Footer: './src/components/overrides/Footer.astro',
MobileTableOfContents: './src/components/overrides/MobileTableOfContents.astro',
Sidebar: './src/components/overrides/Sidebar/Sidebar.astro',
PageSidebar: './src/components/overrides/PageSidebar.astro',
},
expressiveCode: {
themes: ['dark-plus'],
}
}),
siteMetaIntegration({
title: 'Ignite UI for Angular',
platform: 'angular',
description:
'Complete reference documentation for Ignite UI for Angular — a Material-based ' +
'UI component library including Data Grid, Charts, Gauges, Calendars, and more.',
docsDir: COMPONENTS,
sidebar,
head: [
...getPlatformHead('angular', 'en'),
{ tag: 'link', attrs: { rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/vs2015.min.css' } },
{ tag: 'script', attrs: { src: 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js', defer: true } },
],
productLinks: [
{ label: 'Angular', href: '#', platform: 'angular' },
{ label: 'React', href: '#', platform: 'react' },
{ label: 'Blazor', href: '#', platform: 'blazor' },
{ label: 'Web Components', href: '#', platform: 'web-components' },
],
}),
mdx(),
staticImagesIntegration(IMAGES),
],
markdown: {
remarkPlugins: [
(await import('./src/plugins/remark-docfx')).remarkDocfx,
],
rehypePlugins: [
(await import('./src/plugins/remark-docfx')).rehypeCodeView,
],
},
});
export default defineConfig({});
3 changes: 0 additions & 3 deletions docs/angular/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ export default createDocsSite({
docsDir: componentsDocsDir,
},
sidebar: { exclude: [/^internal\//] },
starlight: {
// logo: { src: './public/favicon.svg' },
},
integrations: [mdx()],
// Expose @/ alias so MDX files can import Sample.astro and peer components.
// @xplat-images resolves xplat-sourced MDX image imports to the angular images dir.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"type": "module",
"version": "1.0.0",
"scripts": {
"sync:en": "node scripts/sync-docfx.mjs --lang=en",
"sync:jp": "node scripts/sync-docfx.mjs --lang=jp",
"sync:kr": "node scripts/sync-docfx.mjs --lang=kr",
"generate": "node scripts/generate.mjs",
"generate:en": "node scripts/generate.mjs --lang=en",
"generate:jp": "node scripts/generate.mjs --lang=jp",
Expand Down Expand Up @@ -40,7 +37,7 @@
"dependencies": {
"astro": "^6.1.6",
"docs-template": "file:../../",
"igniteui-astro-components": "0.0.5",
"igniteui-astro-components": "0.0.8",
"sharp": "^0.34.2"
},
"devDependencies": {
Expand Down
23 changes: 1 addition & 22 deletions docs/angular/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
declare module 'virtual:docs-template/site-meta' {
export const title: string;
export const description: string;
export const sidebar: { label: string; slug?: string; items?: unknown[] }[];
export const mode: 'dev' | 'staging' | 'prod';
export const trailingSlash: 'always' | 'never' | 'ignore';
}

declare module 'virtual:docs-template/nav-html' {
export const platform: 'igniteui' | 'angular' | 'react' | 'blazor' | 'web-components' | 'slingshot' | 'appbuilder' | null;
export const navLang: string;
export const prefetched: boolean;
export const headerHtml: string;
export const uiFooterHtml: string;
export const footerHtml: string;
export const abPrefetched: boolean;
export const abHeaderHtml: string;
export const abFooterHtml: string;
export const abFooterUtilsHtml: string;
export const abFooterCopyrightHtml: string;
export const abContactSalesHtml: string;
}
/// <reference path="../node_modules/docs-template/src/virtual-modules.d.ts" />
3 changes: 0 additions & 3 deletions docs/xplat/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,6 @@ export default createDocsSite({
href: mode === 'production' ? `${PROD_HOST}${b}` : `${STAGING_HOST}${b}`,
platform: key,
})),
starlight: {
logo: { src: './public/favicon.svg' },
},
integrations: [mdx()],
vite: {
plugins: [vitePluginPlatformTokens()],
Expand Down
2 changes: 1 addition & 1 deletion docs/xplat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"dependencies": {
"astro": "^6.1.6",
"docs-template": "file:../../",
"igniteui-astro-components": "0.0.5",
"igniteui-astro-components": "0.0.8",
"sharp": "^0.34.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -922,11 +922,7 @@ $custom-theme: grid-theme(

### サンプル

<code-view style="height:505px"
no-theming
data-demos-base-url="{environment:demosBaseUrl}"
iframe-src="{environment:demosBaseUrl}/hierarchical-grid/hierarchical-grid-styling" >
</code-view>
<Sample src="/hierarchical-grid/hierarchical-grid-styling" height={505} alt="Hierarchical Grid Styling" />

<DocsAside type="note" title="注">
サンプルは、**テーマの変更**で選択したグローバル テーマの影響を受けません。
Expand Down
Loading
Loading