Giter VIP home page Giter VIP logo

svelte-ssg1's Introduction

svelte-ssg1

Svelte 4 (と SvelteKit と adapter-static) で SSG してみる練習。

home と about があって、home にカウンタが置いてあるサイトを GitHub Pages にしてみた。

ここ ➞ https://heiwa4126.github.io/svelte-ssg1

「gh-branch ブランチに push すると更新」方式。

メモ

普通にpnpm buildだと ./buildに出る。(./buildはデフォルト値)。

layout.svelete で<a>に直書きしてる href、kit.paths.base で処理してくれない。<Link>じゃないからしょうがない。カッコいい方法を調べる。

(続き)「カッコいい方法」はいまいち無い感じ。地道に import { base } from '$app/paths'; して <a href="{base}/about">about</a> するしかなさそう。

kit.paths.base は空白値 または '/'で始まる必要がある。

dev でも preview でも ルートにアクセスすると kit.paths.base にリダイレクトしてくれる。便利。

参考

svelte-ssg1's People

Contributors

heiwa4126 avatar dependabot[bot] 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.