Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielaReyna committed Dec 17, 2024
1 parent c1760e3 commit d8a9003
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Labs

Labs is the monorepo codebase for Leaning Technologies developer sites. It contains technical writing (documentation and blog posts) for Cheerp, CheerpJ, CheerpX and other projects.

Visit our sites:

- [Labs](https://labs.leaningtech.com/)
- [Cheerp.io](https://cheerp.io/)
- [CheerpX.io](https://cheerpx.io/)
Expand All @@ -10,25 +12,31 @@ Visit our sites:
# Running locally

## Setup

Make sure you have [Node.js](https://nodejs.org/en/download/package-manager) and [pnpm](https://pnpm.io/installation) installed.

## Clone this repository

```shell
git clone https://github.com/leaningtech/labs.git
```

## Install dependencies

```shell
cd labs
pnpm install
```

## Run a site

The sites under this repository must be run individually. Pick a site you want to run, for example [Cheerp.io](Cheerp.io):

```shell
cd /sites/cheerp
pnpm start
```

# Contributing
For more information about contributing, please [visit this page](https://labs.leaningtech.com/docs/contributing)

For more information about contributing, please [visit this page](https://labs.leaningtech.com/docs/contributing)
3 changes: 1 addition & 2 deletions packages/astro-theme/components/BlogPostCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ const post =
const authors = await resolveAuthors(post.data.authors);
//choose hover link color based on product
const productName = typeof product === "undefined"? "Labs": product.name;
const productName = typeof product === "undefined" ? "Labs" : product.name;
---

<a
Expand Down
13 changes: 6 additions & 7 deletions packages/astro-theme/components/BlogPostCardSet.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { getCollection, type CollectionEntry } from "astro:content";
import BlogPostCard from "./BlogPostCard.astro";
import { productFromUrl } from "../lib/products";
interface Props {
// Only show posts if they have at least one of these tags
tags?: string[] | undefined;
Expand All @@ -15,8 +13,7 @@ interface Props {
const { tags, exclude } = Astro.props;
const product = productFromUrl(Astro.url);
const productName = typeof product === "undefined"? "Labs": product.name;
const productName = typeof product === "undefined" ? "Labs" : product.name;
function sortCalc(post: CollectionEntry<"blog">): number {
let relevancy =
Expand All @@ -31,13 +28,15 @@ function sortCalc(post: CollectionEntry<"blog">): number {
const posts = (
await getCollection("blog", (post) => {
if (post.data.draft || exclude?.includes(post.id) || !(post.data?.tags?.includes(productName) || productName === "Labs")) {
if (
post.data.draft ||
exclude?.includes(post.id) ||
!(post.data?.tags?.includes(productName) || productName === "Labs")
) {
return false;
} else {
return true;
}
})
)
.sort((a, b) => sortCalc(b) - sortCalc(a))
Expand Down
3 changes: 1 addition & 2 deletions sites/cheerp/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ import BlogPostCardSet from "@leaningtech/astro-theme/components/BlogPostCardSet
<p class="text-lg text-stone-400">Cheerp blog</p>
<h2 class="text-4xl font-bold text-white">Latest news</h2>
</div>
<BlogPostCardSet/>
<BlogPostCardSet />
<div class="mt-8">
<LinkButton
type="secondary-cheerp"
Expand All @@ -198,7 +198,6 @@ import BlogPostCardSet from "@leaningtech/astro-theme/components/BlogPostCardSet
/>
</div>
</div>

</section>
<section
class="bg-gradient-to-b from-stone-900 to-[#474484] pb-48 text-center pb-28 md:px-8 md:pt-16 lg:px-32 lg:pt-32 xl:pt-42 xl:px-28 2xl:px-60 2xl:pt-60"
Expand Down
4 changes: 1 addition & 3 deletions sites/cheerpx/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ import BlogPostCardSet from "@leaningtech/astro-theme/components/BlogPostCardSet
<p class="text-lg text-stone-400">CheerpX blog</p>
<h2 class="text-4xl font-bold text-white">Latest news</h2>
</div>
<BlogPostCardSet/>
<BlogPostCardSet />
<div class="mt-8">
<LinkButton
type="secondary-cheerpx"
Expand All @@ -230,7 +230,6 @@ import BlogPostCardSet from "@leaningtech/astro-theme/components/BlogPostCardSet
/>
</div>
</div>

</section>
<section
class="bg-gradient-to-b from-black to-[#00254d] pb-48 text-center pb-28 md:px-8 md:pt-16 lg:px-32 pt-12 lg:pt-32 xl:pt-42 xl:px-28 2xl:px-60 2xl:pt-60"
Expand Down Expand Up @@ -303,5 +302,4 @@ import BlogPostCardSet from "@leaningtech/astro-theme/components/BlogPostCardSet
</div>
</div>
</section>

</ProductHome>

0 comments on commit d8a9003

Please sign in to comment.