Files
posthog.com/scripts/mdxImportGen.js
Mike Nicklas 39db9e8f7c New Landing Page (#1035)
* Setup tailwind and postcss with gatsby

* Switch image to inline-block and remove max-width on container

* Add missing space for enterprise email link

* Small style changes to menu and hero

* General updates to support new header/menu

* Use initial styling for ordered & unordered lists

* Add correct style types for ul/ol elements

* Fix block level images in contributors grid

* Start updating footer and global colors to use new color scheme

* Setup footer links

* Remove bullets from navbar

* Use scss for contributor faces instead of utility classes

* Update body font to Good Sans

* Cleanup navbar and support dark mode

* Setup structure for a/b testing homepage

* Progress on the new landing page hero section

* Convert feature icons to typescript

* Build out the core sections of the new landing page

* Cleanup hero styles

* Update footer to be expandable on mobile

* Make navbar responsive and expandable

* Wire up get started modal

* Add hover states to primary call to actions

* Cleanup 'whyPosthog' section

* Fix docs lightmode/darkmode navbar colors & width

* Cleanup header

* Add copyright/legal to footer

* Add footer links & general cleanup

* Use 'a' tags for external links in navbar

* Fix a handful of style suggestions

* Code style improvements

* General style cleanup

* Support dark mode on handbook

* Add skeleton loading to clean up jumpiness

* Cleanup blog view

* Make login button text smaller

* Use dark purple for docs footer, code blocks, etc.

* Test Spinner before dark mode compatible pages

* update body bg-color on dark mode

* Add relative to fotoer

* Update footer links

* Add hero background

* Fix newsletter signup

* More responsive and fix newsletter glow

* Center legal section of footer

* Remove isDocsPage usage since all docs pages are post pages

* Remove duplicate check because all docs pages are post pages

* Remove a/b testing logic

* Switch landing page components to named exports

* More landing page cleanup

* Point tutorials and blog posts at correct pages

* Extract a CallToAction component which handles primary & secondary actions

* Add support for ultrawide

* Finish open source section and extend call to action functionality

* Fix up roadmap

* Use existing newsletter form

* Add more secondary buttons throughout

* Minor spacing cleanup

* Don't add stylesheets to mdx global components

* Don't purge dynamic width classes

* Safelist goes is an option

* typo fix

* First round of revisions

* Add button brackets

* Extract corner brackets and use elsewhere

* Landing page cleanup (#1081)

* extract moon, rocket from hero background

* link "open source platform" to github

* brackets around buttons, blockquote

* header sizing

* ordering logos, spacing

* a mostly working cityscape!

* reduce nav item tracking

* add a/b testing icon, animate product icons

* better responsiveness for product icons, replaced heatmaps icon

* responsive refinements

* switching product icons to use css grid

* Small fixes for ultrawide mountains & sun

* it is with great disappointment and self-loathing that i convert all svgs to pngs

* Cleaner brackets

* rebuilding timeline

Co-authored-by: Cory Watilo <corywatilo@gmail.com>
Co-authored-by: Mike Nicklas <mike.nicklas@gmail.com>

* Add an in-between breakpoint for mountains

* Small code style improvements

* Cleanup larger breakpoints

* Don't purge negative bottom/top classes

* Rename .features -> .lp-features to isolate to new landing page

* small sizing tweaks

* kill header signup button flash on hover

* a couple mobile sizing tweaks

Co-authored-by: yakkomajuri <yakko.majuri@gmail.com>
Co-authored-by: James Hawkins <47497682+jamesefhawkins@users.noreply.github.com>
Co-authored-by: Cory Watilo <cww@watilo.com>
Co-authored-by: Cory Watilo <corywatilo@gmail.com>
2021-03-17 14:49:52 +00:00

43 lines
1.5 KiB
JavaScript

const fs = require('fs')
const baseDir = './src/components'
const componentsToIgnore = new Set(['Layout', 'SidebarContents', 'Header', 'Menu', 'UserLogosCarousel'])
const getComponentsInDir = (dir, components = []) => {
const dirContents = fs.readdirSync(dir)
let subdirectories = []
let indexFileInDir = false
for (let f of dirContents) {
if (fs.lstatSync(`${dir}/${f}`).isDirectory() && !componentsToIgnore.has(f)) {
subdirectories.push(f)
continue
}
if (!indexFileInDir && f.includes('index') && !f.includes('css')) {
indexFileInDir = true
}
}
if (!subdirectories || indexFileInDir) {
return [...components, dir]
}
for (let subdir of subdirectories) {
components = getComponentsInDir(`${dir}/${subdir}`, components)
}
return components
}
const generateFile = () => {
let imports = '// AUTO GENERATED FILE \n\n'
let componentNames = []
for (let component of getComponentsInDir(baseDir)) {
const destructuredPath = component.split('/')
const relativePath = './' + destructuredPath.slice(2).join('/')
const componentName = destructuredPath[destructuredPath.length - 1]
imports += `import { ${componentName} } from '${relativePath}'\n`
componentNames.push(componentName)
}
imports += '\nexport const shortcodes = {\n\t' + componentNames.join(',\n\t') + '\n}'
fs.writeFileSync('./src/mdxGlobalComponents.js', imports)
}
generateFile()