From e0c39fb217537f89818006ca88731cd765df4fb5 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Thu, 26 Aug 2021 15:18:45 -0700 Subject: [PATCH] improve introduction page of example/docs --- examples/docs/public/theme.css | 8 +- .../components/RightSidebar/MoreMenu.astro | 102 +++++++++--------- examples/docs/src/config.ts | 6 ++ examples/docs/src/layouts/MainLayout.astro | 6 +- 4 files changed, 64 insertions(+), 58 deletions(-) diff --git a/examples/docs/public/theme.css b/examples/docs/public/theme.css index 3089840dd..1bd29c2f6 100644 --- a/examples/docs/public/theme.css +++ b/examples/docs/public/theme.css @@ -58,7 +58,7 @@ color-scheme: light; --theme-accent: hsla(var(--color-blue), 1); --theme-text-accent: hsla(var(--color-blue), 1); - --theme-accent-opacity: 0.1; + --theme-accent-opacity: 0.15; --theme-divider: hsla(var(--color-gray-95), 1); --theme-text: hsla(var(--color-gray-10), 1); --theme-text-light: hsla(var(--color-gray-40), 1); @@ -85,9 +85,9 @@ body { :root.theme-dark { color-scheme: dark; - --theme-accent-opacity: 0.4; - --theme-accent: hsla(var(--color-orange), 1); - --theme-text-accent: hsla(var(--color-orange), 1); + --theme-accent-opacity: 0.15; + --theme-accent: hsla(var(--color-blue), 1); + --theme-text-accent: hsla(var(--color-blue), 1); --theme-divider: hsla(var(--color-gray-10), 1); --theme-text: hsla(var(--color-gray-90), 1); --theme-text-light: hsla(var(--color-gray-80), 1); diff --git a/examples/docs/src/components/RightSidebar/MoreMenu.astro b/examples/docs/src/components/RightSidebar/MoreMenu.astro index 6be2d86ee..c23da0c7b 100644 --- a/examples/docs/src/components/RightSidebar/MoreMenu.astro +++ b/examples/docs/src/components/RightSidebar/MoreMenu.astro @@ -1,6 +1,8 @@ --- import ThemeToggleButton from './ThemeToggleButton.jsx'; +import * as CONFIG from '../../config.js'; const {editHref} = Astro.props; +const showMoreSection = (CONFIG.COMMUNITY_INVITE_URL || editHref); --- -

More

+{showMoreSection &&

More

}
diff --git a/examples/docs/src/config.ts b/examples/docs/src/config.ts index a9001b8ab..a892aedda 100644 --- a/examples/docs/src/config.ts +++ b/examples/docs/src/config.ts @@ -16,6 +16,12 @@ export const KNOWN_LANGUAGES = { English: 'en', }; +// Uncomment this to add an "Edit this page" button to every page of documentation. +// export const GITHUB_EDIT_URL = `https://github.com/snowpackjs/astro/blob/main/docs/`; + +// Uncomment this to add an "Join our Community" button to every page of documentation. +// export const COMMUNITY_INVITE_URL = `https://astro.build/chat`; + // Uncomment this to enable site search. // See "Algolia" section of the README for more information. // export const ALGOLIA = { diff --git a/examples/docs/src/layouts/MainLayout.astro b/examples/docs/src/layouts/MainLayout.astro index 04416316d..620f2e06b 100644 --- a/examples/docs/src/layouts/MainLayout.astro +++ b/examples/docs/src/layouts/MainLayout.astro @@ -6,19 +6,19 @@ import Footer from '../components/Footer/Footer.astro'; import PageContent from '../components/PageContent/PageContent.astro'; import LeftSidebar from '../components/LeftSidebar/LeftSidebar.astro'; import RightSidebar from '../components/RightSidebar/RightSidebar.astro'; -import { SITE } from "../config.ts"; +import * as CONFIG from "../config.ts"; const { content = {} } = Astro.props; const currentPage = Astro.request.url.pathname; const currentFile = `src/pages${currentPage.replace(/\/$/, "")}.md`; -const githubEditUrl = `https://github.com/snowpackjs/astro/blob/main/docs/${currentFile}`; +const githubEditUrl = CONFIG.GITHUB_EDIT_URL && (CONFIG.GITHUB_EDIT_URL + currentFile); --- - {content.title ? `${content.title} 🚀 ${SITE.title}` : SITE.title} + {content.title ? `${content.title} 🚀 ${CONFIG.SITE.title}` : CONFIG.SITE.title}