Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ajfisher/ajfisher.me
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfisher committed Sep 15, 2023
2 parents 21f28df + 7b6be9a commit 8d842d8
Show file tree
Hide file tree
Showing 34 changed files with 171 additions and 297 deletions.
46 changes: 2 additions & 44 deletions site/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module.exports = {
disableBgImage: true,
},
},
/**
{
resolve: `gatsby-remark-responsive-image`,
options: {
Expand All @@ -74,6 +75,7 @@ module.exports = {
disableBgImage: true,
}
},
**/
{
resolve: `gatsby-remark-prismjs`,
options: {
Expand All @@ -87,50 +89,6 @@ module.exports = {
]
}
},
/** {
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
`gatsby-transformer-remark-tags`,
`gatsby-remark-reading-time`,
{
resolve: `gatsby-remark-relative-images`
},
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 1000,
backgroundColor: `none`,
quality: 90,
withWebp: { quality: 90 },
showCaptions: false,
disableBgImage: true,
},
},
{
resolve: `gatsby-remark-responsive-image`,
options: {
maxWidth: 1000,
backgroundColor: `none`,
quality: 90,
withWebp: { quality: 90 },
showCaptions: false,
disableBgImage: true,
}
},
{
resolve: `gatsby-remark-prismjs`,
options: {
aliases: {
sh: `bash`,
xsl: `xml`,
}
},
},
`gatsby-remark-transformer-pullquotes`
]
}
},**/
{
resolve: `gatsby-plugin-manifest`,
options: {
Expand Down
10 changes: 0 additions & 10 deletions site/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ exports.createPages = async ({ actions, graphql }) => {
slug
date(formatString: "YYYY-MM-DD")
layout
featureimage
}
}
}
Expand All @@ -36,18 +35,9 @@ exports.createPages = async ({ actions, graphql }) => {

// build out the pages for pages and posts
result.data.allMarkdownRemark.edges.forEach(({ node }) => {
// TODO add the listimage in here as well.
let featuredImage = node.frontmatter.featureimage;

if (featuredImage !== '' && featuredImage !== null) {
if (featuredImage.indexOf('/img/posts/') === 0) {
// we need to pull this off the front of the url
featuredImage = featuredImage.substring(11);
}
}
const context = {
slug: node.frontmatter.slug,
featuredImage
};

if (node.frontmatter.layout.startsWith('page')) {
Expand Down
102 changes: 0 additions & 102 deletions site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
"gatsby-plugin-styled-components": "^6.0.0",
"gatsby-remark-images": "^7.0.0",
"gatsby-remark-prismjs": "^7.0.0",
"gatsby-remark-relative-images": "^2.0.2",
"gatsby-remark-responsive-image": "^1.0.0-alpha13-alpha.435e0178",
"gatsby-source-filesystem": "^5.0.0",
"gatsby-transformer-remark": "^6.0.0",
"gatsby-transformer-sharp": "^5.0.0",
Expand Down
8 changes: 7 additions & 1 deletion site/src/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,13 @@ const Footer = ({slug}) => {
}
listimage_position
excerpt
featureimage
featureimage {
childImageSharp {
gatsbyImageData(
layout: FULL_WIDTH
)
}
}
featureimage_position
slug
}
Expand Down
1 change: 1 addition & 0 deletions site/src/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ const Featured = styled.p`
font-size: 1.8rem;
`;


const Header = ({ title, date, excerpt, url, featured=false, featuredimage,
smalltitle, largetitle, readingTime={} }) => {

Expand Down
43 changes: 5 additions & 38 deletions site/src/components/list-layout.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import React from 'react';
// import styled from 'styled-components';
// import PropTypes from 'prop-types';
// import { graphql } from 'gatsby';

// import { device } from './devices';

import Header from './header';
import Nav from './nav';
import Footer from './footer';
import { ListArticle } from './article';
import { Aside, Main } from './layout';
import { getPostImages } from './list';
import { pathDate } from '../lib/utils';
import { pathDate, getFeaturedImageSources } from '../lib/utils';

const Layout = ({ children, featured={}, slug}) => {

Expand All @@ -20,39 +13,13 @@ const Layout = ({ children, featured={}, slug}) => {
const excerpt = frontmatter.excerpt || fields.excerpt || '';
const url = `/${pathDate(frontmatter.date)}/${frontmatter.slug}/`;

let featuredImage;

if (frontmatter.featured && frontmatter.featureimage !== null) {
if (frontmatter.featureimage.startsWith('/img/')) {
frontmatter.featureimage = frontmatter.featureimage.substring(5);
}
if (! frontmatter.featureimage.startsWith('posts/')) {
frontmatter.featureimage = 'posts/' + frontmatter.featureimage;
}

const { postItemImages } = getPostImages();
const featuredImageSet = postItemImages.edges.find(({node}) => {
if (node.relativePath === frontmatter.featureimage) return node;

return null;
});

if (featuredImageSet) {
const {childImageSharp: img} = featuredImageSet.node;
featuredImage = {
base: img.duo_base.src,
small: img.duo_small.src,
medium: img.duo_medium.src,
large: img.duo_large.src,
wide: img.duo_wide.src
};
}
}
const {title, date} = frontmatter;
const featuredImageSrc = getFeaturedImageSources(frontmatter?.featureimage?.childImageSharp);

return (
<>
<Header featured='true' title={frontmatter.title} date={frontmatter.date}
excerpt={excerpt} featuredimage={featuredImage} url={url}
<Header featured='true' title={title} date={date}
excerpt={excerpt} featuredimage={featuredImageSrc} url={url}
smalltitle={frontmatter.small_title} largetitle={frontmatter.large_title}
readingTime={fields.readingTime} />
<Main>
Expand Down
9 changes: 6 additions & 3 deletions site/src/components/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ export const getPostImages = () => {
relativePath
childImageSharp {
gatsbyImageData(quality: 90, layout: FULL_WIDTH)
base: fixed(width: 400, quality: 90) {
src
}
base: gatsbyImageData(
width: 400
quality: 90
placeholder: BLURRED
layout: FIXED
)
small: fixed(width: 500, quality: 95) {
src
}
Expand Down
7 changes: 0 additions & 7 deletions site/src/components/post-layout.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
/** layout for poasts **/
import React from 'react';
// import styled from 'styled-components';
import PropTypes from 'prop-types';
import { useStaticQuery, graphql } from 'gatsby';

import { PostArticle } from './article';
import Header from './header';
import PostData from './postdata';

// import { device } from './devices';

import Nav from './nav';
import Footer from './footer';
import { Main, Aside } from './layout';
Expand Down Expand Up @@ -55,9 +51,6 @@ const useSiteMetadata = () => {
query {
site {
siteMetadata {
title: defaultTitle
description
author
siteUrl
}
}
Expand Down
5 changes: 2 additions & 3 deletions site/src/content/pages/dis-everything.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ so here's everything relevant about me.

## Disclaimer

I am one of several Aesop, LoyPal and Rocket Melbourne employees that answer questions
I am one of several LoyPal and Rocket Melbourne employees that answer questions
and write online and in the wider media and this extends to speaking engagements.
I am usually communicating about Physical Computing, Open Source Software,
Mobile technology and the future of Internet and Retail related technology so
Expand All @@ -28,8 +28,7 @@ I reserve the right categorically to say something stupid ;)

## Disclosure

I am currently an employee of [Aesop Skincare](https://aesop.com) where I
receive a salary. I am also the founder of Rocket Melbourne where I
I am the founder of Rocket Melbourne where I
draw a salary. In addition, I am a co-founder and CTO of LoyPal where I have
equity interests and draw income.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags: fuzzy logic, retail, web, ecommerce
excerpt: >
Using fuzzy logic can create significantly better customer experience.
However it hasn't caught on on web circles yet but examples are starting.
featureimage: fuzzy_at_sd.png
featureimage: ../../img/posts/fuzzy_at_sd.png
imageby: ajfisher Representation of fuzzy logic Stable Diffusion
imagelink: https://ajfisher.me/
listimage: ../../img/posts/fuzzy_at_sd.png
Expand Down
Loading

0 comments on commit 8d842d8

Please sign in to comment.