From 8584376bcb5f6aa4f7d898ee8bb28ffbb5ff86e5 Mon Sep 17 00:00:00 2001 From: prototypa Date: Sat, 21 Jan 2023 20:19:20 -0500 Subject: [PATCH 1/6] Add .editorconfig --- .editorconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8927e2c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = false \ No newline at end of file From 0dd6497df53dadf097836363661597db34a4ac82 Mon Sep 17 00:00:00 2001 From: prototypa Date: Sat, 21 Jan 2023 20:19:56 -0500 Subject: [PATCH 2/6] Extract Header and Footer data to data.js --- src/data.js | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 src/data.js diff --git a/src/data.js b/src/data.js new file mode 100644 index 0000000..fd4fdd8 --- /dev/null +++ b/src/data.js @@ -0,0 +1,131 @@ +import { getPermalink, getBlogPermalink, getAsset } from './utils/permalinks'; + +export const headerData = { + links: [ + { + text: 'Landing', + links: [ + { + text: 'Sass', + href: '#', + }, + { + text: 'Startup', + href: '#', + }, + { + text: 'Mobile App', + href: '#', + }, + ], + }, + { + text: 'Pages', + links: [ + { + text: 'Features', + href: '#', + }, + { + text: 'Pricing', + href: '#', + }, + { + text: 'About us', + href: '#', + }, + { + text: 'Contact', + href: '#', + }, + { + text: 'Terms', + href: getPermalink('/terms'), + }, + { + text: 'Privacy policy', + href: getPermalink('/privacy'), + }, + ], + }, + { + text: 'Widgets', + href: '#', + }, + { + text: 'Blog', + href: getBlogPermalink(), + }, + { + text: 'About', + href: '#', + }, + ], + actions: [ + { type: 'button', text: 'Download', href: 'https://github.com/onwidget/astrowind' } + ], +}; + +export const footerData = { + links: [ + { + title: 'Product', + links: [ + { text: 'Features', href: '#' }, + { text: 'Security', href: '#' }, + { text: 'Team', href: '#' }, + { text: 'Enterprise', href: '#' }, + { text: 'Customer stories', href: '#' }, + { text: 'Pricing', href: '#' }, + { text: 'Resources', href: '#' }, + ], + }, + { + title: 'Platform', + links: [ + { text: 'Developer API', href: '#' }, + { text: 'Partners', href: '#' }, + { text: 'Atom', href: '#' }, + { text: 'Electron', href: '#' }, + { text: 'AstroWind Desktop', href: '#' }, + ], + }, + { + title: 'Support', + links: [ + { text: 'Docs', href: '#' }, + { text: 'Community Forum', href: '#' }, + { text: 'Professional Services', href: '#' }, + { text: 'Skills', href: '#' }, + { text: 'Status', href: '#' }, + ], + }, + { + title: 'Company', + links: [ + { text: 'About', href: '#' }, + { text: 'Blog', href: '#' }, + { text: 'Careers', href: '#' }, + { text: 'Press', href: '#' }, + { text: 'Inclusion', href: '#' }, + { text: 'Social Impact', href: '#' }, + { text: 'Shop', href: '#' }, + ], + }, + ], + secondaryLinks: [ + { text: 'Terms', href: getPermalink('/terms') }, + { text: 'Privacy Policy', href: getPermalink('/privacy') }, + ], + socialLinks: [ + { ariaLabel: 'Twitter', icon: 'tabler:brand-twitter', href: '#' }, + { ariaLabel: 'Instagram', icon: 'tabler:brand-instagram', href: '#' }, + { ariaLabel: 'Facebook', icon: 'tabler:brand-facebook', href: '#' }, + { ariaLabel: 'RSS', icon: 'tabler:rss', href: getAsset('/rss') }, + { ariaLabel: 'Github', icon: 'tabler:brand-github', href: 'https://github.com/onwidget/astrowind' }, + ], + footNote: ` + + Made by onWidget · All rights reserved. + `, +}; From 9397fe65f9086b47f6b2945e6a3a06464291dd26 Mon Sep 17 00:00:00 2001 From: prototypa Date: Sat, 21 Jan 2023 20:20:20 -0500 Subject: [PATCH 3/6] Improve design and extract data --- src/components/widgets/Header.astro | 124 +++++++++++++--------------- 1 file changed, 58 insertions(+), 66 deletions(-) diff --git a/src/components/widgets/Header.astro b/src/components/widgets/Header.astro index 6dd9637..fe5b841 100644 --- a/src/components/widgets/Header.astro +++ b/src/components/widgets/Header.astro @@ -4,51 +4,33 @@ import Logo from '~/components/common/Logo.astro'; import ToggleTheme from '~/components/common/ToggleTheme.astro'; import ToggleMenu from '~/components/common/ToggleMenu.astro'; -import { getHomePermalink, getBlogPermalink, getPermalink, getAsset } from '~/utils/permalinks'; +import { getHomePermalink, getAsset } from '~/utils/permalinks'; -const links = [ - { - text: 'Pages', - links: [ - { - text: 'Features', - href: '#', - }, - { - text: 'Pricing', - href: '#', - }, - { - text: 'About us', - href: '#', - }, - { - text: 'Contact', - href: '#', - }, - { - text: 'Terms', - href: getPermalink('/terms'), - }, - { - text: 'Privacy policy', - href: getPermalink('/privacy'), - }, - ], - }, - { - text: 'Resources', - href: getPermalink('useful-resources-to-create-websites', 'post'), - }, - { - text: 'Blog', - href: getBlogPermalink(), - }, -]; +interface Link { + text?: string; + href?: string; + ariaLabel?: string; + icon?: string; +} + +interface ActionLink extends Link { + type?: string; +} + +interface MenuLink extends Link { + links?: Array; +} + +export interface Props { + links: Array; + actions: Array; +} + +const { links = [], actions = [] } = Astro.props; --- From 79283511d90310a808d9bb2053c5408beb5a5e75 Mon Sep 17 00:00:00 2001 From: prototypa Date: Sat, 21 Jan 2023 20:20:36 -0500 Subject: [PATCH 4/6] Improve design and extract data --- src/components/widgets/Footer.astro | 151 +++++++++++----------------- 1 file changed, 61 insertions(+), 90 deletions(-) diff --git a/src/components/widgets/Footer.astro b/src/components/widgets/Footer.astro index a968c27..b3ef413 100644 --- a/src/components/widgets/Footer.astro +++ b/src/components/widgets/Footer.astro @@ -1,94 +1,65 @@ --- import { Icon } from 'astro-icon'; -import { getHomePermalink, getPermalink, getAsset } from '~/utils/permalinks'; +import { SITE } from '~/config.mjs'; +import { getHomePermalink } from '~/utils/permalinks'; -const links = [ - { - title: 'Product', - items: [ - { title: 'Features', href: '#' }, - { title: 'Security', href: '#' }, - { title: 'Team', href: '#' }, - { title: 'Enterprise', href: '#' }, - { title: 'Customer stories', href: '#' }, - { title: 'Pricing', href: '#' }, - { title: 'Resources', href: '#' }, - ], - }, - { - title: 'Platform', - items: [ - { title: 'Developer API', href: '#' }, - { title: 'Partners', href: '#' }, - { title: 'Atom', href: '#' }, - { title: 'Electron', href: '#' }, - { title: 'AstroWind Desktop', href: '#' }, - ], - }, - { - title: 'Support', - items: [ - { title: 'Docs', href: '#' }, - { title: 'Community Forum', href: '#' }, - { title: 'Professional Services', href: '#' }, - { title: 'Skills', href: '#' }, - { title: 'Status', href: '#' }, - ], - }, - { - title: 'Company', - items: [ - { title: 'About', href: '#' }, - { title: 'Blog', href: '#' }, - { title: 'Careers', href: '#' }, - { title: 'Press', href: '#' }, - { title: 'Inclusion', href: '#' }, - { title: 'Social Impact', href: '#' }, - { title: 'Shop', href: '#' }, - ], - }, -]; +interface Link { + text?: string; + href?: string; + ariaLabel?: string; + icon?: string; +} -const social = [ - { label: 'Twitter', icon: 'tabler:brand-twitter', href: '#' }, - { label: 'Instagram', icon: 'tabler:brand-instagram', href: '#' }, - { label: 'Facebook', icon: 'tabler:brand-facebook', href: '#' }, - { label: 'RSS', icon: 'tabler:rss', href: getAsset('/rss.xml') }, - { label: 'Github', icon: 'tabler:brand-github', href: 'https://github.com/onwidget/astrowind' }, -]; +interface Links { + title?: string; + links: Array; +} + +export interface Props { + links: Array; + secondaryLinks: Array; + socialLinks: Array; + footNote?: string; + theme?: string; +} + +const { socialLinks = [], secondaryLinks = [], links = [], footNote = '', theme = 'light' } = Astro.props; --- -