Coder Social home page Coder Social logo

inian / tus.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tus/tus.io

0.0 1.0 0.0 15.23 MB

The tus.io website

Home Page: https://tus.io

License: Other

Shell 1.49% JavaScript 1.97% TypeScript 23.23% XSLT 47.31% Astro 19.62% CSS 6.38%

tus.io's Introduction

tus.io

Development

Getting ready

  • git clone github.com/tus/tus.io && cd tus.io
  • yarn install
  • yarn dev

The site is automatically published to GitHub Pages on any commits to the main branch.

Philosophy/rules

  • Do not hydrate components unless strictly necessary
    • This reduces the amount of JavaScript shipped to users' browsers.
  • Write scoped CSS as much as possible.
    • Avoids CSS collisions.
    • Makes CSS dependencies explicit, allowing for easier editing.
    • Astro components and CSS Modules import for Preact components make this easy.
  • Write semantic HTML.
  • Use Astro components for static reusable components.
  • Use Preact components for interactive components.

Content editing

Page content is located in src/pages. Routing is file-based, meaning that both the directory and names of files determine the URL of the page. For example, src/pages/docs/clients/node.md will be available at /docs/clients/node.

It is possible to write pages in Markdown, MDX or Astro. The latter two allow for interactive features, such as embedding Preact components. If you want to use an interactive component on a page, make sure you instruct Astro to hydrate the component. See src/pages/demo.mdx for an example of how that would look.

Content collections, currently blog posts, features and protocols, are placed in src/content. Pages are not automatically generated from content collections. Instead, the content collections are consumed in pages, for instance in src/pages/blog/index.astro for the blog feed page. Route generation for single blog posts is handled in src/pages/blog/[...slug].astro. The pages are generally also where layouts are applied.

Not automatically generating pages is useful because content collections can be used in various ways. The features collection for instance, does not have pages, but it's Markdown contents are instead rendered on the homepage.

The protocols contents are generated by yarn inject and should not be edited manually.

Directory structure

  • src/pages - Pages
  • src/components - Reusable components
  • src/content - Content collections and their configuration
  • src/layouts - Layouts
  • src/styles - Global styles
  • src/data - Data files that are not content collections, such as a list of authors
  • src/assets - Any images placed here and linked to from img tags in Astro templates, Markdown image definitions, or imported from .ts(x) files will be automatically optimized by Astro
  • src/lib - Utility functions
  • src/types - Type definitions

Releasing a new version of the tus protocol

Assuming tus/tus-resumable-upload-protocol has been updated with the new version.

  • Add the new version to ./scripts/inject-protocol.sh
  • chmod +x ./scripts/inject-protocol.sh
  • yarn inject
  • Commit the changes and push

tus.io's People

Contributors

kvz avatar acconut avatar dependabot[bot] avatar felixge avatar ajvanloon avatar fahad19 avatar nqst avatar nickrttn avatar greenkeeperio-bot avatar yukeshshr avatar vayam avatar elenalape avatar janko avatar smatsson avatar ombratteng avatar brantwladichuk avatar bhstahl avatar kieranp avatar lucab85 avatar xen avatar vangheem avatar nigoroll avatar s3rius avatar goto-bus-stop avatar twodarek avatar tralves avatar tolunayakbulut avatar vkrol avatar deebash avatar oliverpool avatar

Watchers

 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.