All Projects β†’ bespoyasov β†’ www

bespoyasov / www

Licence: GPL-3.0 license
Source code for my blog Β· βœοΈβ€―πŸ’»β€―πŸ‘‹

Programming Languages

typescript
32286 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
EJS
674 projects

Projects that are alternatives of or similar to www

cmu-pronouncing-dictionary
The 134,000+ words and their pronunciations in the CMU pronouncing dictionary
Stars: ✭ 46 (+58.62%)
Mutual labels:  en
one-cent-blog
The template for a one cent/month blog using S3, Cloudflare, Jekyll and Travis-Ci
Stars: ✭ 13 (-55.17%)
Mutual labels:  static-site-generation
mathblog
A package for managing a static, mathematically-inclined web log
Stars: ✭ 25 (-13.79%)
Mutual labels:  static-site-generation
website-hugo
FOSSDay page
Stars: ✭ 12 (-58.62%)
Mutual labels:  static-site-generation
rhymes
Give me an English word and I’ll give you a list of rhymes
Stars: ✭ 34 (+17.24%)
Mutual labels:  en
gpp
General PreProcessor
Stars: ✭ 25 (-13.79%)
Mutual labels:  static-site-generation
subtlex-word-frequencies
A list of words from the SUBTLEX movie subtitles corpus, sorted by frequency.
Stars: ✭ 25 (-13.79%)
Mutual labels:  en
Ink
A fast and flexible Markdown parser written in Swift.
Stars: ✭ 2,049 (+6965.52%)
Mutual labels:  static-site-generation
Notion Blog
A Next.js site using new SSG support with a Notion backed blog
Stars: ✭ 2,339 (+7965.52%)
Mutual labels:  static-site-generation
Plot
A DSL for writing type-safe HTML, XML and RSS in Swift.
Stars: ✭ 1,722 (+5837.93%)
Mutual labels:  static-site-generation
graphql-ssg
GraphQL data based Static Site Generator.
Stars: ✭ 30 (+3.45%)
Mutual labels:  static-site-generation
stacy
Website generator that combines content from Contentful CMS with Handlebars templates and publishes the website in Amazon S3.
Stars: ✭ 24 (-17.24%)
Mutual labels:  static-site-generation
qpage
πŸ‘¨β€πŸ’» Free Project For Creating Academic Homepage Without Any Code In 3min
Stars: ✭ 87 (+200%)
Mutual labels:  static-site-generation
similar-english-words
Give me a word and I’ll give you an array of words that differ by a single letter.
Stars: ✭ 25 (-13.79%)
Mutual labels:  en

✍️ πŸ’» πŸ‘‹

Source code for my blog.

Overview

Next is used as a static site generator. Pages call the network service that triggers persistence to read a post or a project from an MDX file in the storage directory.

Translation dictionary collection, RSS generation and image optimization are performed by custom scripts located in ops. For optimizing images, Squoosh is used.

Jest is used as a test runner and Hygen as a code generator.

Deployed on static servers using GitHub Actions.

Installation

Clone the repo and install dependencies:

git clone https://github.com/bespoyasov/www.git
cd www

npm i

Development

For starting the development mode, run:

npm start

This command will start 3 daemons in parallel:

  • Next dev server for En version on 2001 port;
  • Next dev server for Ru version on 2002 port;
  • Translation dictionary watcher for live-updates of localization data.

Code Generation

Create a component, post, or a page:

npm run new:component
npm run new:post
npm run new:page

# Interactive CLI will guide you after this.

Testing

To run the tests in development:

npm run test:dev

For running all the tests once:

npm test

The latter command is also used in CI.

Project Build

The project can be built in 2 different languages:

npm run build:en
npm run build:ru

After the build, Next exports the generated site sources into out. Then the static resources are cleaned up to contain only the media related to the current build locale. In the end, RSS is generated.

The sources in out now can be deployed to a server.

Ops

For operations that aren't included in Next by default, custom ops scripts are used.

Image Optimization

To optimize images in public/images using Squoosh, run:

npm run images:convert

Next's Image component doesn't support optimizations when using SSG, hence this script.

Also, generated images are kept in the repository to avoid too long deployments. Since all images require optimizations, every update would last for tens of minutes.

Translation

Instead of using a third-party library and a localization service, the custom translation β€œlibrary” is used.

It collects data from translations.json files in the src directory and creates a translation dictionary. Except the resulting dictionary, the type definitions for it are created. It improves the IDE support and autocompletion.

To collect translations, run:

npm run dict:collect

This command is run automatically after installing the dependencies and before project start and build.

To set up a watcher over the translation data that updates the dictionary on every translations.json file change, run:

npm run dict:watch

This command is run automatically on start of the project.

Plans and TODOs

Everything I consider implementing is in the projects section on GitHub.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].