diff --git a/README.md b/README.md index e947f2b..5241eec 100644 --- a/README.md +++ b/README.md @@ -1,134 +1,5 @@ -![](https://i.imgur.com/hWB1XRO.png) +

+ +

-# Gatsby Starter Portfolio: Cara - -A portfolio starter for [Gatsby](https://www.gatsbyjs.org/). The target audience are designers and photographers. - -[Demo Website](https://portfolio-cara.netlify.com/) - -[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/LeKoArts/gatsby-starter-portfolio-cara) - -- TailwindCSS & Emotion -- Gatsby v2 -- React Spring -- Playful & Colorful One-Page website with Parallax effect - -Based on [gatsby-tailwind-demo](https://github.com/jlengstorf/gatsby-tailwind-demo). - -## Why? - -If you want to quickly bootstrap a design/photography portfolio or use it as a foundation for your personal site the *gatsby-starter-portfolio* are a perfect fit for you! The project's goal is to offer minimalistic and fast websites. - -I hope you like my starters and create something awesome! To see some of my work you can visit my [website](https://www.lekoarts.de) or support me on [Patreon](https://www.patreon.com/lekoarts) to get some neat rewards (4K images, project files, tutorial insights). - -Also check out the other *gatsby-starter-portfolio*: -- [gatsby-starter-portfolio-emma](https://github.com/LeKoArts/gatsby-starter-portfolio-emma) -- [gatsby-starter-portfolio-emilia](https://github.com/LeKoArts/gatsby-starter-portfolio-emilia) -- [gatsby-starter-portfolio-bella](https://github.com/LeKoArts/gatsby-starter-portfolio-bella) - -## Features - -- [React Spring](https://github.com/drcmda/react-spring) (Used for Parallax effect) -- [TailwindCSS](https://tailwindcss.com/) & [Emotion](https://emotion.sh/) for styling - - Use the full power of TailwindCSS while generating small styles (as unused data gets deleted) -- SEO - - Schema.org JSONLD - - OpenGraph Tags - - Twitter Tags -- [Typefaces](https://github.com/KyleAMathews/typefaces) for quicker font loading -- Offline Support -- WebApp Manifest Support -- Responsive images - - The right image size for every screen size - - Traced SVG Loading (Lazy-Loading) - - WebP Support - -**Please note:** Gatsby **v2** is currently in Alpha and it will still take some time until it's officially released. Therefore you should expect some bugs. Also the parallax effect can be quite heavy for some older CPUs and the site uses some newer CSS features which will result in incompatibility with older browsers. - -## Getting Started - -Check your development environment! You'll need [Node.js](https://nodejs.org/en/), the [Gatsby CLI](https://www.gatsbyjs.org/docs/) and [node-gyp](https://github.com/nodejs/node-gyp#installation) installed. The official Gatsby website also lists two articles regarding this topic: -- [Gatsby on Windows](https://www.gatsbyjs.org/docs/gatsby-on-windows/) -- [Check your development environment](https://www.gatsbyjs.org/tutorial/part-one/#check-your-development-environment) - -To copy and install this starter run this command (with "project-name" being the name of your folder you wish to install it in): - -``` -gatsby new project-name https://github.com/LeKoArts/gatsby-starter-portfolio-cara -npm run develop -``` - -### Adding new features/plugins - -You can add other features by having a look at the offical [plugins page](https://www.gatsbyjs.org/docs/plugins/) - -### Building your site - -``` -npm run build -``` -Copy the content of the ``public`` folder to your webhost or use a website like Netlify which automates that for you. - -Make sure to use the right build command in your build settings e.g. if you use Netlify! -Per default Netlify sets it to `gatsby build` but you have to use `yarn run build` to run postcss before building the Gatsby site. - -## Configuration - -You have multiple options to configure this project. - -1) Use the `config/website.js` to configure data passed to the SEO component and other parts of the Gatsby site: - -```JS -module.exports = { - pathPrefix: '/', // Prefix for all links. If you deploy your site to example.com/portfolio your pathPrefix should be "/portfolio" - - siteTitle: 'Cara - Gatsby Starter Portfolio', // Navigation and Site Title - siteTitleAlt: 'Cara', // Alternative Site title for SEO - siteUrl: 'https://portfolio-cara.netlify.com', // Domain of your site. No trailing slash! - siteLanguage: 'en', // Language Tag on element - siteLogo: '/logos/logo-1024.png', // Used for SEO and manifest - siteDescription: 'Playful & Colorful One-Page website with Parallax effect', - - siteFBAppID: '123456789', // Facebook App ID - userTwitter: '@cara', // Twitter Username - ogSiteName: 'cara', // Facebook Site Name - ogLanguage: 'de_DE', // Facebook Language - - // Manifest and Progress color - themeColor: tailwind.colors.orange, - backgroundColor: tailwind.colors.blue, -}; -``` - -2) Use the `tailwind.js` file to configure TailwindCSS. Their [documentation](https://tailwindcss.com/docs/configuration) explains it step-by-setp. - -3) Modify the files in the `src/styles` directory. - -4) You can also place the icons somewhere else on the page, modify their animation and hide them on smaller screens: - -```JSX - - - -``` - -- For `icon` you have the options: `triangle, circle, arrowUp, upDown, box, hexa` -- If you want the SVG to be hidden on mobile view, add the `className={hidden}` -- You can define the width via the TailwindCSS width [option](https://tailwindcss.com/docs/width) -- The colors get defined via the TailwindCSS color [option](https://tailwindcss.com/docs/colors) - - Please note that you will either have to define the color in `stroke` **or** `fill` depending on the icon. For referance have a look at the currently used SVGs -- The options `left` and `top` position the icon relatively to its parent container -- You can also wrap the SVGs with `` or `` to animate them - -### Typography - -Instead of relying on Google's CDN to host its fonts this site self-hosts the fonts and therefore profits from increased performance. The installed fonts can be found in `src/pages/index.jsx`: - -```JSX -import 'typeface-cantata-one'; -import 'typeface-open-sans'; -``` - -We use [typefaces](https://github.com/KyleAMathews/typefaces) by Kyle Mathews. Have a look at the repository if you want to install & use other fonts. - -You'll also need to configure `fonts` in `tailwind.js` to reflect the changes. You then can use the fonts with `font-sans` and `font-serif`. \ No newline at end of file +### Source code of [Rescue Amazonian Rainforest's website](https://www.rescue-amazonian-rainforest.com) diff --git a/gatsby-config.js b/gatsby-config.js index c5f373e..49fe91c 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,8 +1,11 @@ +const { join } = require(`path`) const { homepage } = require(`./package.json`) // const config = require(`./config/website`) // const pathPrefix = config.pathPrefix === `/` ? `` : config.pathPrefix +const isProduction = process.env.RAR_CONTENT_URI + module.exports = { /* General Information */ // pathPrefix: config.pathPrefix, @@ -23,7 +26,9 @@ module.exports = { { resolve: `gatsby-source-filesystem`, options: { - path: `${__dirname}/content/`, + path: isProduction + ? join(__dirname, `content`) + : join(__dirname, `..`, `content`), name: `content`, }, }, diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..8cb82b6 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,8 @@ +[Settings] +ID = "rescue-amazonian-rainforest" + +[build] + base = "/" + publish = "public/" + command = "wget -O content.tgz $RAR_CONTENT_URI && npm rebuild sharp && mkdir content && tar -xzf content.tgz -C content && yarn build" + environment = { NODE_VERSION = "8.9.4" } diff --git a/package.json b/package.json index 2583a88..3c67df3 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "rescue-amazonian-rainforest.com", "description": "Website of Rescue Amazonian Rainforest gUG", - "version": "0.2.0", + "version": "0.3.0", "author": "Can Rau ", "homepage": "https://www.rescue-amazonian-rainforest.com", "license": "MIT", "scripts": { "dev": "gatsby develop", - "build": "gatsby build", + "build": "NODE_ENV=production gatsby build", "serve": "gatsby serve public", "lint": "eslint . --ext .js,.jsx --ignore-path .gitignore", "lint:fix": "eslint . --ext .js,.jsx --fix --ignore-path .gitignore", diff --git a/static/logos/logo-1024.png b/static/logos/logo-1024.png deleted file mode 100644 index 8eddab2..0000000 Binary files a/static/logos/logo-1024.png and /dev/null differ diff --git a/static/logos/logo-192x192.png b/static/logos/logo-192x192.png deleted file mode 100644 index 9c45f9b..0000000 Binary files a/static/logos/logo-192x192.png and /dev/null differ diff --git a/static/logos/logo-48.png b/static/logos/logo-48.png deleted file mode 100644 index fd6f638..0000000 Binary files a/static/logos/logo-48.png and /dev/null differ diff --git a/static/logos/logo-512x512.png b/static/logos/logo-512x512.png deleted file mode 100644 index 6f2baf7..0000000 Binary files a/static/logos/logo-512x512.png and /dev/null differ