Giter Site home page Giter Site logo

ja-sonyun / yew-template-for-github-io Goto Github PK

View Code? Open in Web Editor NEW
26.0 1.0 3.0 634 KB

Template of yew project, using tailwind and webpack for css, trunk for build and serve, deployable as is for github.io

Home Page: https://ja-sonyun.github.io/yew-template-for-github-io/

HTML 43.03% Rust 32.46% SCSS 1.47% CSS 0.82% JavaScript 22.22%
rust yew tailwind webpack trunk github-io-page github-io

yew-template-for-github-io's Introduction

gh-pages-publish

Yew Template for Github.io

Yew template that deployable as is for github.io (or as a normal yew template with css/scss stuffs without github.io), with tailwind.css and webpack with your css/scss and trunk for build.

About github.io

main branch
├── index.html
│
├── css                       # css/scss
│   ├── index.css
│   ├── index.scss
│   ├── main.scss
│   └── tailwind
│       └── tailwind_base.css
│
├── src                       # yew here
│   └── main.rs
│
├── static
│   └── 404.html
│
├── README.md
├── Cargo.lock
├── Cargo.toml
├── Trunk.toml
├── package.json
├── tailwind.config.js
└── webpack.config.js

gh-pages branch
├── index.html
├── 404.html
├── index-7823f64dca35d01f.js
├── index-7823f64dca35d01f_bg.wasm
└── main-baa4389a63fdea1b.css

Things that you need to do

Go Setting > Code and automation > Pages > Github Pages > Source and change branch from main to gh-pages. if not exists, create new branch named gh-pages.
github action is cofigured. just push your codes to the main branch, and then outputs of trunk build --release will automatically deployed.
While running trunk serve, trunk will watch static and css folder, and do compile for all codes include css/scss in css folder when they had any changes like rust codes in src.

For {username}.github.io page

you need to modify this line and this line to 0
also check ./src/main.rs

For {username}.github.io/{project_name} page

you need to modify this line and this line to 1 also check ./src/main.rs
To serve the project on your machine correctly, run trunk serve --public-url=/{project_name}/

As a normal template(not for github.io)

To use without github.io, open Trunk.toml and remove public_url field.
Also remove 404.html in static folder and this line in index.html.
Lastly remove .github/workflow folder.

Using Custom Domain

go to ./.github/workflows/publish_gh_pages.yml and add your domain in cname field.

Routing

Using static/404.html. for more information, checkout https://github.com/rafgraph/spa-github-pages.

yew-template-for-github-io's People

Contributors

ja-sonyun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yew-template-for-github-io's Issues

gh deployment errors

Hi,

I'm getting errors trying to deploy:

Run peaceiris/[email protected]
[INFO] Usage https://github.com/peaceiris/actions-gh-pages#readme
Dump inputs
Setup auth token
Prepare publishing assets
  
Setup Git config
  
Create a commit
Push the commit or tag
  /usr/bin/git push origin gh-pages
  remote: Permission to ngmisl/yewgh.git denied to github-actions[bot].
  fatal: unable to access 'https://github.com/ngmisl/yewgh.git/': The requested URL returned error: 403
  Error: Action failed with "The process '/usr/bin/git' failed with exit code 128"

but https://github.com/ngmisl/yewgh.git/ is clearly accessible, any idea?

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.