Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/showcase_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Sync community projects to Discord showcase

on:
workflow_dispatch:
repository_dispatch:
types: [community_projects_changed]

jobs:
sync-showcase:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Update projects submodule
run: git submodule update --remote extras

- name: Build showcase sync payload
run: |
python3 <<'PY'
import json
import tomllib
from pathlib import Path

projects_root = Path("extras/proyectos")
projects = []

for path in sorted(projects_root.rglob("*.toml")):
with path.open("rb") as file:
project = tomllib.load(file)

name = " ".join(part.strip() for part in project["name"] if part.strip())
key = str(path.relative_to("extras"))

projects.append(
{
"key": key,
"name": name,
"desc": project["description"],
"url": project["link"],
"tags": [],
}
)

payload = {"projects": projects}

with Path("showcase_payload.json").open("w", encoding="utf-8") as file:
json.dump(payload, file, ensure_ascii=False)

print(f"Prepared {len(projects)} projects")
PY

- name: Call Cangrebot showcase sync
run: |
curl --fail-with-body -X POST "${CANGREBOT_URL%/}/showcase/sync" \
-H "Content-Type: application/json" \
-H "Authorization: $CANGREBOT_API_KEY" \
--data @showcase_payload.json
env:
CANGREBOT_URL: ${{ secrets.CANGREBOT_URL }}
CANGREBOT_API_KEY: ${{ secrets.CANGREBOT_API_KEY }}
8 changes: 5 additions & 3 deletions src/components/cards/contributor_card.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::components::icons::{GithubIcon, LocationIcon, TwitterIcon};
use leptos::{component, leptos_dom::helpers::location as location_dom, prelude::*, view, IntoView};
use leptos::{
component, leptos_dom::helpers::location as location_dom, prelude::*, view, IntoView,
};

#[component]
pub fn ContributorCard(
Expand Down Expand Up @@ -33,10 +35,10 @@ pub fn ContributorCard(
}
});
view! {
<article
<article
class="hover:z-10 flex flex-col h-full gap-y-6 border border-black p-4 hover:bg-orange-500 bg-orange-100 dark:hover:bg-zinc-900/40 dark:bg-black/40 drop-shadow-[0_0_0_rgba(0,0,0)] hover:drop-shadow-[-4px_-4px_0_rgba(0,0,0)] transition justify-between"
class=("bg-chiwa", move || name_for_class == "gg0074x" && easter_egg.get())
>
>
<a href=link.clone() target="_blank" class="group flex flex-col justify-between">
<span class="absolute top-0 end-0 inline-flex items-center size-3.5 group-hover:min-w-16 rounded-full border-2 border-white text-xs font-medium transition-all transform -translate-y-1/2 translate-x-1/2 bg-teal-500 dark:border-slate-900 badge-container">
<span class="sr-only text-black badge-content transition-all transform">
Expand Down
13 changes: 7 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
#[cfg(feature = "ssr")]
#[tokio::main]
async fn main() {
use axum::Router;
use leptos::{config::get_configuration, logging::log};
use leptos_axum::{generate_route_list_with_ssg, LeptosRoutes};
use leptos_axum::generate_route_list_with_ssg;
use rust_lang_es::app::*;
use tower_http::services::ServeDir;

let conf = get_configuration(None).unwrap();
let leptos_options = conf.leptos_options;
let addr = leptos_options.site_addr;

let (routes, static_routes) = generate_route_list_with_ssg({
let leptos_options = leptos_options.clone();
Expand All @@ -30,9 +27,13 @@ async fn main() {

#[cfg(feature = "development")]
{
println!("listening on http://{}", addr);
use axum::{routing::get, Router};
use leptos_axum::LeptosRoutes;
use tower_http::services::ServeDir;

let addr = leptos_options.site_addr;

use axum::routing::get;
println!("listening on http://{}", addr);

let site_root = leptos_options.site_root.as_ref();
let pkg_dir = format!("{}/pkg", site_root);
Expand Down
Loading
Loading