-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 076b695
Showing
2,079 changed files
with
37,575 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
The BSD Zero Clause License (0BSD) | ||
|
||
Copyright (c) 2022 MicroPasts | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# MicroPasts Blog | ||
|
||
This repository holds a very simple blog system for the MicroPasts project. | ||
|
||
1. **Start developing.** | ||
|
||
Navigate into your new site’s directory and start it up. | ||
|
||
```shell | ||
cd my-default-starter/ | ||
gatsby develop | ||
``` | ||
|
||
1. **Open the source code and start editing!** | ||
|
||
Your site is now running at `http://localhost:8000`! | ||
|
||
Note: You'll also see a second link: `http://localhost:8000/___graphql`. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby Tutorial](https://www.gatsbyjs.com/docs/tutorial/part-4/#use-graphiql-to-explore-the-data-layer-and-write-graphql-queries). | ||
Open the `my-default-starter` directory in your code editor of choice and edit `src/pages/index.txt`. Save your changes and the browser will update in real time! | ||
## 🚀 Quick start (Gatsby Cloud) | ||
Deploy this starter with one click on [Gatsby Cloud](https://www.gatsbyjs.com/cloud/): | ||
[<img src="https://www.gatsbyjs.com/deploynow.svg" alt="Deploy to Gatsby Cloud">](https://www.gatsbyjs.com/dashboard/deploynow?url=https://github.com/gatsbyjs/gatsby-starter-default) | ||
## 🧐 What's inside? | ||
|
||
A quick look at the top-level files and directories you'll see in a typical Gatsby project. | ||
. | ||
├── node_modules | ||
├── src | ||
├── .gitignore | ||
├── gatsby-browser.js | ||
├── gatsby-config.js | ||
├── gatsby-node.js | ||
├── gatsby-ssr.js | ||
├── LICENSE | ||
├── package.json | ||
└── README.md | ||
1. **`/node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed. | ||
1. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. `src` is a convention for “source code”. | ||
1. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for. | ||
1. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-browser/) (if any). These allow customization/extension of default Gatsby settings affecting the browser. | ||
1. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-config/) for more detail). | ||
1. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. | ||
1. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/) (if any). These allow customization of default Gatsby settings affecting server-side rendering. | ||
1. **`LICENSE`**: This Gatsby starter is licensed under the 0BSD license. This means that you can see this file as a placeholder and replace it with your own license. | ||
1. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project. | ||
1. **`README.md`**: A text file containing useful reference information about your project. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// You can delete this file if you're not using it | ||
import "@popperjs/core/dist/umd/popper.min" | ||
import "bootstrap/dist/css/bootstrap.min.css" | ||
import "bootstrap/dist/js/bootstrap.min" | ||
import "./src/styles/global.css" | ||
import "@fontsource/public-sans"; | ||
import 'typeface-sorts-mill-goudy/index.css'; | ||
import '/static/dark-mode.css'; | ||
import 'dark-mode-switch/dark-mode-switch.min.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
/** | ||
* Configure your Gatsby site with this file. | ||
* | ||
* See: https://www.gatsbyjs.com/docs/reference/config-files/gatsby-config/ | ||
*/ | ||
|
||
/** | ||
* @type {import('gatsby').GatsbyConfig} | ||
*/ | ||
module.exports = { | ||
siteMetadata: { | ||
title: `MicroPasts: Blog`, | ||
description: `Crowdfuelled archaeological research - a blog detailing our adventures.`, | ||
twitterHandle: '@micropasts', | ||
author: 'The MicroPasts Collective', | ||
image: `/img.png`, | ||
og: { | ||
siteName: 'MicroPasts - Crowd fuelled archaeology', | ||
twitterCreator: '@micropasts', | ||
}, | ||
siteUrl: `https://blog.micropasts.org`, | ||
}, | ||
plugins: [ | ||
`gatsby-plugin-image`, | ||
{ | ||
resolve: `gatsby-transformer-remark`, | ||
options: { | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-remark-images`, | ||
options: { | ||
maxWidth: 2000, | ||
withWebp: true, | ||
formats: ['auto', 'webp'], | ||
showCaptions: true, | ||
quality: 90, | ||
linkImagesToOriginal: true, | ||
backgroundColor: `gray`, | ||
loading: `lazy`, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-remark-images-remote`, | ||
options: { | ||
/** | ||
* @param {'lazy' | 'eager' | 'auto'} loading | ||
* Set the output markup's 'loading' attribute. Default: 'lazy' | ||
*/ | ||
loading: 'lazy', | ||
|
||
/** | ||
* @param {string} backgroundColor | ||
* Background color. Default: '#fff' | ||
*/ | ||
backgroundColor: '#fff', | ||
|
||
/** | ||
* @param {boolean} linkImagesToOriginal | ||
* If enabled, wraps the default markup with an <a> tag pointing to the original image. | ||
* Default: false | ||
*/ | ||
linkImagesToOriginal: false, | ||
|
||
/** | ||
* @param {string | Function} wrapperStyle | ||
* Inject styles to the image wrapper. | ||
* Also accept a function that receives all image data as arguments, i.e | ||
* ({ aspectRatio, width, height }) => `padding-bottom: ${height/2}px;` | ||
* Alternatively you can also attach additional class to `.gria-image-wrapper` | ||
*/ | ||
wrapperStyle: 'padding-bottom: 0.5rem;', | ||
|
||
|
||
/** | ||
* ...imageOptions | ||
* and any sharp image arguments (quality, maxWidth, etc.) | ||
*/ | ||
maxWidth: 1000, | ||
quality: 90, | ||
} | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
name: `images`, | ||
path: `${__dirname}/src/images`, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
name: `uploads`, | ||
path: `${__dirname}/src/content/uploads`, | ||
}, | ||
__key: "uploads" | ||
}, | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
name: `pages`, | ||
path: `${__dirname}/src/content/page`, | ||
}, | ||
__key: "pages" | ||
}, | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
name: `posts`, | ||
path: `${__dirname}/src/content/post`, | ||
}, | ||
__key: "pages" | ||
}, | ||
{ | ||
resolve: `gatsby-plugin-scroll-indicator`, | ||
options: { | ||
// Configure color of the scroll indicator | ||
color: "#000000", | ||
// Height of the scroll indicator | ||
height: "10px", | ||
// Configure the z-index of the indicator element | ||
zIndex: `9999`, | ||
}, | ||
}, | ||
`gatsby-plugin-sass`, | ||
`gatsby-plugin-twitter`, | ||
`gatsby-transformer-sharp`, | ||
`gatsby-plugin-sharp`, | ||
{ | ||
resolve: `gatsby-plugin-manifest`, | ||
options: { | ||
name: `micropasts-blog`, | ||
short_name: `micropasts`, | ||
start_url: `/`, | ||
background_color: `#663399`, | ||
// This will impact how browsers show your PWA/website | ||
// https://css-tricks.com/meta-theme-color-and-trickery/ | ||
// theme_color: `#663399`, | ||
display: `minimal-ui`, | ||
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site. | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
const _ = require("lodash") | ||
const fs = require("fs"); | ||
const {paginate} = require("gatsby-awesome-pagination"); | ||
exports.createPages = async ({ actions,graphql }) => { | ||
const { createPage } = actions | ||
const blogPostTemplate = require.resolve(`./src/templates/blog-page.js`) | ||
const blogPostPagedTemplate = require.resolve(`./src/templates/index.js`) | ||
const pageTemplate = require.resolve(`./src/templates/page.js`) | ||
|
||
return graphql(` | ||
{ | ||
blogPosts: allMarkdownRemark( | ||
filter: {frontmatter: {type: {eq: "post"}}} | ||
sort: {frontmatter: {date: DESC}} | ||
limit: 1000 | ||
) { | ||
edges { | ||
node { | ||
id | ||
frontmatter { | ||
date | ||
permalink | ||
title | ||
} | ||
} | ||
} | ||
} | ||
blogPages: allMarkdownRemark( | ||
filter: {frontmatter: {type: {eq: "page"}}} | ||
sort: {frontmatter: {date: DESC}} | ||
limit: 1000 | ||
) { | ||
edges { | ||
node { | ||
id | ||
frontmatter { | ||
date | ||
permalink | ||
title | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`).then(result => { | ||
if (result.errors) { | ||
return Promise.reject(result.errors) | ||
} | ||
result.data.blogPosts.edges.forEach(({node}) => { | ||
createPage({ | ||
path: node.frontmatter.permalink, | ||
component: blogPostTemplate, | ||
context: { | ||
slug: node.frontmatter.permalink, | ||
id: node.id | ||
}, | ||
}); | ||
}); | ||
result.data.blogPages.edges.forEach(({node}) => { | ||
createPage({ | ||
path: node.frontmatter.permalink, | ||
component: pageTemplate, | ||
context: { | ||
slug: node.frontmatter.permalink, | ||
id: node.id | ||
}, | ||
}); | ||
}); | ||
paginate({ | ||
createPage: createPage, | ||
component: blogPostPagedTemplate, | ||
items: result.data.blogPosts.edges, | ||
itemsPerPage: 12, | ||
itemsPerFirstPage: 12, | ||
pathPrefix: '/' | ||
}) | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file. | ||
* | ||
* See: https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/ | ||
*/ | ||
|
||
/** | ||
* @type {import('gatsby').GatsbySSR['onRenderBody']} | ||
*/ | ||
exports.onRenderBody = ({ setHtmlAttributes }) => { | ||
setHtmlAttributes({ lang: `en` }) | ||
} |
Oops, something went wrong.