Skip to content

Commit

Permalink
Merge pull request #3 from SteveMoya/content-collection-feature
Browse files Browse the repository at this point in the history
Creacion y mejor estructura de proyecto
  • Loading branch information
doneber authored Mar 8, 2024
2 parents 7c58f94 + 33921b0 commit 641d588
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/components/ResourcesContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from "preact/hooks"
import { fetchResources } from "../utils"
import type { Resource } from "./../interfaces/resource.interface"
import { fetchResources } from "@utils/utils"
import type { Resource } from "@interfaces/resource.interface"
import { Card } from "./card/Card"

export const ResourcesContainer = () => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/searcher/SearchResults.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from "preact/hooks"
import type { Resource } from "../../interfaces/resource.interface.js"
import { searchResults } from "../../store.js"
import { Card } from "../card/Card.jsx"
import type { Resource } from "@interfaces/resource.interface.ts"
import { searchResults } from "@src/store.ts"
import { Card } from "../card/Card.tsx"

export const SearchResults = () => {
const [resources, setResources] = useState<Resource[]>([])
Expand Down
6 changes: 3 additions & 3 deletions src/components/searcher/Searcher.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from "preact/hooks"
import type { Resource } from "../../interfaces/resource.interface"
import { fetchResources, levenshteinDistance } from "../../utils"
import { searchResults } from "../../store.ts"
import type { Resource } from "@interfaces/resource.interface"
import { fetchResources, levenshteinDistance } from "@utils/utils.ts"
import { searchResults } from "@src/store.ts"

interface Props {
action?: () => void
Expand Down
Empty file added src/content/config.ts
Empty file.
Empty file.
Empty file.
4 changes: 2 additions & 2 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import { ViewTransitions } from "astro:transitions"
import Navbar from "../components/Navbar.astro"
import Footer from "../components/Footer.astro"
import Navbar from "@components/Navbar.astro"
import Footer from "@components/Footer.astro"
interface Props {
title: string
Expand Down
4 changes: 2 additions & 2 deletions src/pages/all.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Layout from "../layouts/Layout.astro"
import { ResourcesContainer } from "../components/ResourcesContainer"
import Layout from "@layouts/Layout.astro"
import { ResourcesContainer } from "@components/ResourcesContainer"
---

<Layout title="LinkHub">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/resources.json.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { APIRoute } from "astro"
import cheerio from "cheerio"
import { getResources } from "../../utils"
import { getResources } from "@utils/utils"

export const GET: APIRoute = async () => {
// get resources
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { SearcherQuery } from "../components/searcher/SearcherQuery"
import Layout from "../layouts/Layout.astro"
import { SearcherQuery } from "@components/searcher/SearcherQuery"
import Layout from "@layouts/Layout.astro"
---

<Layout title="LinkHub">
Expand Down
6 changes: 3 additions & 3 deletions src/pages/search.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Layout from "../layouts/Layout.astro"
import { Searcher } from "../components/searcher/Searcher.tsx"
import { SearchResults } from "../components/searcher/SearchResults.tsx"
import Layout from "@layouts/Layout.astro"
import { Searcher } from "@components/searcher/Searcher.tsx"
import { SearchResults } from "@components/searcher/SearchResults.tsx"
---

<Layout title="Buscador - LinkHub">
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts → src/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Resource } from "./interfaces/resource.interface"
import type { Resource } from "@interfaces/resource.interface"

export function levenshteinDistance(a: string, b: string) {
const matriz = []
Expand Down
20 changes: 19 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
"jsxImportSource": "preact",
"baseUrl": ".",
"paths": {
"@src/*": [
"src/*"
],
"@components/*": [
"src/components/*"
],
"@layouts/*": [
"src/layouts/*"
],
"@interfaces/*": [
"src/interfaces/*"
],
"@utils/*": [
"src/utils/*"
],
}
}
}

0 comments on commit 641d588

Please sign in to comment.