Code Monkey home page Code Monkey logo

swyxkit's Introduction

A lightly opinionated starter for Svelte projects:

Feel free to rip out these opinions as you see fit of course.

Live Demo

See https://swyxkit.netlify.app/ (see Deploy Logs)

screenshot of swyxkit in action

screenshot of swyxkit in action

Users in the wild

Key Features and Design Considerations:

Setup

npx degit https://github.com/sw-yx/swyxkit
export GH_TOKEN=your_gh_token_here # can skip if just trying out this repo casually
npm install
npm run start

You should be able to deploy this project straight to Netlify as is, just like this project is.

Deploy to Netlify

Personalization Configuration

As you become ready to seriously adopt this, remember to configure /lib/siteConfig.js - just some hardcoded vars i want you to remember to configure.

export const SITE_URL = 'https://swyxkit.netlify.app';
export const GH_USER_REPO = 'sw-yx/swyxkit'; // used for pulling github issues and offering comments
export const REPO_URL = 'https://github.com/' + GH_USER_REPO;
export const SITE_TITLE = 'SwyxKit';
export const SITE_DESCRIPTION = "swyx's default SvelteKit + Tailwind starter";
export const DEFAULT_OG_IMAGE =
	'https://user-images.githubusercontent.com/6764957/147861359-3ad9438f-41d1-47c8-aa05-95c7d18497f0.png';
export const MY_TWITTER_HANDLE = 'swyx';
export const MY_YOUTUBE = 'https://youtube.com/swyxTV';

Of course, you should then go page by page (there aren't that many) and customize some of the other hardcoded items, for example

  • the Newsletter component needs to be wired up to a newsletter service (I like buttondown, tinyletter, and revue)
  • page Cache-Control policy and SvelteKit maxage
  • site favicons (use https://realfavicongenerator.net/ to make all the variants and stick it in /static)
  • (if migrating content from previous blog) setup Netlify redirects at /static/_redirects

This blog uses GitHub as a CMS - if you are doing any serious development at all, you should give the GH_TOKEN env variable to raise rate limit from 60 to 5000.

When deploying, don't forget to set it in Netlify: https://app.netlify.com/sites/YOUR_SITE/settings/deploys#environment

Optimizations to try after you are done deploying

Further Reading

You can read:

Acknowledgements

Todos

  • implement etag header for github api
  • store results in netlify build cache
  • separate hydration path for mobile nav (so that we could hydrate=false some pages)
  • custom components in MDX, and rehype plugins

swyxkit's People

Contributors

dependabot[bot] avatar dmoosocool avatar logan-anderson avatar mattcroat avatar rocketrene avatar swyxio avatar vitorarjol avatar

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.