Minor site config changes (#503)

This commit is contained in:
Franck Nijhof 2020-05-10 19:43:39 +02:00 committed by GitHub
parent ac3c3236c2
commit c112c34f84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 127 additions and 60 deletions

View File

@ -1,80 +1,134 @@
module.exports = {
title: 'Home Assistant Developer Docs',
tagline: 'All you need to start developing for Home Assistant',
url: 'https://developers.home-assistant.io',
baseUrl: '/',
favicon: 'img/favicon.png',
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.
title: "Home Assistant Developer Documentation",
tagline: "All you need to start developing for Home Assistant",
url: "https://developers.home-assistant.io",
baseUrl: "/",
favicon: "img/favicon.png",
organizationName: "home-assistant",
projectName: "developers.home-assistant",
themeConfig: {
googleAnalytics: {
trackingID: 'UA-57927901-3',
trackingID: "UA-57927901-3",
},
navbar: {
title: 'Developer Docs',
title: "Developers",
logo: {
alt: 'Home Assistant',
src: 'img/logo-pretty.svg',
alt: "Home Assistant",
src: "img/logo-pretty.svg",
},
links: [
{to: 'docs/architecture_index', label: 'Architecture', position: 'left'},
{to: 'docs/frontend_index', label: 'Frontend', position: 'left'},
{to: 'docs/development_index', label: 'Backend', position: 'left'},
{to: 'docs/misc', label: 'Misc', position: 'left'},
{to: 'blog', label: 'Blog', position: 'left'},
{
to: "docs/architecture_index",
label: "Architecture",
position: "left",
},
{ to: "docs/frontend_index", label: "Frontend", position: "left" },
{ to: "docs/development_index", label: "Backend", position: "left" },
{ to: "docs/misc", label: "Misc", position: "left" },
{ to: "blog", label: "Blog", position: "left" },
],
},
footer: {
logo: {
alt: 'Home Assistant',
src: 'img/logo-white.svg',
href: 'https://www.home-assistant.io',
alt: "Home Assistant",
src: "img/logo-white.svg",
href: "https://www.home-assistant.io",
},
style: 'dark',
style: "dark",
links: [
{
title: 'Social',
title: "More Home Assistant",
items: [
{
label: 'Blog',
to: 'blog',
label: "Homepage",
href: "https://www.home-assistant.io",
},
{
label: 'GitHub',
href: 'https://github.com/home-assistant/developers.home-assistant',
label: "Data Science Portal",
href: "https://data.home-assistant.io",
},
{
label: 'Twitter',
href: 'https://twitter.com/hass_devs',
label: "Alerts",
href: "https://alerts.home-assistant.io",
},
{
label: "System Status",
href: "https://status.home-assistant.io/",
},
],
},
{
title: "Social",
items: [
{
label: "Blog",
to: "blog",
},
{
label: "GitHub",
href: "https://github.com/home-assistant",
},
{
label: "Twitter",
href: "https://twitter.com/hass_devs",
},
{
label: "Discord chat",
href: "https://www.home-assistant.io/join-chat",
},
],
},
{
title: "Other",
items: [
{
label: "Privacy",
href: "https://www.home-assistant.io/privacy/",
},
{
label: "Security",
href: "https://www.home-assistant.io/security/",
},
],
},
{
items: [
{
html: `
<a href="https://www.netlify.com" target="_blank" rel="noreferrer noopener" aria-label="Deploys by Netlify">
<img src="https://www.netlify.com/img/global/badges/netlify-color-accent.svg" alt="Deploys by Netlify" />
</a>
`,
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Home Assistant, Inc. Built with Docusaurus.`,
},
image: 'img/default-social.png',
image: "img/default-social.png",
algolia: {
apiKey: 'd0245452c36b10cec4b8b5bad04e06fc',
indexName: 'home-assistant-dev',
algoliaOptions: {}
apiKey: "d0245452c36b10cec4b8b5bad04e06fc",
indexName: "home-assistant-dev",
algoliaOptions: {},
},
},
presets: [
[
'@docusaurus/preset-classic',
"@docusaurus/preset-classic",
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
sidebarPath: require.resolve("./sidebars.js"),
editUrl:
'https://github.com/home-assistant/developers.home-assistant/edit/master/',
"https://github.com/home-assistant/developers.home-assistant/edit/master/",
showLastUpdateTime: true,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
customCss: require.resolve("./src/css/custom.css"),
},
blog: {
postsPerPage: 10,
feedOptions: {
type: 'all',
type: "all",
},
},
},

View File

@ -1,15 +1,15 @@
import React from 'react';
import classnames from 'classnames';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import styles from './styles.module.css';
import React from "react";
import classnames from "classnames";
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import useBaseUrl from "@docusaurus/useBaseUrl";
import styles from "./styles.module.css";
const features = [
{
title: <>Document Structure</>,
imageUrl: '',
imageUrl: "",
description: (
<>
<p>
@ -42,14 +42,12 @@ const features = [
},
{
title: <>Popular Topics</>,
imageUrl: '',
imageUrl: "",
description: (
<>
<ul style={{ flex: "1" }}>
<li>
<a href="docs/development_index">
Add a new integration
</a>
<a href="docs/development_index">Add a new integration</a>
</li>
<li>
<a href="docs/internationalization_index">
@ -57,9 +55,7 @@ const features = [
</a>
</li>
<li>
<a href="docs/frontend_index">
Improve the frontend
</a>
<a href="docs/frontend_index">Improve the frontend</a>
</li>
<li>
<a href="docs/external_api_rest">
@ -85,7 +81,7 @@ const features = [
},
{
title: <>Upcoming Events</>,
imageUrl: '',
imageUrl: "",
description: (
<>
<iframe
@ -101,11 +97,10 @@ const features = [
},
];
function Feature({imageUrl, title, description}) {
function Feature({ imageUrl, title, description }) {
const imgUrl = useBaseUrl(imageUrl);
return (
<div className={classnames('col col--4', styles.feature)}>
<div className={classnames("col col--4", styles.feature)}>
{imgUrl && (
<div className="text--center">
<img className={styles.featureImage} src={imgUrl} alt={title} />
@ -119,16 +114,17 @@ function Feature({imageUrl, title, description}) {
function Home() {
const context = useDocusaurusContext();
const {siteConfig = {}} = context;
const { siteConfig = {} } = context;
return (
<Layout
title={`Home Assistant Developer Docs`}
description="Get started developing for Home Assistant">
<header className={classnames('hero hero--primary', styles.heroBanner)}>
description="Get started developing for Home Assistant"
>
<header className={classnames("hero hero--primary", styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<h1 className={styles.heroTitle}>{siteConfig.title}</h1>
<p className={styles.heroTagline}>{siteConfig.tagline}</p>
<p>
<a className="hero__text" href="https://www.home-assistant.io">
Not a developer? Go to the normal website

View File

@ -10,10 +10,27 @@
overflow: hidden;
}
.heroTitle {
font-size: 3rem;
}
.heroTagline {
font-size: 1.4rem;
}
@media screen and (max-width: 966px) {
.heroBanner {
padding: 2rem;
}
.heroTitle {
font-size: 2.4rem;
}
.heroTagline {
font-size: 1rem;
font-weight: bold;
}
}
.buttons {