2.0.0 • Published 30 days ago

@mnemonicorg/gatsby-theme-archive-site v2.0.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
gitlab
Last release
30 days ago

@mnemonicorg/gatsby-theme-archive-site

An extendable gatsby theme to be used as a foundation in creating Mnemonic archive sites

Getting started

For a new archive site

  1. Copy the contents of gatsby-theme-archive-site-example/
  2. Run yarn install to install core dependencies.
  3. Run yarn develop to start the development server (locahost:8000)
  4. Set configuration options (see below)
  5. Add custom content and pages

For an existing site

  1. Install the theme
yarn install @mnemonic/gatsby-theme-archive-site
  1. Add the configuration to your gatsby-config.js file
// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "@mnemonicorg/gatsby-theme-archive-site",
      options: {
        contentPath: `${__dirname}/content/`,
        dataPath: `${__dirname}/data/`,
        // ... additional config options
      },
    },
  ],
}

Setting up a development environment

Using yarn workspaces allows you to take advantage of hot reloading to see how changes to the theme or to the code for an archive instance will take effect while debugging an archive site locally in development.

Directory structure

In order for yarn workspaces to work, your local clone of the theme repo must be in the same directory as the archive site you are developing.

├── mnemonic-themes
    └── gatsby-theme-archive-site
├── yourarchive
    └── package.json
├── package.json

package.json

In order to initialize a yarn workspace, you must have a package.json file with the following at the root level in your local directory.

{
  "private": true,
  "workspaces": [
    "mnemonic-themes/gatsby-theme-archive-site",
    "yourarchive" // this must match the "name" field in your archive's package.json
  ]
}

yourarchive/package.json

The final change that is necessary is to change the dependency version in your archive's package.json to ensure that it is using the local workspace version of @mnemonicorg/gatsby-theme-archive-site instead of the npm version.

{
  // ...
  "dependencies": {
    "@mnemonicorg/gatsby-theme-archive-site": "*",
    // ...
  }
}

Starting the dev server

Now that you have set up your yarn workspace, from within the root level of your local directory, run: 1. yarn workspace yourarchive install to install and link all dependencies 2. And then yarn workspace yourarchive develop

Any changes you make to either the theme code, or the your archive will trigger a hot reload on the dev server.

Usage

Theme options

KeyTypeDefault valueDescription
aboutPageSupportButtonLinkstringnullLink for about page support button
actionButtonLinkstringnullA url for the primary action button in the header and footer of the archive site
analyticsTrackingIdstringnullA google analytics tracking ID
apiUrlstringnullA base url for the backend API
colorsobject{ primary: "#ff5400", primary_transparent: "#ff54009c",light: "#ffffff", dark: "#000000", bg: "#f5f5f5" }Theme colors for the site
contentPath*stringnullContent directory path (required)
customHeaderNavItems{ name: string, to: string }nullAdditional dropdown items for the "About" section in the header nav bar
dataPath*stringnullData directory path (required)
homepageSupportButtonLinkstringnullLink for homepage support button
mailchimpEndpointstringhttps://mnemonic.us7.list-manage.com/subscribe/post?u=dad7fb9f6b148644ffbf4a5da&id=443f12971cMailchimp url for "Subscribe now" button
socialMediaLinks{ type: string, link: string }nullLinks for footer social media icons
translations{ locale_key: { key: value }, ... }nullAdditional translation strings
2.0.0

30 days ago

1.6.2

2 months ago

1.6.1

5 months ago

1.6.0

5 months ago

1.5.5

10 months ago

1.5.4

10 months ago

1.5.3

10 months ago

1.5.2

10 months ago

1.5.1

10 months ago

1.5.0

10 months ago

1.5.6

9 months ago

1.4.1

11 months ago

1.4.0

11 months ago

1.3.11

1 year ago

1.3.12

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.10

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.2.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.3.3

1 year ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.1.10

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago