👨🎓 I’m currently studying applied programming at Taras Shevchenko National University of Kyiv.
godhermit / survival-manual Goto Github PK
View Code? Open in Web Editor NEWInternational survival manual with offline articles
International survival manual with offline articles
👨🎓 I’m currently studying applied programming at Taras Shevchenko National University of Kyiv.
/src/_store
/src/app/store.ts
→ /src/_store/index.ts
/src/_helpers/articlesSlice.ts
→ /src/_store/slices/articlesSlice.ts
/src/_helpers/settingsSlice.ts
→ /src/_store/slices/settingsSlice.ts
/src/components/SideNav/sideNavSlice.ts
→ /src/_store/slices/sideNavSlice.ts
settingsMiddleware
and startListening
to any changes in settings
settingsMiddleware
Order articles by the number at the beginning of filename
Filename template: ${N}. ${articleName}.md
Example: 1. Introduction.md
Get article content by URL slug instead of filename
Group articles by the 'groupName' YAML property
If not specified, the article does not belong to any group
Example:
---
groupName: Appendix #This article belongs to 'Appendix' group
---
After pressing "Try again" button:
Resolve locale manually in order from cookies()
1 or URL2 or Accept-Language
header3
Synchronize NEXT_LOCALE
cookie and settings.locale
from localStorage
Whenever a locale value is read from a cookie
or localStorage
, check if the locale is supported
URL segment.
For example, /en/introduction
↩
Create standalone pure HTML page for providing all articles in one place without JavaScript
SideNav
Implement:
Export Modal
Add important files to cache on first service worker install
/manifest.json?locale=${locale}
1/offline
Disable start URL caching
Update /offline
, /manifest.json?locale=${locale}
1 in cache on locale change
Add to cache manifests for all locales, if settings.cacheLocales: 'all'
Ask user to reload when a new service worker is installed2
Exclude /api
and files with extension from /offline
fallback
Handle 404 errors with not-found.tsx
Handle errors with error.tsx
3
Check if CacheStorage
is supported on the client side
/manifest.json?locale=en
en
locale by default/app/[locale]/offline/layout.tsx
/app/[locale]/(articles)/settings/layout.tsx
/app/[locale]/(articles)/[[...article]]/page.tsx
/app/[locale]/layout.tsx
title
template
(only for root layout)default
(only for root layout)description
metadataBase
(only for root layout)alternates
3 - generate alternate URLs for each localeopenGraph
title
- copy of title without templatedescription
- copy of descriptionurl
- urlsiteName
- localized site namelocale
- current localeimages
- generate dynamic images4robots
5icons
6 (only for root layout)themeColor
- preferred color for current colorMode
(only for root layout)manifest
- URL with ?locale=
search parameter (only for root layout)manifest.json
Fields7name
short_name
start_url
display
theme_color
- copy of the theme_color
from metadatabackground_color
description
- description of the app itselficons
- copy of the icons
form metadatascreenshots
8Implement:
README.md
/src/middleware.ts
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.