diff --git a/.github/workflows/build-and-deploy.yaml b/.github/workflows/build-and-deploy.yaml new file mode 100644 index 0000000000..858dfb4d28 --- /dev/null +++ b/.github/workflows/build-and-deploy.yaml @@ -0,0 +1,34 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm install + - run: npm run build --if-present + - name: Installing surge + run: npm install --global surge + - name: Deploy to Surge + run: surge ./dist ${{vars.SURGE_PROD_URL}} --token ${{secrets.SURGE_TOKEN}} + - name: Deploy to prod + run: surge ./dist fundacionplantemos.org --token ${{secrets.SURGE_TOKEN}} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 33741a87b6..b76cbabc9a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,6 @@ pnpm-debug.log* pnpm-lock.yaml -.astro \ No newline at end of file +.astro + +package-lock.json \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a3a0f17436..88cfaf4189 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "@onwidget/astrowind", "version": "1.0.0-beta.18", "dependencies": { + "@astro-community/astro-embed-youtube": "^0.4.4", "@astrojs/rss": "^4.0.5", "@astrojs/sitemap": "^3.1.1", "@astrolib/analytics": "^0.5.0", @@ -200,6 +201,17 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/@astro-community/astro-embed-youtube": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@astro-community/astro-embed-youtube/-/astro-embed-youtube-0.4.4.tgz", + "integrity": "sha512-fYlycLrJFNnibZ9VHPSJO766kO2IgqYQU4mBd4iaDMaicL0gGX9cVZ80QdnpzGrI6w0XOJOY7prx86eWEVBy8w==", + "dependencies": { + "lite-youtube-embed": "^0.2.0" + }, + "peerDependencies": { + "astro": "^2.0.0 || ^3.0.0-beta || ^4.0.0-beta" + } + }, "node_modules/@astrojs/compiler": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.5.3.tgz", @@ -6952,6 +6964,11 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, + "node_modules/lite-youtube-embed": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/lite-youtube-embed/-/lite-youtube-embed-0.2.0.tgz", + "integrity": "sha512-XXXAk5sbvtjjwbie3XG+6HppgTm1HTGL/Uk9z9NkJH53o7puZLur434heHzAjkS60hZB3vT4ls25zl5rMiX4EA==" + }, "node_modules/load-yaml-file": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", diff --git a/package.json b/package.json index a07c4595e0..6c3d2727fe 100644 --- a/package.json +++ b/package.json @@ -13,16 +13,17 @@ "lint:eslint": "eslint . --ext .js,.ts,.astro" }, "dependencies": { + "@astro-community/astro-embed-youtube": "^0.5.7", "@astrojs/rss": "^4.0.5", "@astrojs/sitemap": "^3.1.1", - "@astrolib/analytics": "^0.5.0", + "@astrolib/analytics": "^0.6.1", "@astrolib/seo": "^1.0.0-beta.5", "@fontsource-variable/inter": "^5.0.16", "astro": "^4.4.4", "astro-icon": "^1.1.0", "limax": "4.1.0", "lodash.merge": "^4.6.2", - "typescript-esbuild": "^0.3.9", + "typescript-esbuild": "^0.4.10", "unpic": "^3.17.0" }, "devDependencies": { @@ -34,18 +35,18 @@ "@tailwindcss/typography": "^0.5.10", "@types/js-yaml": "^4.0.9", "@types/lodash.merge": "^4.6.9", - "@typescript-eslint/eslint-plugin": "^7.0.2", - "@typescript-eslint/parser": "^7.0.2", - "astro-compress": "2.2.10", + "@typescript-eslint/eslint-plugin": "^7.18.0", + "@typescript-eslint/parser": "^7.18.0", + "astro-compress": "2.3.8", "eslint": "^8.57.0", "eslint-plugin-astro": "^0.31.4", "eslint-plugin-jsx-a11y": "^6.8.0", "js-yaml": "^4.1.0", "mdast-util-to-string": "^4.0.0", "prettier": "^3.2.5", - "prettier-plugin-astro": "^0.13.0", + "prettier-plugin-astro": "^0.14.1", "reading-time": "^1.5.0", - "sharp": "0.33.2", + "sharp": "0.34.4", "tailwind-merge": "^2.2.1", "tailwindcss": "^3.4.1", "typescript": "^5.3.3" diff --git a/src/assets/images/logo-plantemos-compressed.png b/src/assets/images/logo-plantemos-compressed.png new file mode 100644 index 0000000000..5e86d73027 Binary files /dev/null and b/src/assets/images/logo-plantemos-compressed.png differ diff --git a/src/assets/images/plantemos-juntos.jpeg b/src/assets/images/plantemos-juntos.jpeg new file mode 100644 index 0000000000..28d7952e64 Binary files /dev/null and b/src/assets/images/plantemos-juntos.jpeg differ diff --git a/src/components/Logo.astro b/src/components/Logo.astro index f196575ff3..b60717255c 100644 --- a/src/components/Logo.astro +++ b/src/components/Logo.astro @@ -2,6 +2,8 @@ import { SITE } from '~/utils/config'; --- - - 🚀 {SITE?.name} + + 🌳 {SITE?.name} diff --git a/src/components/ui/ItemGrid2.astro b/src/components/ui/ItemGrid2.astro index 9d0bc42123..2d15729ac7 100644 --- a/src/components/ui/ItemGrid2.astro +++ b/src/components/ui/ItemGrid2.astro @@ -1,23 +1,18 @@ --- -import { Icon } from "astro-icon/components"; -import { twMerge } from "tailwind-merge"; -import type { ItemGrid } from "~/types"; -import Button from "./Button.astro"; +import { Icon } from 'astro-icon/components'; +import { twMerge } from 'tailwind-merge'; +import type { ItemGrid } from '~/types'; +import Button from './Button.astro'; -const { - items = [], - columns, - defaultIcon = "", - classes = {}, -} = Astro.props as ItemGrid; +const { items = [], columns, defaultIcon = '', classes = {} } = Astro.props as ItemGrid; const { - container: containerClass = "", + container: containerClass = '', // container: containerClass = "sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3", - panel: panelClass = "", - title: titleClass = "", - description: descriptionClass = "", - icon: defaultIconClass = "text-primary", + panel: panelClass = '', + title: titleClass = '', + description: descriptionClass = '', + icon: defaultIconClass = 'text-primary', } = classes; --- @@ -27,68 +22,32 @@ const { class={twMerge( `grid gap-8 gap-x-12 sm:gap-y-8 ${ columns === 4 - ? "lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2" + ? 'lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2' : columns === 3 - ? "lg:grid-cols-3 sm:grid-cols-2" - : columns === 2 - ? "sm:grid-cols-2 " - : "" + ? 'lg:grid-cols-3 sm:grid-cols-2' + : columns === 2 + ? 'sm:grid-cols-2 ' + : '' }`, containerClass )} > - {items.map( - ({ - title, - description, - icon, - callToAction, - classes: itemClasses = {}, - }) => ( -
- {(icon || defaultIcon) && ( - - )} -
- {title} + {items.map(({ title, description, icon, callToAction, classes: itemClasses = {} }) => ( +
+ {(icon || defaultIcon) && ( + + )} +
{title}
+ {description && ( +

+ )} + {callToAction && ( +

+
- {description && ( -

- )} - {callToAction && ( -

-
- )} -
- ) - )} + )} +
+ ))}
) } diff --git a/src/components/widgets/Announcement.astro b/src/components/widgets/Announcement.astro deleted file mode 100644 index fe95eb7dcd..0000000000 --- a/src/components/widgets/Announcement.astro +++ /dev/null @@ -1,25 +0,0 @@ ---- ---- - - diff --git a/src/components/widgets/BlogLatestPosts.astro b/src/components/widgets/BlogLatestPosts.astro index 9b45383ada..7cbd17117e 100644 --- a/src/components/widgets/BlogLatestPosts.astro +++ b/src/components/widgets/BlogLatestPosts.astro @@ -1,13 +1,13 @@ --- -import { APP_BLOG } from "~/utils/config"; +import { APP_BLOG } from '~/utils/config'; -import Grid from "~/components/blog/Grid.astro"; +import Grid from '~/components/blog/Grid.astro'; -import { getBlogPermalink } from "~/utils/permalinks"; -import { findLatestPosts } from "~/utils/blog"; -import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; -import type { Widget } from "~/types"; -import Button from "../ui/Button.astro"; +import { getBlogPermalink } from '~/utils/permalinks'; +import { findLatestPosts } from '~/utils/blog'; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import type { Widget } from '~/types'; +import Button from '../ui/Button.astro'; export interface Props extends Widget { title?: string; @@ -18,16 +18,16 @@ export interface Props extends Widget { } const { - title = await Astro.slots.render("title"), - linkText = "View all posts", + title = await Astro.slots.render('title'), + linkText = 'Ver todos los artículos', linkUrl = getBlogPermalink(), - information = await Astro.slots.render("information"), + information = await Astro.slots.render('information'), count = 4, id, isDark = false, classes = {}, - bg = await Astro.slots.render("bg"), + bg = await Astro.slots.render('bg'), } = Astro.props; const posts = APP_BLOG.isEnabled ? await findLatestPosts({ count }) : []; @@ -44,7 +44,10 @@ const posts = APP_BLOG.isEnabled ? await findLatestPosts({ count }) : []; set:html={title} /> {APP_BLOG.list.isEnabled && linkText && linkUrl && ( - + )} )} diff --git a/src/components/widgets/Features2.astro b/src/components/widgets/Features2.astro index b19411bc31..840143b1c8 100644 --- a/src/components/widgets/Features2.astro +++ b/src/components/widgets/Features2.astro @@ -1,47 +1,36 @@ --- -import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; -import Headline from "~/components/ui/Headline.astro"; -import ItemGrid2 from "~/components/ui/ItemGrid2.astro"; -import type { Features } from "~/types"; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import Headline from '~/components/ui/Headline.astro'; +import ItemGrid2 from '~/components/ui/ItemGrid2.astro'; +import type { Features } from '~/types'; const { - title = await Astro.slots.render("title"), - subtitle = await Astro.slots.render("subtitle"), - tagline = await Astro.slots.render("tagline"), + title = await Astro.slots.render('title'), + subtitle = await Astro.slots.render('subtitle'), + tagline = await Astro.slots.render('tagline'), items = [], columns = 3, defaultIcon, - id, isDark = false, classes = {}, - bg = await Astro.slots.render("bg"), + bg = await Astro.slots.render('bg'), } = Astro.props as Features; --- - - + + diff --git a/src/components/widgets/Header.astro b/src/components/widgets/Header.astro index ec76154e6d..99c4ed9726 100644 --- a/src/components/widgets/Header.astro +++ b/src/components/widgets/Header.astro @@ -1,13 +1,13 @@ --- -import { Icon } from "astro-icon/components"; -import Logo from "~/components/Logo.astro"; -import ToggleTheme from "~/components/common/ToggleTheme.astro"; -import ToggleMenu from "~/components/common/ToggleMenu.astro"; -import Button from "~/components/ui/Button.astro" +import { Icon } from 'astro-icon/components'; +import Logo from '~/components/Logo.astro'; +import ToggleTheme from '~/components/common/ToggleTheme.astro'; +import ToggleMenu from '~/components/common/ToggleMenu.astro'; +import Button from '~/components/ui/Button.astro'; -import { getHomePermalink } from "~/utils/permalinks"; -import { trimSlash, getAsset } from "~/utils/permalinks"; -import type { CallToAction } from "~/types"; +import { getHomePermalink } from '~/utils/permalinks'; +import { trimSlash, getAsset } from '~/utils/permalinks'; +import type { CallToAction } from '~/types'; interface Link { text?: string; @@ -35,7 +35,7 @@ export interface Props { } const { - id = "header", + id = 'header', links = [], actions = [], isSticky = false, @@ -43,30 +43,29 @@ const { isFullWidth = false, showToggleTheme = false, showRssFeed = false, - position = "center", + position = 'center', } = Astro.props; -const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}` +const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}`; ---
-
+
@@ -83,19 +82,20 @@ const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}` > { links.map(({ text, href, links }) => ( -
  • +
  • {links?.length ? ( <>