From 94950d584162a8ad9c72c7443218cc635d0650b5 Mon Sep 17 00:00:00 2001 From: Maximilian Hollis Date: Thu, 23 Nov 2023 02:25:45 -0500 Subject: [PATCH] Update Footer (#1101) * update footer * update courses * prevent style leak * update courses and links * fix: footer * fix: more --------- Co-authored-by: trigaten --- docusaurus.config.js | 55 +++++++++----- src/subsections/landingpage/Announcement.js | 0 src/subsections/landingpage/Hero.js | 6 +- src/theme/DocItem/Footer/course.js | 83 +++++++++++++++++++++ src/theme/DocItem/Footer/course.module.css | 49 ++++++++++++ src/theme/DocItem/Footer/index.js | 62 ++++++++++----- src/theme/DocItem/Footer/signup.js | 63 ++++++++++++++++ src/theme/DocItem/Footer/signup.module.css | 35 +++++++++ src/theme/DocItem/Footer/styles.module.css | 14 ++++ src/theme/NavbarItem/ComponentTypes.js | 3 +- 10 files changed, 329 insertions(+), 41 deletions(-) create mode 100644 src/subsections/landingpage/Announcement.js create mode 100644 src/theme/DocItem/Footer/course.js create mode 100644 src/theme/DocItem/Footer/course.module.css create mode 100644 src/theme/DocItem/Footer/signup.js create mode 100644 src/theme/DocItem/Footer/signup.module.css diff --git a/docusaurus.config.js b/docusaurus.config.js index d52dd6c770e..13d98dbf38b 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -32,12 +32,13 @@ async function createConfig() { "ar", "de", "uk", - "id" + "id", ], }, scripts: [ { - src: 'https://tag.clearbitscripts.com/v1/pk_5621ff511ea83a6ec015bee0a0b5dd79/tags.js', + src: + "https://tag.clearbitscripts.com/v1/pk_5621ff511ea83a6ec015bee0a0b5dd79/tags.js", async: true, }, ], @@ -51,12 +52,12 @@ async function createConfig() { from: "/docs/basics/standard_prompt", }, { - to: '/docs/tooling/IDEs/intro', - from: '/docs/IDEs/intro', + to: "/docs/tooling/IDEs/intro", + from: "/docs/IDEs/intro", }, { - to: '/our_services', - from: '/consulting', + to: "/our_services", + from: "/consulting", }, ], }, @@ -71,13 +72,11 @@ async function createConfig() { }, }; }, - ["posthog-docusaurus", - { - apiKey: process.env.POSTHOG_API_KEY || "DEV", - appUrl: "https://app.posthog.com", // optional - enableInDevelopment: false, // optional - }, - ] + ["posthog-docusaurus", { + apiKey: process.env.POSTHOG_API_KEY || "DEV", + appUrl: "https://app.posthog.com", // optional + enableInDevelopment: false, // optional + }], ], presets: [ @@ -92,8 +91,15 @@ async function createConfig() { }, docs: { admonitions: { - tag: ':::', - keywords: ['note', 'tip', 'info', 'caution', 'danger', 'takeaways'], + tag: ":::", + keywords: [ + "note", + "tip", + "info", + "caution", + "danger", + "takeaways", + ], }, sidebarPath: require.resolve("./sidebars.js"), editUrl: "https://github.com/trigaten/promptgineering/tree/v1.2.3", @@ -109,7 +115,7 @@ async function createConfig() { { yamlFile: "glossary.yml" }, ], ], - rehypePlugins: [[katex, { strict: false }]] + rehypePlugins: [[katex, { strict: false }]], }, theme: { customCss: require.resolve("./src/css/custom.css"), @@ -138,7 +144,8 @@ async function createConfig() { async: true, }, { - href: "https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap", + href: + "https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap", async: true, }, ], @@ -176,9 +183,9 @@ async function createConfig() { content: "website", }, { - to: 'consulting', - label:"Consulting", - position:"left", + to: "consulting", + label: "Consulting", + position: "left", }, { name: "twitter:card", @@ -224,6 +231,14 @@ async function createConfig() { }, ], }, + announcementBar: { + id: "announcement", + content: + 'Now available: Intro to Prompt Engineering', + backgroundColor: "#53ffd4", + textColor: "#000", + isCloseable: true, + }, footer: { style: "dark", copyright: `Copyright © ${new Date().getFullYear()} Learn Prompting.`, diff --git a/src/subsections/landingpage/Announcement.js b/src/subsections/landingpage/Announcement.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/subsections/landingpage/Hero.js b/src/subsections/landingpage/Hero.js index c5c9084dd7e..cecdff73fdf 100644 --- a/src/subsections/landingpage/Hero.js +++ b/src/subsections/landingpage/Hero.js @@ -62,14 +62,16 @@ function Hero() { levels!
- + {/* */} +
+ + + ); +} diff --git a/src/theme/DocItem/Footer/signup.module.css b/src/theme/DocItem/Footer/signup.module.css new file mode 100644 index 00000000000..c7784f71133 --- /dev/null +++ b/src/theme/DocItem/Footer/signup.module.css @@ -0,0 +1,35 @@ +.main { + margin-bottom: 40px; +} + +.cols { + display: flex; +} + +@media screen and (max-width: 1439px) { + .cols { + flex-direction: column-reverse; + gap: 10px; + } +} + + +.links { + width: 100%; + display: flex; + flex-direction: column; + gap: 12px; + font-weight: bold; + font-size: 15px; +} + +.links > div { + display: flex; + align-items: center; + gap: 6px; +} + +.email { + width: 100%; +} + diff --git a/src/theme/DocItem/Footer/styles.module.css b/src/theme/DocItem/Footer/styles.module.css index 7c1e9644191..10c6c351516 100644 --- a/src/theme/DocItem/Footer/styles.module.css +++ b/src/theme/DocItem/Footer/styles.module.css @@ -9,3 +9,17 @@ text-align: right; } } + +.courses { + display: flex; + gap: 24px; + justify-content: space-between; + width: 100%; +} + + +@media screen and (max-width: 1400px) { + .courses { + flex-direction: column; + } +} diff --git a/src/theme/NavbarItem/ComponentTypes.js b/src/theme/NavbarItem/ComponentTypes.js index a90a69a7b36..497ded26c6d 100644 --- a/src/theme/NavbarItem/ComponentTypes.js +++ b/src/theme/NavbarItem/ComponentTypes.js @@ -10,4 +10,5 @@ function MyAwesomeNavbarItemForDocs(props) { export default { ...ComponentTypes, 'custom-myAwesomeNavbarItem': MyAwesomeNavbarItemForDocs, -}; \ No newline at end of file + +};