Giter Club home page Giter Club logo

survival-manual's Introduction

survival-manual's People

Contributors

godhermit avatar

Stargazers

 avatar

Watchers

 avatar

survival-manual's Issues

Update redux implementation

  • Create folder /src/_store
    • Move /src/app/store.ts/src/_store/index.ts
    • Move /src/_helpers/articlesSlice.ts/src/_store/slices/articlesSlice.ts
    • Move /src/_helpers/settingsSlice.ts/src/_store/slices/settingsSlice.ts
    • Move /src/components/SideNav/sideNavSlice.ts/src/_store/slices/sideNavSlice.ts
  • Create settingsMiddleware and startListening to any changes in settings
    • Move «save settings to localStorage» and «Synchronize NEXT_LOCALE cookie and settings.locale» logics to settingsMiddleware

Implement features related to articles

  • 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
    ---

Create standalone pure HTML page

Create standalone pure HTML page for providing all articles in one place without JavaScript

Features

  • Provides all articles in one place
    • Supports articles' translations
  • Works without JavaScript
  • Uses the minimum amount of network traffic

Create modal for exporting articles

Implement:

  • Support export formats:
    • HTML
    • Markdown
  • Export type
    • Current article
    • All articles in one file
    • All articles separated in ZIP archive
  • Disable "Current Article" export option on non-article pages
  • Add the ability to work offline for Export Modal

Update service worker

  • 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.tsx3

  • Check if CacheStorage is supported on the client side

Footnotes

  1. ${locale} - current locale, selected by user 2

  2. Example

  3. error.tsx

Fix articles fetching

  • Fetch articles' metadata for selected locale on app loading
  • Use fetched metadata for SideNav and SearchModal

Translate manifest.json

  • Generate manifest.json file dynamically
  • Detect locale from URL
    Example: /manifest.json?locale=en
    • Use en locale by default

Add metadata for pages

Add metadata for pages

Static Metadata1

  • /app/[locale]/offline/layout.tsx
  • /app/[locale]/(articles)/settings/layout.tsx

Dynamic Metadata2

  • /app/[locale]/(articles)/[[...article]]/page.tsx
  • /app/[locale]/layout.tsx

Required Metadata Fields

  • title
    • template (only for root layout)
    • default (only for root layout)
  • description
  • metadataBase (only for root layout)
  • alternates3 - generate alternate URLs for each locale
  • openGraph
    • title - copy of title without template
    • description - copy of description
    • url - url
    • siteName - localized site name
    • locale - current locale
    • images - generate dynamic images4
  • robots5
  • icons6 (only for root layout)
  • themeColor - preferred color for current colorMode (only for root layout)
  • manifest - URL with ?locale= search parameter (only for root layout)

Required manifest.json Fields7

  • name
  • short_name
  • start_url
  • display
  • theme_color - copy of the theme_color from metadata
  • background_color
  • description - description of the app itself
  • icons - copy of the icons form metadata
  • screenshots8

Footnotes

  1. Static Metadata

  2. Dynamic Metadata

  3. alternates

  4. Generate images using code (.js, .ts, .tsx)

  5. robots

  6. icons

  7. Web app manifests

  8. screenshots

Implement settings

Implement:

  • Language changing
    • Fetching available locales
  • Theme settings
  • Font size settings
  • Articles cache settings
    • Languages caching
    • Media caching

Optimize locales fetching

  • Export array of supported locales from /src/middleware.ts
  • Use exported array in all components where only locale codes are required

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.