create-smoodly-app 0.0.44 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -10
- package/dist/index.js +75 -33
- package/package.json +2 -2
- package/templates/astro-blank/AGENTS.md +55 -0
- package/templates/astro-blank/CLAUDE.md +1 -0
- package/templates/astro-blank/README.md +88 -0
- package/templates/astro-blank/_gitignore +5 -0
- package/templates/astro-blank/astro.config.ts +15 -0
- package/templates/astro-blank/package.json +24 -0
- package/templates/astro-blank/scripts/seed.ts +80 -0
- package/templates/astro-blank/src/components/LocaleNav.astro +15 -0
- package/templates/astro-blank/src/components/elements/Button.schema.ts +22 -0
- package/templates/astro-blank/src/components/pages/Home.schema.ts +17 -0
- package/templates/astro-blank/src/components/pages/Page.schema.ts +14 -0
- package/templates/astro-blank/src/components/sections/Text.schema.ts +24 -0
- package/templates/astro-blank/src/elements/button.astro +10 -0
- package/templates/astro-blank/src/entry-pages/posts.astro +23 -0
- package/templates/astro-blank/src/layouts/Layout.astro +25 -0
- package/templates/astro-blank/src/live.config.ts +13 -0
- package/templates/astro-blank/src/page-types/home.astro +15 -0
- package/templates/astro-blank/src/page-types/page.astro +15 -0
- package/templates/astro-blank/src/pages/404.astro +7 -0
- package/templates/astro-blank/src/sections/text.astro +18 -0
- package/templates/astro-blank/src/smoodly/collections.ts +24 -0
- package/templates/astro-blank/src/smoodly/config.ts +28 -0
- package/templates/astro-blank/src/smoodly/elements.ts +5 -0
- package/templates/astro-blank/src/smoodly/globals.ts +18 -0
- package/templates/astro-blank/src/smoodly/sections.ts +5 -0
- package/templates/astro-blank/src/smoodly/toolsets.ts +14 -0
- package/templates/astro-blank/src/styles/global.css +57 -0
- package/templates/astro-blank/supabase/migrations/20260926120000_smoodly_v1.sql +535 -0
- package/templates/astro-blank/supabase/migrations/20260926130000_smoodly_v2.sql +26 -0
- package/templates/astro-blank/supabase/migrations/20260926140000_smoodly_v3.sql +38 -0
- package/templates/astro-blank/supabase/migrations/20260926150000_smoodly_v4.sql +41 -0
- package/templates/astro-blank/supabase/migrations/20260929120000_smoodly_v5.sql +56 -0
- package/templates/astro-blank/supabase/migrations/20260929135523_smoodly_v6.sql +200 -0
- package/templates/astro-blank/supabase/migrations/20260930040956_smoodly_v7.sql +84 -0
- package/templates/astro-blank/supabase/migrations/20261007120000_smoodly_v8.sql +154 -0
- package/templates/astro-blank/supabase/migrations/20261007200000_smoodly_v9.sql +30 -0
- package/templates/{blank/supabase/migrations/20260930041056_smoodly_views.sql → astro-blank/supabase/migrations/20261007200100_smoodly_views.sql} +1 -1
- package/templates/astro-blank/tsconfig.json +17 -0
- package/templates/astro-blank-intl/AGENTS.md +55 -0
- package/templates/astro-blank-intl/CLAUDE.md +1 -0
- package/templates/astro-blank-intl/README.md +89 -0
- package/templates/astro-blank-intl/_gitignore +5 -0
- package/templates/astro-blank-intl/astro.config.ts +17 -0
- package/templates/astro-blank-intl/package.json +24 -0
- package/templates/astro-blank-intl/scripts/seed.ts +80 -0
- package/templates/astro-blank-intl/src/components/LocaleNav.astro +15 -0
- package/templates/astro-blank-intl/src/components/elements/Button.schema.ts +22 -0
- package/templates/astro-blank-intl/src/components/pages/Home.schema.ts +17 -0
- package/templates/astro-blank-intl/src/components/pages/Page.schema.ts +14 -0
- package/templates/astro-blank-intl/src/components/sections/Text.schema.ts +24 -0
- package/templates/astro-blank-intl/src/elements/button.astro +10 -0
- package/templates/astro-blank-intl/src/entry-pages/posts.astro +23 -0
- package/templates/astro-blank-intl/src/layouts/Layout.astro +25 -0
- package/templates/astro-blank-intl/src/live.config.ts +13 -0
- package/templates/astro-blank-intl/src/page-types/home.astro +15 -0
- package/templates/astro-blank-intl/src/page-types/page.astro +15 -0
- package/templates/astro-blank-intl/src/pages/404.astro +7 -0
- package/templates/astro-blank-intl/src/sections/text.astro +18 -0
- package/templates/astro-blank-intl/src/smoodly/collections.ts +24 -0
- package/templates/astro-blank-intl/src/smoodly/config.ts +29 -0
- package/templates/astro-blank-intl/src/smoodly/elements.ts +5 -0
- package/templates/astro-blank-intl/src/smoodly/globals.ts +18 -0
- package/templates/astro-blank-intl/src/smoodly/sections.ts +5 -0
- package/templates/astro-blank-intl/src/smoodly/toolsets.ts +14 -0
- package/templates/astro-blank-intl/src/styles/global.css +57 -0
- package/templates/astro-blank-intl/supabase/migrations/20260926120000_smoodly_v1.sql +535 -0
- package/templates/astro-blank-intl/supabase/migrations/20260926130000_smoodly_v2.sql +26 -0
- package/templates/astro-blank-intl/supabase/migrations/20260926140000_smoodly_v3.sql +38 -0
- package/templates/astro-blank-intl/supabase/migrations/20260926150000_smoodly_v4.sql +41 -0
- package/templates/astro-blank-intl/supabase/migrations/20260929120000_smoodly_v5.sql +56 -0
- package/templates/astro-blank-intl/supabase/migrations/20260929135523_smoodly_v6.sql +200 -0
- package/templates/astro-blank-intl/supabase/migrations/20260930040956_smoodly_v7.sql +84 -0
- package/templates/astro-blank-intl/supabase/migrations/20261007120000_smoodly_v8.sql +154 -0
- package/templates/astro-blank-intl/supabase/migrations/20261007200000_smoodly_v9.sql +30 -0
- package/templates/{blank-intl/supabase/migrations/20260930041056_smoodly_views.sql → astro-blank-intl/supabase/migrations/20261007200100_smoodly_views.sql} +1 -1
- package/templates/astro-blank-intl/tsconfig.json +17 -0
- package/templates/astro-blank-intl.tsconfig.json +24 -0
- package/templates/astro-blank.tsconfig.json +24 -0
- package/templates/astro-lorem/AGENTS.md +55 -0
- package/templates/astro-lorem/CLAUDE.md +1 -0
- package/templates/astro-lorem/README.md +60 -0
- package/templates/astro-lorem/_gitignore +5 -0
- package/templates/astro-lorem/astro.config.ts +15 -0
- package/templates/astro-lorem/package.json +24 -0
- package/templates/astro-lorem/public/images/about_main.jpg +0 -0
- package/templates/astro-lorem/public/images/article_photo.jpg +0 -0
- package/templates/astro-lorem/public/images/hero_image.jpg +0 -0
- package/templates/astro-lorem/public/images/home_section_2.jpg +0 -0
- package/templates/astro-lorem/scripts/seed.ts +405 -0
- package/templates/astro-lorem/src/components/ArticleCard.astro +19 -0
- package/templates/astro-lorem/src/components/articles.ts +42 -0
- package/templates/astro-lorem/src/components/elements/Callout.schema.ts +24 -0
- package/templates/astro-lorem/src/components/elements/Cta.schema.ts +21 -0
- package/templates/astro-lorem/src/components/news.ts +13 -0
- package/templates/astro-lorem/src/components/pages/Articles.schema.ts +20 -0
- package/templates/astro-lorem/src/components/pages/Home.schema.ts +26 -0
- package/templates/astro-lorem/src/components/pages/News.schema.ts +17 -0
- package/templates/astro-lorem/src/components/pages/Page.schema.ts +24 -0
- package/templates/astro-lorem/src/components/sections/FavouriteArticles.schema.ts +17 -0
- package/templates/astro-lorem/src/components/sections/Footer.schema.ts +31 -0
- package/templates/astro-lorem/src/components/sections/Header.schema.ts +21 -0
- package/templates/astro-lorem/src/components/sections/Hero.schema.ts +24 -0
- package/templates/astro-lorem/src/components/sections/ImageText.schema.ts +30 -0
- package/templates/astro-lorem/src/components/sections/PageHero.schema.ts +21 -0
- package/templates/astro-lorem/src/components/sections/People.schema.ts +15 -0
- package/templates/astro-lorem/src/components/sections/Points.schema.ts +21 -0
- package/templates/astro-lorem/src/components/sections/Quote.schema.ts +23 -0
- package/templates/astro-lorem/src/elements/callout.astro +13 -0
- package/templates/astro-lorem/src/elements/cta.astro +15 -0
- package/templates/astro-lorem/src/entry-pages/articles.astro +71 -0
- package/templates/astro-lorem/src/entry-pages/news.astro +29 -0
- package/templates/astro-lorem/src/layouts/Layout.astro +39 -0
- package/templates/astro-lorem/src/live.config.ts +20 -0
- package/templates/astro-lorem/src/messages/en.json +7 -0
- package/templates/astro-lorem/src/messages/fi.json +7 -0
- package/templates/astro-lorem/src/page-types/articlesIndex.astro +24 -0
- package/templates/astro-lorem/src/page-types/home.astro +14 -0
- package/templates/astro-lorem/src/page-types/newsIndex.astro +28 -0
- package/templates/astro-lorem/src/page-types/page.astro +27 -0
- package/templates/astro-lorem/src/pages/404.astro +7 -0
- package/templates/astro-lorem/src/sections/favouriteArticles.astro +26 -0
- package/templates/astro-lorem/src/sections/footer.astro +37 -0
- package/templates/astro-lorem/src/sections/header.astro +27 -0
- package/templates/astro-lorem/src/sections/hero.astro +28 -0
- package/templates/astro-lorem/src/sections/imageText.astro +22 -0
- package/templates/astro-lorem/src/sections/pageHero.astro +20 -0
- package/templates/astro-lorem/src/sections/peopleSection.astro +24 -0
- package/templates/astro-lorem/src/sections/points.astro +33 -0
- package/templates/astro-lorem/src/sections/quote.astro +16 -0
- package/templates/astro-lorem/src/smoodly/collections.ts +63 -0
- package/templates/astro-lorem/src/smoodly/config.ts +48 -0
- package/templates/astro-lorem/src/smoodly/elements.ts +6 -0
- package/templates/astro-lorem/src/smoodly/globals.ts +29 -0
- package/templates/astro-lorem/src/smoodly/sections.ts +18 -0
- package/templates/astro-lorem/src/smoodly/toolsets.ts +16 -0
- package/templates/astro-lorem/src/strings.ts +17 -0
- package/templates/astro-lorem/src/styles/global.css +228 -0
- package/templates/astro-lorem/supabase/migrations/20260926120000_smoodly_v1.sql +535 -0
- package/templates/astro-lorem/supabase/migrations/20260926130000_smoodly_v2.sql +26 -0
- package/templates/astro-lorem/supabase/migrations/20260926140000_smoodly_v3.sql +38 -0
- package/templates/astro-lorem/supabase/migrations/20260926150000_smoodly_v4.sql +41 -0
- package/templates/astro-lorem/supabase/migrations/20260929120000_smoodly_v5.sql +56 -0
- package/templates/astro-lorem/supabase/migrations/20260929135523_smoodly_v6.sql +200 -0
- package/templates/astro-lorem/supabase/migrations/20260930040956_smoodly_v7.sql +84 -0
- package/templates/astro-lorem/supabase/migrations/20261007120000_smoodly_v8.sql +154 -0
- package/templates/astro-lorem/supabase/migrations/20261007200000_smoodly_v9.sql +30 -0
- package/templates/{lorem/supabase/migrations/20260930041056_smoodly_views.sql → astro-lorem/supabase/migrations/20261007200100_smoodly_views.sql} +1 -1
- package/templates/astro-lorem/tsconfig.json +17 -0
- package/templates/astro-lorem-intl/AGENTS.md +55 -0
- package/templates/astro-lorem-intl/CLAUDE.md +1 -0
- package/templates/astro-lorem-intl/README.md +62 -0
- package/templates/astro-lorem-intl/_gitignore +5 -0
- package/templates/astro-lorem-intl/astro.config.ts +17 -0
- package/templates/astro-lorem-intl/package.json +24 -0
- package/templates/astro-lorem-intl/public/images/about_main.jpg +0 -0
- package/templates/astro-lorem-intl/public/images/article_photo.jpg +0 -0
- package/templates/astro-lorem-intl/public/images/hero_image.jpg +0 -0
- package/templates/astro-lorem-intl/public/images/home_section_2.jpg +0 -0
- package/templates/astro-lorem-intl/scripts/seed.ts +405 -0
- package/templates/astro-lorem-intl/src/components/ArticleCard.astro +19 -0
- package/templates/astro-lorem-intl/src/components/articles.ts +42 -0
- package/templates/astro-lorem-intl/src/components/elements/Callout.schema.ts +24 -0
- package/templates/astro-lorem-intl/src/components/elements/Cta.schema.ts +21 -0
- package/templates/astro-lorem-intl/src/components/news.ts +13 -0
- package/templates/astro-lorem-intl/src/components/pages/Articles.schema.ts +20 -0
- package/templates/astro-lorem-intl/src/components/pages/Home.schema.ts +26 -0
- package/templates/astro-lorem-intl/src/components/pages/News.schema.ts +17 -0
- package/templates/astro-lorem-intl/src/components/pages/Page.schema.ts +24 -0
- package/templates/astro-lorem-intl/src/components/sections/FavouriteArticles.schema.ts +17 -0
- package/templates/astro-lorem-intl/src/components/sections/Footer.schema.ts +31 -0
- package/templates/astro-lorem-intl/src/components/sections/Header.schema.ts +21 -0
- package/templates/astro-lorem-intl/src/components/sections/Hero.schema.ts +24 -0
- package/templates/astro-lorem-intl/src/components/sections/ImageText.schema.ts +30 -0
- package/templates/astro-lorem-intl/src/components/sections/PageHero.schema.ts +21 -0
- package/templates/astro-lorem-intl/src/components/sections/People.schema.ts +15 -0
- package/templates/astro-lorem-intl/src/components/sections/Points.schema.ts +21 -0
- package/templates/astro-lorem-intl/src/components/sections/Quote.schema.ts +23 -0
- package/templates/astro-lorem-intl/src/elements/callout.astro +13 -0
- package/templates/astro-lorem-intl/src/elements/cta.astro +15 -0
- package/templates/astro-lorem-intl/src/entry-pages/articles.astro +71 -0
- package/templates/astro-lorem-intl/src/entry-pages/news.astro +29 -0
- package/templates/astro-lorem-intl/src/layouts/Layout.astro +39 -0
- package/templates/astro-lorem-intl/src/live.config.ts +20 -0
- package/templates/astro-lorem-intl/src/messages/en.json +7 -0
- package/templates/astro-lorem-intl/src/messages/fi.json +7 -0
- package/templates/astro-lorem-intl/src/page-types/articlesIndex.astro +24 -0
- package/templates/astro-lorem-intl/src/page-types/home.astro +14 -0
- package/templates/astro-lorem-intl/src/page-types/newsIndex.astro +28 -0
- package/templates/astro-lorem-intl/src/page-types/page.astro +27 -0
- package/templates/astro-lorem-intl/src/pages/404.astro +7 -0
- package/templates/astro-lorem-intl/src/sections/favouriteArticles.astro +26 -0
- package/templates/astro-lorem-intl/src/sections/footer.astro +37 -0
- package/templates/astro-lorem-intl/src/sections/header.astro +27 -0
- package/templates/astro-lorem-intl/src/sections/hero.astro +28 -0
- package/templates/astro-lorem-intl/src/sections/imageText.astro +22 -0
- package/templates/astro-lorem-intl/src/sections/pageHero.astro +20 -0
- package/templates/astro-lorem-intl/src/sections/peopleSection.astro +24 -0
- package/templates/astro-lorem-intl/src/sections/points.astro +33 -0
- package/templates/astro-lorem-intl/src/sections/quote.astro +16 -0
- package/templates/astro-lorem-intl/src/smoodly/collections.ts +63 -0
- package/templates/astro-lorem-intl/src/smoodly/config.ts +48 -0
- package/templates/astro-lorem-intl/src/smoodly/elements.ts +6 -0
- package/templates/astro-lorem-intl/src/smoodly/globals.ts +29 -0
- package/templates/astro-lorem-intl/src/smoodly/sections.ts +18 -0
- package/templates/astro-lorem-intl/src/smoodly/toolsets.ts +16 -0
- package/templates/astro-lorem-intl/src/strings.ts +17 -0
- package/templates/astro-lorem-intl/src/styles/global.css +228 -0
- package/templates/astro-lorem-intl/supabase/migrations/20260926120000_smoodly_v1.sql +535 -0
- package/templates/astro-lorem-intl/supabase/migrations/20260926130000_smoodly_v2.sql +26 -0
- package/templates/astro-lorem-intl/supabase/migrations/20260926140000_smoodly_v3.sql +38 -0
- package/templates/astro-lorem-intl/supabase/migrations/20260926150000_smoodly_v4.sql +41 -0
- package/templates/astro-lorem-intl/supabase/migrations/20260929120000_smoodly_v5.sql +56 -0
- package/templates/astro-lorem-intl/supabase/migrations/20260929135523_smoodly_v6.sql +200 -0
- package/templates/astro-lorem-intl/supabase/migrations/20260930040956_smoodly_v7.sql +84 -0
- package/templates/astro-lorem-intl/supabase/migrations/20261007120000_smoodly_v8.sql +154 -0
- package/templates/astro-lorem-intl/supabase/migrations/20261007200000_smoodly_v9.sql +30 -0
- package/templates/{lorem-intl/supabase/migrations/20260930041056_smoodly_views.sql → astro-lorem-intl/supabase/migrations/20261007200100_smoodly_views.sql} +1 -1
- package/templates/astro-lorem-intl/tsconfig.json +17 -0
- package/templates/astro-lorem-intl.tsconfig.json +24 -0
- package/templates/astro-lorem.tsconfig.json +24 -0
- package/templates/blank/AGENTS.md +23 -16
- package/templates/blank/README.md +20 -15
- package/templates/blank/app/(smoodly)/admin/[[...segments]]/route.ts +8 -0
- package/templates/blank/components/elements/Button.schema.ts +22 -0
- package/templates/blank/components/elements/Button.tsx +2 -20
- package/templates/blank/components/pages/Home.schema.ts +17 -0
- package/templates/blank/components/pages/Home.tsx +2 -16
- package/templates/blank/components/pages/Page.schema.ts +14 -0
- package/templates/blank/components/pages/Page.tsx +2 -14
- package/templates/blank/components/pages/Post.tsx +5 -4
- package/templates/blank/components/sections/Text.schema.ts +24 -0
- package/templates/blank/components/sections/Text.tsx +7 -27
- package/templates/blank/package.json +1 -1
- package/templates/blank/scripts/seed.ts +2 -2
- package/templates/blank/smoodly/config.ts +8 -7
- package/templates/blank/smoodly/elements.ts +4 -4
- package/templates/blank/smoodly/globals.ts +4 -2
- package/templates/blank/smoodly/richtext.tsx +4 -5
- package/templates/blank/smoodly/sections.ts +4 -4
- package/templates/blank/smoodly/server.ts +22 -44
- package/templates/blank/smoodly/toolsets.ts +2 -2
- package/templates/blank/smoodly/views.ts +15 -0
- package/templates/blank/supabase/migrations/20261007120000_smoodly_v8.sql +154 -0
- package/templates/blank/supabase/migrations/20261007200000_smoodly_v9.sql +30 -0
- package/templates/blank/supabase/migrations/20261007200100_smoodly_views.sql +20 -0
- package/templates/blank-intl/AGENTS.md +23 -16
- package/templates/blank-intl/README.md +20 -15
- package/templates/blank-intl/app/(smoodly)/admin/[[...segments]]/route.ts +8 -0
- package/templates/blank-intl/components/elements/Button.schema.ts +22 -0
- package/templates/blank-intl/components/elements/Button.tsx +2 -20
- package/templates/blank-intl/components/pages/Home.schema.ts +17 -0
- package/templates/blank-intl/components/pages/Home.tsx +2 -16
- package/templates/blank-intl/components/pages/Page.schema.ts +14 -0
- package/templates/blank-intl/components/pages/Page.tsx +2 -14
- package/templates/blank-intl/components/pages/Post.tsx +5 -4
- package/templates/blank-intl/components/sections/Text.schema.ts +24 -0
- package/templates/blank-intl/components/sections/Text.tsx +7 -27
- package/templates/blank-intl/package.json +1 -1
- package/templates/blank-intl/scripts/seed.ts +2 -2
- package/templates/blank-intl/smoodly/config.ts +8 -7
- package/templates/blank-intl/smoodly/elements.ts +4 -4
- package/templates/blank-intl/smoodly/globals.ts +4 -2
- package/templates/blank-intl/smoodly/richtext.tsx +4 -5
- package/templates/blank-intl/smoodly/sections.ts +4 -4
- package/templates/blank-intl/smoodly/server.ts +22 -44
- package/templates/blank-intl/smoodly/toolsets.ts +2 -2
- package/templates/blank-intl/smoodly/views.ts +15 -0
- package/templates/blank-intl/supabase/migrations/20261007120000_smoodly_v8.sql +154 -0
- package/templates/blank-intl/supabase/migrations/20261007200000_smoodly_v9.sql +30 -0
- package/templates/blank-intl/supabase/migrations/20261007200100_smoodly_views.sql +20 -0
- package/templates/lorem/AGENTS.md +23 -16
- package/templates/lorem/README.md +3 -3
- package/templates/lorem/app/(smoodly)/admin/[[...segments]]/route.ts +8 -0
- package/templates/lorem/components/elements/Callout.schema.ts +24 -0
- package/templates/lorem/components/elements/Callout.tsx +2 -24
- package/templates/lorem/components/elements/Cta.schema.ts +21 -0
- package/templates/lorem/components/elements/Cta.tsx +2 -21
- package/templates/lorem/components/pages/Article.tsx +1 -1
- package/templates/lorem/components/pages/Articles.schema.ts +20 -0
- package/templates/lorem/components/pages/Articles.tsx +2 -20
- package/templates/lorem/components/pages/Home.schema.ts +26 -0
- package/templates/lorem/components/pages/Home.tsx +2 -26
- package/templates/lorem/components/pages/News.schema.ts +17 -0
- package/templates/lorem/components/pages/News.tsx +2 -17
- package/templates/lorem/components/pages/NewsPost.tsx +1 -1
- package/templates/lorem/components/pages/Page.schema.ts +24 -0
- package/templates/lorem/components/pages/Page.tsx +2 -24
- package/templates/lorem/components/sections/FavouriteArticles.schema.ts +17 -0
- package/templates/lorem/components/sections/FavouriteArticles.tsx +2 -17
- package/templates/lorem/components/sections/Footer.schema.ts +31 -0
- package/templates/lorem/components/sections/Footer.tsx +4 -32
- package/templates/lorem/components/sections/Header.schema.ts +21 -0
- package/templates/lorem/components/sections/Header.tsx +2 -21
- package/templates/lorem/components/sections/Hero.schema.ts +24 -0
- package/templates/lorem/components/sections/Hero.tsx +2 -24
- package/templates/lorem/components/sections/ImageText.schema.ts +30 -0
- package/templates/lorem/components/sections/ImageText.tsx +2 -30
- package/templates/lorem/components/sections/PageHero.schema.ts +21 -0
- package/templates/lorem/components/sections/PageHero.tsx +2 -21
- package/templates/lorem/components/sections/People.schema.ts +15 -0
- package/templates/lorem/components/sections/People.tsx +2 -14
- package/templates/lorem/components/sections/Points.schema.ts +21 -0
- package/templates/lorem/components/sections/Points.tsx +2 -21
- package/templates/lorem/components/sections/Quote.schema.ts +23 -0
- package/templates/lorem/components/sections/Quote.tsx +2 -23
- package/templates/lorem/package.json +1 -1
- package/templates/lorem/scripts/seed.ts +18 -18
- package/templates/lorem/smoodly/collections.ts +2 -2
- package/templates/lorem/smoodly/config.ts +14 -15
- package/templates/lorem/smoodly/elements.ts +5 -5
- package/templates/lorem/smoodly/globals.ts +10 -7
- package/templates/lorem/smoodly/richtext.tsx +5 -5
- package/templates/lorem/smoodly/sections.ts +12 -13
- package/templates/lorem/smoodly/server.ts +22 -44
- package/templates/lorem/smoodly/toolsets.ts +3 -3
- package/templates/lorem/smoodly/views.ts +33 -0
- package/templates/lorem/supabase/migrations/20261007120000_smoodly_v8.sql +154 -0
- package/templates/lorem/supabase/migrations/20261007200000_smoodly_v9.sql +30 -0
- package/templates/lorem/supabase/migrations/20261007200100_smoodly_views.sql +58 -0
- package/templates/lorem-intl/AGENTS.md +23 -16
- package/templates/lorem-intl/README.md +3 -3
- package/templates/lorem-intl/app/(smoodly)/admin/[[...segments]]/route.ts +8 -0
- package/templates/lorem-intl/components/elements/Callout.schema.ts +24 -0
- package/templates/lorem-intl/components/elements/Callout.tsx +2 -24
- package/templates/lorem-intl/components/elements/Cta.schema.ts +21 -0
- package/templates/lorem-intl/components/elements/Cta.tsx +2 -21
- package/templates/lorem-intl/components/pages/Article.tsx +1 -1
- package/templates/lorem-intl/components/pages/Articles.schema.ts +20 -0
- package/templates/lorem-intl/components/pages/Articles.tsx +2 -20
- package/templates/lorem-intl/components/pages/Home.schema.ts +26 -0
- package/templates/lorem-intl/components/pages/Home.tsx +2 -26
- package/templates/lorem-intl/components/pages/News.schema.ts +17 -0
- package/templates/lorem-intl/components/pages/News.tsx +2 -17
- package/templates/lorem-intl/components/pages/NewsPost.tsx +1 -1
- package/templates/lorem-intl/components/pages/Page.schema.ts +24 -0
- package/templates/lorem-intl/components/pages/Page.tsx +2 -24
- package/templates/lorem-intl/components/sections/FavouriteArticles.schema.ts +17 -0
- package/templates/lorem-intl/components/sections/FavouriteArticles.tsx +2 -17
- package/templates/lorem-intl/components/sections/Footer.schema.ts +31 -0
- package/templates/lorem-intl/components/sections/Footer.tsx +4 -32
- package/templates/lorem-intl/components/sections/Header.schema.ts +21 -0
- package/templates/lorem-intl/components/sections/Header.tsx +2 -21
- package/templates/lorem-intl/components/sections/Hero.schema.ts +24 -0
- package/templates/lorem-intl/components/sections/Hero.tsx +2 -24
- package/templates/lorem-intl/components/sections/ImageText.schema.ts +30 -0
- package/templates/lorem-intl/components/sections/ImageText.tsx +2 -30
- package/templates/lorem-intl/components/sections/PageHero.schema.ts +21 -0
- package/templates/lorem-intl/components/sections/PageHero.tsx +2 -21
- package/templates/lorem-intl/components/sections/People.schema.ts +15 -0
- package/templates/lorem-intl/components/sections/People.tsx +2 -14
- package/templates/lorem-intl/components/sections/Points.schema.ts +21 -0
- package/templates/lorem-intl/components/sections/Points.tsx +2 -21
- package/templates/lorem-intl/components/sections/Quote.schema.ts +23 -0
- package/templates/lorem-intl/components/sections/Quote.tsx +2 -23
- package/templates/lorem-intl/package.json +1 -1
- package/templates/lorem-intl/scripts/seed.ts +18 -18
- package/templates/lorem-intl/smoodly/collections.ts +2 -2
- package/templates/lorem-intl/smoodly/config.ts +14 -15
- package/templates/lorem-intl/smoodly/elements.ts +5 -5
- package/templates/lorem-intl/smoodly/globals.ts +10 -7
- package/templates/lorem-intl/smoodly/richtext.tsx +5 -5
- package/templates/lorem-intl/smoodly/sections.ts +12 -13
- package/templates/lorem-intl/smoodly/server.ts +22 -44
- package/templates/lorem-intl/smoodly/toolsets.ts +3 -3
- package/templates/lorem-intl/smoodly/views.ts +33 -0
- package/templates/lorem-intl/supabase/migrations/20261007120000_smoodly_v8.sql +154 -0
- package/templates/lorem-intl/supabase/migrations/20261007200000_smoodly_v9.sql +30 -0
- package/templates/lorem-intl/supabase/migrations/20261007200100_smoodly_views.sql +58 -0
- package/templates/blank/app/(smoodly)/admin/[[...segments]]/page.tsx +0 -1
- package/templates/blank/app/(smoodly)/admin/layout.tsx +0 -15
- package/templates/blank/smoodly/admin.tsx +0 -6
- package/templates/blank/smoodly/ops.ts +0 -11
- package/templates/blank-intl/app/(smoodly)/admin/[[...segments]]/page.tsx +0 -1
- package/templates/blank-intl/app/(smoodly)/admin/layout.tsx +0 -15
- package/templates/blank-intl/smoodly/admin.tsx +0 -6
- package/templates/blank-intl/smoodly/ops.ts +0 -11
- package/templates/lorem/app/(smoodly)/admin/[[...segments]]/page.tsx +0 -1
- package/templates/lorem/app/(smoodly)/admin/layout.tsx +0 -15
- package/templates/lorem/smoodly/admin.tsx +0 -6
- package/templates/lorem/smoodly/ops.ts +0 -11
- package/templates/lorem-intl/app/(smoodly)/admin/[[...segments]]/page.tsx +0 -1
- package/templates/lorem-intl/app/(smoodly)/admin/layout.tsx +0 -15
- package/templates/lorem-intl/smoodly/admin.tsx +0 -6
- package/templates/lorem-intl/smoodly/ops.ts +0 -11
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/pages/404.astro — the site's own "not found" page: the shell rewrites here.
|
|
3
|
+
import Layout from "../layouts/Layout.astro";
|
|
4
|
+
---
|
|
5
|
+
<Layout head={{ title: "Not found", noindex: true, languages: {} }} locale="en">
|
|
6
|
+
<div class="container"><h1>Page not found</h1></div>
|
|
7
|
+
</Layout>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/sections/favouriteArticles.astro — the view of the section named "favouriteArticles":
|
|
3
|
+
// articles an editor picked, resolved before render, so the view gets article fields, not ids.
|
|
4
|
+
import { smoodly, type Props as SmoodlyProps } from "smoodly";
|
|
5
|
+
import { Section } from "smoodly/astro/components";
|
|
6
|
+
import { href } from "smoodly/astro/runtime";
|
|
7
|
+
import { favouriteArticlesSchema } from "@/components/sections/FavouriteArticles.schema";
|
|
8
|
+
import { config } from "@/smoodly/config";
|
|
9
|
+
import ArticleCard from "../components/ArticleCard.astro";
|
|
10
|
+
|
|
11
|
+
type Props = SmoodlyProps<typeof favouriteArticlesSchema>;
|
|
12
|
+
const { heading, items, styles } = Astro.props;
|
|
13
|
+
// A section receives its schema's props and nothing of the page; the request's locale is the one page-level
|
|
14
|
+
// value the adapter leaves it, on Astro.locals (shell.ts sets it).
|
|
15
|
+
// Outside the shell (a page file of the project's own) it is unset: the default locale then.
|
|
16
|
+
const locale: string = Astro.locals.smoodly?.locale ?? config.locales.default;
|
|
17
|
+
const m = smoodly.marks(favouriteArticlesSchema);
|
|
18
|
+
---
|
|
19
|
+
<Section styles={styles} class="favourites">
|
|
20
|
+
<div class="container">
|
|
21
|
+
<h2 class="h2" {...m.field("heading")}>{heading}</h2>
|
|
22
|
+
<div class="card-grid" {...m.field("items")}>
|
|
23
|
+
{(items ?? []).filter((a) => a !== null).map((a) => <ArticleCard article={a.fields} url={href(a.path!, locale)} locale={locale} />)}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</Section>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/sections/footer.astro — the view of the section named "footer", a visual global item
|
|
3
|
+
// the layout renders with the contact object item, which is not a footer field.
|
|
4
|
+
import { safeHref, smoodly, type Props as SmoodlyProps, type Scope } from "smoodly";
|
|
5
|
+
import { Section } from "smoodly/astro/components";
|
|
6
|
+
import { footerSchema } from "@/components/sections/Footer.schema";
|
|
7
|
+
|
|
8
|
+
type Column = { title: string; links: { label: string; href: string }[] };
|
|
9
|
+
type Props = SmoodlyProps<typeof footerSchema> & { contact?: { email: string; phone?: string; address: string } | null };
|
|
10
|
+
const { tagline, company, legal, social, copyright, contact, styles } = Astro.props;
|
|
11
|
+
const m = smoodly.marks(footerSchema);
|
|
12
|
+
const columns: [Column | undefined, Scope<Column>][] = [[company, m.object("company")], [legal, m.object("legal")], [social, m.object("social")]];
|
|
13
|
+
---
|
|
14
|
+
<Section as="footer" styles={styles} class="site-footer">
|
|
15
|
+
<div class="container site-footer__grid">
|
|
16
|
+
<div class="site-footer__about">
|
|
17
|
+
<p class="site-footer__tagline" {...m.field("tagline")}>{tagline}</p>
|
|
18
|
+
{contact && (
|
|
19
|
+
<address class="site-footer__contact">
|
|
20
|
+
<a href={`mailto:${contact.email}`}>{contact.email}</a>
|
|
21
|
+
{contact.phone && <span>{contact.phone}</span>}
|
|
22
|
+
<span>{contact.address}</span>
|
|
23
|
+
</address>
|
|
24
|
+
)}
|
|
25
|
+
</div>
|
|
26
|
+
{columns.map(([column, scope]) => column && (
|
|
27
|
+
<div class="site-footer__column" {...scope.attrs}>
|
|
28
|
+
<span class="site-footer__title" {...scope.field("title")}>{column.title}</span>
|
|
29
|
+
{(column.links ?? []).map((l, i) => {
|
|
30
|
+
const link = scope.item("links", i);
|
|
31
|
+
return <a href={safeHref(l.href)} {...link.attrs} {...link.field("label")}>{l.label}</a>;
|
|
32
|
+
})}
|
|
33
|
+
</div>
|
|
34
|
+
))}
|
|
35
|
+
</div>
|
|
36
|
+
<div class="container site-footer__copyright" {...m.field("copyright")}>{copyright}</div>
|
|
37
|
+
</Section>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/sections/header.astro — the view of the section named "header", a visual global item
|
|
3
|
+
// the layout renders with the locale links beside the schema's own props.
|
|
4
|
+
import { safeHref, smoodly, type Props as SmoodlyProps } from "smoodly";
|
|
5
|
+
import { Section } from "smoodly/astro/components";
|
|
6
|
+
import { headerSchema } from "@/components/sections/Header.schema";
|
|
7
|
+
|
|
8
|
+
type Props = SmoodlyProps<typeof headerSchema> & { home?: string; locales?: { code: string; url: string; current: boolean }[] };
|
|
9
|
+
const { brand, nav, home = "/", locales, styles } = Astro.props;
|
|
10
|
+
const m = smoodly.marks(headerSchema);
|
|
11
|
+
---
|
|
12
|
+
<Section as="header" styles={styles} class="site-header">
|
|
13
|
+
<div class="container site-header__bar">
|
|
14
|
+
<a class="site-header__brand" href={home} {...m.field("brand")}>{brand}</a>
|
|
15
|
+
<nav class="site-header__nav">
|
|
16
|
+
{(nav ?? []).map((item, i) => {
|
|
17
|
+
const link = m.item("nav", i);
|
|
18
|
+
return <a href={safeHref(item.href)} {...link.attrs} {...link.field("label")}>{item.label}</a>;
|
|
19
|
+
})}
|
|
20
|
+
</nav>
|
|
21
|
+
{locales && locales.length > 1 && (
|
|
22
|
+
<nav class="site-header__locales" aria-label="Language">
|
|
23
|
+
{locales.map((l) => <a href={l.url} aria-current={l.current ? "page" : undefined}>{l.code.toUpperCase()}</a>)}
|
|
24
|
+
</nav>
|
|
25
|
+
)}
|
|
26
|
+
</div>
|
|
27
|
+
</Section>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/sections/hero.astro — the view of the section named "hero"
|
|
3
|
+
import { safeHref, smoodly, type Props as SmoodlyProps } from "smoodly";
|
|
4
|
+
import { Image, Section } from "smoodly/astro/components";
|
|
5
|
+
import { heroSchema } from "@/components/sections/Hero.schema";
|
|
6
|
+
|
|
7
|
+
type Props = SmoodlyProps<typeof heroSchema>;
|
|
8
|
+
const { kicker, heading, text, buttons, image, styles } = Astro.props;
|
|
9
|
+
const m = smoodly.marks(heroSchema);
|
|
10
|
+
---
|
|
11
|
+
<Section styles={styles} class="hero">
|
|
12
|
+
<div class="container hero__grid">
|
|
13
|
+
<div class="hero__copy">
|
|
14
|
+
{kicker && <p class="kicker" {...m.field("kicker")}>{kicker}</p>}
|
|
15
|
+
<h1 class="hero__heading" {...m.field("heading")}>{heading}</h1>
|
|
16
|
+
<p class="hero__text" {...m.field("text")}>{text}</p>
|
|
17
|
+
{buttons?.length > 0 && (
|
|
18
|
+
<div class="hero__buttons">
|
|
19
|
+
{buttons.map((b, i) => {
|
|
20
|
+
const button = m.item("buttons", i);
|
|
21
|
+
return <a class={i === 0 ? "button" : "button button--outline"} href={safeHref(b.href)} {...button.attrs} {...button.field("label")}>{b.label}</a>;
|
|
22
|
+
})}
|
|
23
|
+
</div>
|
|
24
|
+
)}
|
|
25
|
+
</div>
|
|
26
|
+
{image && <Image image={image} class="hero__image" sizes="(min-width: 900px) 40vw, 100vw" priority {...m.field("image")} />}
|
|
27
|
+
</div>
|
|
28
|
+
</Section>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/sections/imageText.astro — the view of the section named "imageText"
|
|
3
|
+
import { safeHref, smoodly, type Props as SmoodlyProps } from "smoodly";
|
|
4
|
+
import { Image, RichText, Section } from "smoodly/astro/components";
|
|
5
|
+
import { imageTextSchema } from "@/components/sections/ImageText.schema";
|
|
6
|
+
|
|
7
|
+
type Props = SmoodlyProps<typeof imageTextSchema>;
|
|
8
|
+
const { image, heading, text, link, settings, styles } = Astro.props;
|
|
9
|
+
const m = smoodly.marks(imageTextSchema);
|
|
10
|
+
const linkMarks = m.object("link");
|
|
11
|
+
---
|
|
12
|
+
<Section styles={styles} class="image-text" data-image-side={settings.imageSide}>
|
|
13
|
+
<div class="container image-text__grid">
|
|
14
|
+
{image && <Image image={image} class="image-text__image" sizes="(min-width: 900px) 50vw, 100vw" {...m.field("image")} />}
|
|
15
|
+
{!image && <h2 class="h2" {...m.field("heading")}>{heading}</h2>}
|
|
16
|
+
<div class="image-text__copy">
|
|
17
|
+
{image && <h2 class="h2" {...m.field("heading")}>{heading}</h2>}
|
|
18
|
+
<div class="prose" {...m.field("text")}><RichText doc={text} /></div>
|
|
19
|
+
{link?.href && <a class="link-accent" href={safeHref(link.href)} {...linkMarks.attrs} {...linkMarks.field("label")}>{link.label}</a>}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</Section>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/sections/pageHero.astro — the view of the section named "pageHero"
|
|
3
|
+
import { smoodly, type Props as SmoodlyProps } from "smoodly";
|
|
4
|
+
import { Image, Section } from "smoodly/astro/components";
|
|
5
|
+
import { pageHeroSchema } from "@/components/sections/PageHero.schema";
|
|
6
|
+
|
|
7
|
+
type Props = SmoodlyProps<typeof pageHeroSchema>;
|
|
8
|
+
const { kicker, heading, text, image, styles } = Astro.props;
|
|
9
|
+
const m = smoodly.marks(pageHeroSchema);
|
|
10
|
+
---
|
|
11
|
+
<Section styles={styles} class="page-hero">
|
|
12
|
+
<div class="container page-hero__inner">
|
|
13
|
+
<div class="page-hero__copy">
|
|
14
|
+
{kicker && <p class="kicker" {...m.field("kicker")}>{kicker}</p>}
|
|
15
|
+
<h1 class="page-hero__heading" {...m.field("heading")}>{heading}</h1>
|
|
16
|
+
<p class="page-hero__text" {...m.field("text")}>{text}</p>
|
|
17
|
+
</div>
|
|
18
|
+
{image && <Image image={image} class="page-hero__image" sizes="100vw" priority {...m.field("image")} />}
|
|
19
|
+
</div>
|
|
20
|
+
</Section>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/sections/peopleSection.astro — the view of the section named "peopleSection"
|
|
3
|
+
import { smoodly, type Props as SmoodlyProps } from "smoodly";
|
|
4
|
+
import { Section } from "smoodly/astro/components";
|
|
5
|
+
import { peopleSchema } from "@/components/sections/People.schema";
|
|
6
|
+
|
|
7
|
+
type Props = SmoodlyProps<typeof peopleSchema>;
|
|
8
|
+
const { heading, people: persons, styles } = Astro.props;
|
|
9
|
+
const m = smoodly.marks(peopleSchema);
|
|
10
|
+
---
|
|
11
|
+
<Section styles={styles} class="people">
|
|
12
|
+
<div class="container">
|
|
13
|
+
<h2 class="h2" {...m.field("heading")}>{heading}</h2>
|
|
14
|
+
<div class="people__grid" {...m.field("people")}>
|
|
15
|
+
{(persons ?? []).filter((ref) => ref !== null).map(({ fields: person }) => (
|
|
16
|
+
<div class="person">
|
|
17
|
+
<span class="person__mark" aria-hidden="true">{person.name?.charAt(0)}</span>
|
|
18
|
+
<span class="person__name">{person.name}</span>
|
|
19
|
+
<span class="person__role">{person.role}</span>
|
|
20
|
+
</div>
|
|
21
|
+
))}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</Section>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/sections/points.astro — the view of the section named "points"
|
|
3
|
+
import { smoodly, type Props as SmoodlyProps } from "smoodly";
|
|
4
|
+
import { Section } from "smoodly/astro/components";
|
|
5
|
+
import { pointsSchema } from "@/components/sections/Points.schema";
|
|
6
|
+
|
|
7
|
+
type Props = SmoodlyProps<typeof pointsSchema>;
|
|
8
|
+
const { heading, points, styles } = Astro.props;
|
|
9
|
+
const m = smoodly.marks(pointsSchema);
|
|
10
|
+
const icons: Record<string, string> = {
|
|
11
|
+
circle: '<circle cx="20" cy="20" r="18" />',
|
|
12
|
+
square: '<rect x="3" y="3" width="34" height="34" rx="4" />',
|
|
13
|
+
diamond: '<polygon points="20,2 38,20 20,38 2,20" />',
|
|
14
|
+
};
|
|
15
|
+
---
|
|
16
|
+
<Section styles={styles} class="points">
|
|
17
|
+
<div class="container">
|
|
18
|
+
<h2 class="h2" {...m.field("heading")}>{heading}</h2>
|
|
19
|
+
<div class="points__grid">
|
|
20
|
+
{/* A real crash for the suite's guard test: `(points ?? []).map` on a string throws here, as in the React view. */}
|
|
21
|
+
{(points ?? []).map((point, i) => {
|
|
22
|
+
const p = m.item("points", i);
|
|
23
|
+
return (
|
|
24
|
+
<div class="point" {...p.attrs}>
|
|
25
|
+
<svg class="point__icon" width="40" height="40" viewBox="0 0 40 40" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.5" {...p.field("icon")} set:html={icons[point.icon] ?? icons.circle}></svg>
|
|
26
|
+
<h3 class="point__heading" {...p.field("heading")}>{point.heading}</h3>
|
|
27
|
+
<p class="point__text" {...p.field("text")}>{point.text}</p>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
})}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</Section>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
// examples/astro/src/sections/quote.astro — the view of the section named "quote"
|
|
3
|
+
import { smoodly, type Props as SmoodlyProps } from "smoodly";
|
|
4
|
+
import { Section } from "smoodly/astro/components";
|
|
5
|
+
import { quoteSchema } from "@/components/sections/Quote.schema";
|
|
6
|
+
|
|
7
|
+
type Props = SmoodlyProps<typeof quoteSchema>;
|
|
8
|
+
const { text, attribution, settings, styles } = Astro.props;
|
|
9
|
+
const m = smoodly.marks(quoteSchema);
|
|
10
|
+
---
|
|
11
|
+
<Section styles={styles} class="quote" data-background={settings.background}>
|
|
12
|
+
<div class="quote__inner">
|
|
13
|
+
<blockquote class="quote__text">“<span {...m.field("text")}>{text}</span>”</blockquote>
|
|
14
|
+
<p class="quote__attribution" {...m.field("attribution")}>{attribution}</p>
|
|
15
|
+
</div>
|
|
16
|
+
</Section>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { f, smoodly } from "smoodly";
|
|
2
|
+
import { article } from "./toolsets";
|
|
3
|
+
|
|
4
|
+
// A person's name is the same in every language; the role is translated.
|
|
5
|
+
// Shared fields live on the entry, .localized() ones on its locale rows
|
|
6
|
+
// (spec 2026-09-06 §7).
|
|
7
|
+
export const people = smoodly.collection({
|
|
8
|
+
name: "people",
|
|
9
|
+
title: "People",
|
|
10
|
+
titleField: "name",
|
|
11
|
+
order: "manual",
|
|
12
|
+
fields: {
|
|
13
|
+
name: f.text(),
|
|
14
|
+
role: f.text().localized(),
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// Articles are served at a path that is per locale — /posts/<slug> and
|
|
19
|
+
// /fi/artikkelit/<slug> — and the Articles fixed page claims the same
|
|
20
|
+
// segments, which makes it the collection's index page. Tags are f.tags(),
|
|
21
|
+
// localized as a whole, so the Finnish row carries Finnish tags.
|
|
22
|
+
export const articles = smoodly.collection({
|
|
23
|
+
name: "articles",
|
|
24
|
+
title: "Articles",
|
|
25
|
+
titleField: "title",
|
|
26
|
+
path: { en: "posts", fi: "artikkelit" },
|
|
27
|
+
order: { by: "date", direction: "desc" },
|
|
28
|
+
seo: { description: "excerpt", image: "image" },
|
|
29
|
+
fields: {
|
|
30
|
+
title: f.text().localized(),
|
|
31
|
+
image: f.image({ aspect: "3:2" }),
|
|
32
|
+
date: f.date(),
|
|
33
|
+
author: f.ref(() => people),
|
|
34
|
+
slug: f.slug({ from: "title" }),
|
|
35
|
+
excerpt: f.text().localized(),
|
|
36
|
+
// The article toolset: the default marks and blocks, body images and the elements.
|
|
37
|
+
body: f.richtext({ toolset: article }).localized(),
|
|
38
|
+
tags: f.tags().localized(),
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// News lives under the company: a nested address, owned by code whole
|
|
43
|
+
// (spec 2026-09-29 nested paths). The Company page at /company is an
|
|
44
|
+
// editor's page; renaming it never moves the news. The News fixed page
|
|
45
|
+
// claims the same address, which makes it
|
|
46
|
+
// the collection's index page.
|
|
47
|
+
export const news = smoodly.collection({
|
|
48
|
+
name: "news",
|
|
49
|
+
title: "News",
|
|
50
|
+
titleField: "title",
|
|
51
|
+
path: { en: "company/news", fi: "yritys/uutiset" },
|
|
52
|
+
order: { by: "date", direction: "desc" },
|
|
53
|
+
seo: { description: "excerpt" },
|
|
54
|
+
fields: {
|
|
55
|
+
title: f.text().localized(),
|
|
56
|
+
date: f.date(),
|
|
57
|
+
slug: f.slug({ from: "title" }),
|
|
58
|
+
excerpt: f.text().localized(),
|
|
59
|
+
body: f.richtext({ toolset: article }).localized(),
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const collections = [people, articles, news];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineConfig } from "smoodly";
|
|
2
|
+
import { collections } from "./collections";
|
|
3
|
+
import { sections } from "./sections";
|
|
4
|
+
import { globals } from "./globals";
|
|
5
|
+
import { elements } from "./elements";
|
|
6
|
+
import { article } from "./toolsets";
|
|
7
|
+
import { homeSchema } from "@/components/pages/Home.schema";
|
|
8
|
+
import { articlesSchema } from "@/components/pages/Articles.schema";
|
|
9
|
+
import { pageSchema } from "@/components/pages/Page.schema";
|
|
10
|
+
import { newsSchema } from "@/components/pages/News.schema";
|
|
11
|
+
|
|
12
|
+
export { collections, sections, globals, elements };
|
|
13
|
+
|
|
14
|
+
// The registry of schemas and the plain settings, one file. It imports
|
|
15
|
+
// no component and no route file, so a script, the CLI and (later) an MCP
|
|
16
|
+
// server can load it outside the app; the views are files by name under
|
|
17
|
+
// src/. The locale set is below; astro.config.ts declares the same set.
|
|
18
|
+
export const config = defineConfig({
|
|
19
|
+
registry: {
|
|
20
|
+
sections,
|
|
21
|
+
// Elements (block nodes spec 2026-09-08): what an article body may embed.
|
|
22
|
+
elements,
|
|
23
|
+
collections,
|
|
24
|
+
globals,
|
|
25
|
+
// Page types. The entry pages are views: src/entry-pages/<collection>.astro.
|
|
26
|
+
pages: [homeSchema, articlesSchema, pageSchema, newsSchema],
|
|
27
|
+
},
|
|
28
|
+
locales: { default: "en", supported: ["en", "fi"] },
|
|
29
|
+
// Editors pick dates and times in this zone; the views format with it (an IANA name, never an offset).
|
|
30
|
+
timeZone: "Europe/Helsinki",
|
|
31
|
+
// Smoodly's own default, spelled out: the record the site root serves.
|
|
32
|
+
homePageSlug: "home",
|
|
33
|
+
// Nesting on: an editor can put pages three deep.
|
|
34
|
+
pages: { tree: { depth: 3 } },
|
|
35
|
+
// Smoodly's styles set (spacing, width, align) renders inline from
|
|
36
|
+
// these CSS values; the site's stylesheet defines the variables per
|
|
37
|
+
// breakpoint. Default stores nothing — a section looks as written.
|
|
38
|
+
styles: {
|
|
39
|
+
spacing: { sm: "var(--space-sm)", md: "var(--space-md)", lg: "var(--space-lg)" },
|
|
40
|
+
width: { narrow: "var(--width-narrow)", wide: "var(--width-wide)", full: "none" },
|
|
41
|
+
},
|
|
42
|
+
// The custom-CSS box in a section's Advanced group (scoped, sanitized).
|
|
43
|
+
css: true,
|
|
44
|
+
// The custom section (spec 2026-09-14 §6): the editor's own rows of
|
|
45
|
+
// columns. The columns take the article toolset (headings, lists,
|
|
46
|
+
// images, Callout and Cta); the view's RichText renders them.
|
|
47
|
+
custom: { toolset: article },
|
|
48
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// The element schemas a richtext body may embed; their views are
|
|
2
|
+
// src/elements/<name>.astro files.
|
|
3
|
+
import { calloutSchema } from "@/components/elements/Callout.schema";
|
|
4
|
+
import { ctaSchema } from "@/components/elements/Cta.schema";
|
|
5
|
+
|
|
6
|
+
export const elements = [calloutSchema, ctaSchema];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Global content (spec 2026-09-07): code-declared singletons stored as
|
|
2
|
+
// entries. `header` and `footer` are visual — the layout renders them;
|
|
3
|
+
// `contact` is an object the footer reads through the layout; `quote` is
|
|
4
|
+
// visual and placed on pages from the picker's Global group. The three
|
|
5
|
+
// the layout renders on every page are `layout: true`: they come with
|
|
6
|
+
// the page's own read, so the layout's reads cost no database call.
|
|
7
|
+
import { f, smoodly } from "smoodly";
|
|
8
|
+
import { headerSchema } from "@/components/sections/Header.schema";
|
|
9
|
+
import { footerSchema } from "@/components/sections/Footer.schema";
|
|
10
|
+
import { quoteSchema } from "@/components/sections/Quote.schema";
|
|
11
|
+
|
|
12
|
+
export const header = smoodly.global({ name: "header", title: "Header", section: headerSchema, layout: true });
|
|
13
|
+
|
|
14
|
+
export const footer = smoodly.global({ name: "footer", title: "Footer", section: footerSchema, layout: true });
|
|
15
|
+
|
|
16
|
+
export const contact = smoodly.global({
|
|
17
|
+
name: "contact",
|
|
18
|
+
title: "Contact details",
|
|
19
|
+
fields: {
|
|
20
|
+
email: f.text(),
|
|
21
|
+
phone: f.text().optional(),
|
|
22
|
+
address: f.text().localized(),
|
|
23
|
+
},
|
|
24
|
+
layout: true,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const quote = smoodly.global({ name: "quote", title: "Quote", section: quoteSchema });
|
|
28
|
+
|
|
29
|
+
export const globals = [header, footer, contact, quote];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// The site's section schemas, in one list. config.ts puts it in the
|
|
2
|
+
// registry; the views are src/sections/<name>.astro files.
|
|
3
|
+
// Header and Footer are here because their global items render through
|
|
4
|
+
// them; no zone lists them, so the "+" picker never offers them. Quote
|
|
5
|
+
// is both: its global item renders through it, and the body zones list
|
|
6
|
+
// it so the global quote can be placed (the picker offers a global item
|
|
7
|
+
// only where its section is allowed).
|
|
8
|
+
import { heroSchema } from "@/components/sections/Hero.schema";
|
|
9
|
+
import { pageHeroSchema } from "@/components/sections/PageHero.schema";
|
|
10
|
+
import { imageTextSchema } from "@/components/sections/ImageText.schema";
|
|
11
|
+
import { pointsSchema } from "@/components/sections/Points.schema";
|
|
12
|
+
import { favouriteArticlesSchema } from "@/components/sections/FavouriteArticles.schema";
|
|
13
|
+
import { peopleSchema } from "@/components/sections/People.schema";
|
|
14
|
+
import { quoteSchema } from "@/components/sections/Quote.schema";
|
|
15
|
+
import { headerSchema } from "@/components/sections/Header.schema";
|
|
16
|
+
import { footerSchema } from "@/components/sections/Footer.schema";
|
|
17
|
+
|
|
18
|
+
export const sections = [heroSchema, pageHeroSchema, imageTextSchema, pointsSchema, favouriteArticlesSchema, peopleSchema, quoteSchema, headerSchema, footerSchema];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Toolsets are values, not registrations: a richtext field imports one.
|
|
2
|
+
// `article` is the long-form set — the default marks and blocks plus body
|
|
3
|
+
// images and the two elements. Elements are embedded by value; the
|
|
4
|
+
// config must also register them (defineConfig checks). Relative imports
|
|
5
|
+
// on purpose: collections.ts pulls this file into create-smoodly-app's
|
|
6
|
+
// template build, which runs outside the app where the `@/` alias has
|
|
7
|
+
// no mapping.
|
|
8
|
+
import { smoodly } from "smoodly";
|
|
9
|
+
import { calloutSchema } from "../components/elements/Callout.schema";
|
|
10
|
+
import { ctaSchema } from "../components/elements/Cta.schema";
|
|
11
|
+
|
|
12
|
+
export const article = smoodly.toolset({
|
|
13
|
+
marks: ["bold", "italic", "link"],
|
|
14
|
+
nodes: ["h2", "h3", "h4", "bulletList", "orderedList", "blockquote", "image"],
|
|
15
|
+
elements: [calloutSchema, ctaSchema],
|
|
16
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// examples/astro/src/strings.ts
|
|
2
|
+
// The site's own UI strings in the page's language — what a view says that is not content: "All articles",
|
|
3
|
+
// "min read". The messages are plain JSON under messages/; this seam reads them with no i18n library behind it.
|
|
4
|
+
/// <reference types="vite/client" />
|
|
5
|
+
import en from "@/messages/en.json";
|
|
6
|
+
|
|
7
|
+
// Every messages/*.json, keyed by its file name: a locale the installer added (messages/de.json) is read with no edit here.
|
|
8
|
+
const files = import.meta.glob<Record<string, string>>("@/messages/*.json", { eager: true, import: "default" });
|
|
9
|
+
const messages: Record<string, Record<string, string>> = Object.fromEntries(
|
|
10
|
+
Object.entries(files).map(([path, json]) => [path.slice(path.lastIndexOf("/") + 1, -".json".length), json]),
|
|
11
|
+
);
|
|
12
|
+
export type StringKey = keyof typeof en;
|
|
13
|
+
|
|
14
|
+
export function ui(locale: string): { t: (key: StringKey, values?: Record<string, string | number>) => string } {
|
|
15
|
+
const m = messages[locale] ?? en;
|
|
16
|
+
return { t: (key, values = {}) => (m[key] ?? en[key]).replace(/\{(\w+)\}/g, (_, name: string) => String(values[name] ?? "")) };
|
|
17
|
+
}
|