From 669267f00b6bee79954e67bd2ec1efc36e2510e0 Mon Sep 17 00:00:00 2001 From: Kia King Ishii Date: Wed, 25 Nov 2020 23:29:54 +0900 Subject: [PATCH] fix: make home page look better --- docs/.vitepress/config.js | 4 + docs/config/homepage.md | 23 ++ src/client/theme-default/Layout.vue | 2 +- src/client/theme-default/components/Home.vue | 216 +----------------- .../theme-default/components/HomeFeatures.vue | 148 ++++++++++++ .../theme-default/components/HomeFooter.vue | 61 +++++ .../theme-default/components/HomeHero.vue | 175 ++++++++++++++ src/client/theme-default/styles/layout.css | 22 +- 8 files changed, 432 insertions(+), 219 deletions(-) create mode 100644 docs/config/homepage.md create mode 100644 src/client/theme-default/components/HomeFeatures.vue create mode 100644 src/client/theme-default/components/HomeFooter.vue create mode 100644 src/client/theme-default/components/HomeHero.vue diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 10e44a51383c..4b9df41409ab 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -55,6 +55,10 @@ function getConfigSidebar() { { text: 'App Config', children: [{ text: 'Basics', link: '/config/basics' }] + }, + { + text: 'Theme Config', + children: [{ text: 'Homepage', link: '/config/homepage' }] } ] } diff --git a/docs/config/homepage.md b/docs/config/homepage.md new file mode 100644 index 000000000000..ccaea3bca3b4 --- /dev/null +++ b/docs/config/homepage.md @@ -0,0 +1,23 @@ +# Theme Config: Homepage + +VitePress provides a homepage layout. To use it, specify `home: true` plus some other metadata in your root `index.md`'s [YAML frontmatter](../guide/frontmatter). This is an example of how it works: + +```yaml +--- +home: true +heroImage: /logo.png +heroAlt: Logo image +heroText: Hero Title +tagline: Hero subtitle +actionText: Get Started +actionLink: /guide/ +features: +- title: Simplicity First + details: Minimal setup with markdown-centered project structure helps you focus on writing. +- title: Vue-Powered + details: Enjoy the dev experience of Vue + webpack, use Vue components in markdown, and develop custom themes with Vue. +- title: Performant + details: VitePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded. +footer: MIT Licensed | Copyright © 2019-present Evan You +--- +``` diff --git a/src/client/theme-default/Layout.vue b/src/client/theme-default/Layout.vue index 128342370117..85e2c947000a 100644 --- a/src/client/theme-default/Layout.vue +++ b/src/client/theme-default/Layout.vue @@ -18,7 +18,7 @@