GithubHelp home page GithubHelp logo

wrux / bloke Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 2.78 MB

Website for Bloke Blog

Home Page: https://bloke.blog

JavaScript 7.18% CSS 1.73% TypeScript 91.09%
react sanitycms tailwind typescript

bloke's Introduction

bloke's People

Contributors

wrux avatar

Stargazers

 avatar  avatar  avatar

bloke's Issues

Data coming from Sanity CMS is not typed

Is your feature request related to a problem? Please describe.

Data coming from Sanity is not properly typed so the any keyword was used temporarily.

Describe the solution you'd like

Create 404 template

Is your feature request related to a problem? Please describe.

Create a 404 page template with a link to the homepage

Describe the solution you'd like

  • Create pages/404.tsx with some basic missing page information
  • Link to the homepage
  • Link to the list of countries

Efficiently encode images

Is your feature request related to a problem? Please describe.

Images are currently served in jpeg format, causing a slight hit in browser performance

Describe the solution you'd like

Load WEBP images

Image grid

Goal

Create an image grid content block which displays a masonry grid on the frontend

Steps

  • Create image gallery block in CMS schema
  • Create preview component in CMS
  • Create masonry grid component, with column-count: 3 fallback

Storybook

Is your feature request related to a problem? Please describe.

Preview components independently to the frontend.

Describe the solution you'd like

Create a Storybook and render all visual components.

Country section

Goal

The blog is travel related so each blog post should be associated with one or more countries.

Steps

  • List all countries in alphabetical order at /countries
  • Link to related countries from blog page and teasers
  • Country detail page

Dark mode

Is your feature request related to a problem? Please describe.

No dark mode

Describe the solution you'd like

  • Create dark mode switch in header
  • Default to user's preference
  • Create dark mode colour scheme

Optimise delivery of images

Goal

Optimise the delivery of images and reduce the overall performance of the page.

Procedure

NextJS provides a responsive image component next/image, so all components with images should be refactored to use the responsive image.

  • Refactor cover-image.tsx component
  • Refactor blocks/image.tsx component
  • Refactor the image grid component once created
  • Check performance tests on Vercel

Automatically organise code

Is your feature request related to a problem? Please describe.

Code should be formatted automatically and consistently.

Describe the solution you'd like

Configure Prettier for:

Countries overview map

Is your feature request related to a problem? Please describe.

Create an overview page which shows a world map with each country mentioned in the blog highlighted. When the user clicks on a country, they will go to the country detail page.

Describe the solution you'd like

Image side by side

Is your feature request related to a problem? Please describe.

Sometimes it's better to have 2 images side by side. This can sort-of be achieved using the image grid component, but that assumes a 3 column layout above a certain breakpoint.

Describe the solution you'd like

Explore 2 possible solutions:

  1. Add a field to the image grid for layout, this can switch between flex/masonry image grids
  2. Image grids that contain 2 images should just use a flex layout and images with 3 or more should display the masonry grid

Landing page builder

Is your feature request related to a problem? Please describe.

Create a simple landing page builder with various blocks.

Describe the solution you'd like

  • Editing landing pages should be simple, you just need to click a button and add a block.
    • This can be implemented easily using the Array schema type
  • Landing page fields:
    • Page title
    • Slug
    • Array of blocks
  • Render all landing pages
    • Use NextJS catch all routing for landing page template
    • Register all static paths and render all pages as static pages
  • Use pre-built landing page components as reference

Additional context

Example page body component

const blockSerializers = {
  types: {
    imageBlock: () => (props) => (
      <Container>
        <Figure {...props} />
      </Container>
    ),
    imageGridBlock: (props) => (
      <Container>
        <ImageGrid {...props} />
      </Container>
    ),
    textBlock: ({ node }) => {
      const { content } = node;
      return (
        <BlockContent
          className="block prose lg:prose-xl mx-auto"
          blocks={content}
          projectId={process.env.NEXT_PUBLIC_SANITY_PROJECT_ID}
          dataset={process.env.NEXT_PUBLIC_SANITY_DATASET}
        />
      );
    },
  },
};

const PageBody: React.FC<Props> = ({ content }) => (
  <BlockContent
    blocks={content}
    projectId={process.env.NEXT_PUBLIC_SANITY_PROJECT_ID}
    dataset={process.env.NEXT_PUBLIC_SANITY_DATASET}
    serializers={blockSerializers}
  />
);

Use aliased file paths

Is your feature request related to a problem? Please describe.

Common file paths should be aliased to avoid using ../../.

Describe the solution you'd like

Create Webpack path aliases

Image masonry grid does not use Next responsive image component

Describe the bug

The image masonry grid does not use the next/image component. This is because the masonry grid uses CSS text columns and it can cause the images to break into the column mid-image

Expected behaviour

All images on the site should use the next/image component and have no issues with images breaking inside text columns

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.