Skip to content

Commit

Permalink
fix: build (previous it was working in dev mode)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackheaven committed Aug 26, 2024
1 parent 21f2b45 commit 74f3cfa
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 227 deletions.
6 changes: 0 additions & 6 deletions __dirname.ts

This file was deleted.

151 changes: 0 additions & 151 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function dynamicFilter(inputId) {
items = document.getElementsByClassName('filterable');

for (i = 0; i < items.length; i++) {
txtValue = items[i].getAttribute('key');
txtValue = items[i].getAttribute('data-key');
if (txtValue.toUpperCase().indexOf(filter) > -1) {
items[i].style.display = '';
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ interface Props {
<link rel="icon" type="image/png" href="/imgs/logo/LyonTechHub-32-red.png" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link href="/css/main.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.8/handlebars.min.js" integrity="sha512-E1dSFxg+wsfJ4HKjutk/WaCzK7S2wv1POn1RRPGh8ZK+ag9l244Vqxji3r6wgz9YBf6+vhQEYJZpSjqWFPg9gg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js" integrity="sha512-3gJwYpMe3QewGELv8k/BX9vcqhryRdzRMxVfq6ngyWXwo03GFEzjsUm8Q7RZcHPHksttq7/GFoxjCVUjkjvPdw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha512-oBTprMeNEKCnqfuqKd6sbvFzmFQtlXS3e0C/RGFV0hD6QzhHV+ODfaQbAlmY6/q0ubbwlAM/nCJjkrgA3waLzg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.8/handlebars.min.js" integrity="sha512-E1dSFxg+wsfJ4HKjutk/WaCzK7S2wv1POn1RRPGh8ZK+ag9l244Vqxji3r6wgz9YBf6+vhQEYJZpSjqWFPg9gg==" crossorigin="anonymous" referrerpolicy="no-referrer" is:inline></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js" integrity="sha512-3gJwYpMe3QewGELv8k/BX9vcqhryRdzRMxVfq6ngyWXwo03GFEzjsUm8Q7RZcHPHksttq7/GFoxjCVUjkjvPdw==" crossorigin="anonymous" referrerpolicy="no-referrer" is:inline></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha512-oBTprMeNEKCnqfuqKd6sbvFzmFQtlXS3e0C/RGFV0hD6QzhHV+ODfaQbAlmY6/q0ubbwlAM/nCJjkrgA3waLzg==" crossorigin="anonymous" referrerpolicy="no-referrer" is:inline></script>
<script src="/js/main.js" is:inline></script>
</head>
<body>
Expand All @@ -37,7 +37,7 @@ interface Props {
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 761.81103 761.81102" class="LTHlogo" role="img" aria-label="Lyon tech hub logo">
<g fill="#eb0f0f">
<path d="M228.292 296.06L91.76 305.873v-19.627zm253.113 154.467l59.414 80.39 59.41 80.39-14.06 7.53-14.06 7.53-45.36-87.92zm-6.117 24.773l48.72 80.1 48.723 80.098-13.88 6.006-13.882 6.005-34.835-86.11zm-11.073 22.367l39.147 79.93 39.147 79.93-13.75 4.638-13.747 4.64-25.403-84.57zm-16.665 14.8l32.874 86.435 32.874 86.435-14.75 3.665-14.748 3.666-18.125-90.1zm-19.61 9.64l25.227 90.926 25.228 90.927-15.404 2.52-15.4 2.52-9.82-93.448zm-20.562 12.213l17.28 96.495 17.282 96.494-16.234 1.31-16.234 1.315-1.047-97.81zm-22.536-.962l9.983 97.458 9.984 97.458h-39.94l9.98-97.458zm-22.537.962l-1.047 97.812-1.047 97.812-16.23-1.317-16.23-1.318 17.28-96.5zm-20.562-12.214l-10.168 96.726-10.168 96.725-15.944-2.608-15.945-2.61 26.113-94.12zm-19.61-9.638l-18.125 90.1-18.125 90.1-14.75-3.666-14.747-3.665 32.873-86.435zm-16.663-14.8l-26.672 88.784-26.67 88.785-14.428-4.87-14.43-4.87 41.1-83.916zM294.396 475.3l-35.76 88.387-35.758 88.385-14.254-6.165-14.253-6.164 50.02-82.22zm-6.116-24.773l-45.274 87.766-45.273 87.765-14.037-7.517-14.037-7.51 59.31-80.25z"/>
<path fillRule="evenodd" d="M261.098 255.827c15.152-10.306 65.572-31.565 66.67 11.244-28.284 4.69-66.67-11.24-66.67-11.24zm247.487 0c-15.152-10.306-65.57-31.565-66.67 11.244 28.285 4.69 66.67-11.24 66.67-11.24zm-186.372 92.758s57.074 45.44 57.074 59.494c0 7.02 1.224 8.05.504 16.04-.22 2.54-47.62 20.512-63.3 30.652-8.92 5.767-4.37 8.58-4.37 8.58s49.498-27.17 72.73-27.17c23.234 0 72.73 27.17 72.73 27.17s4.548-2.813-4.372-8.58c-15.683-10.14-63.08-28.118-63.307-30.657-.72-7.988.505-9.018.505-16.045 0-14.055 57.07-59.495 57.07-59.495s-26.26 8.43-62.626 8.43-62.63-8.43-62.63-8.43z"/>
<path fill-rule="evenodd" d="M261.098 255.827c15.152-10.306 65.572-31.565 66.67 11.244-28.284 4.69-66.67-11.24-66.67-11.24zm247.487 0c-15.152-10.306-65.57-31.565-66.67 11.244 28.285 4.69 66.67-11.24 66.67-11.24zm-186.372 92.758s57.074 45.44 57.074 59.494c0 7.02 1.224 8.05.504 16.04-.22 2.54-47.62 20.512-63.3 30.652-8.92 5.767-4.37 8.58-4.37 8.58s49.498-27.17 72.73-27.17c23.234 0 72.73 27.17 72.73 27.17s4.548-2.813-4.372-8.58c-15.683-10.14-63.08-28.118-63.307-30.657-.72-7.988.505-9.018.505-16.045 0-14.055 57.07-59.495 57.07-59.495s-26.26 8.43-62.626 8.43-62.63-8.43-62.63-8.43z"/>
<path d="M228.888 282.742l-127.69-1.176 1.72-18.232zm1.782-12.56l-135.665-12.27 3.657-19.237zm2.956-12.366l-125.53-21.724 5.107-17.68zm4.107-12.08L107.58 212.1l7.14-18.197zm5.227-11.704L123.403 192.42l8.34-16.588zm6.306-11.236l-112.334-49.85 9.62-15.458zm7.338-10.684l-107.092-58.67 11.023-14.603zm8.314-10.05l-103.87-68.895 12.682-14.02zm9.226-9.34l-98.43-78.164 14.158-13.13zm10.07-8.557l-82.252-77.82L215.87 95.52zm10.836-7.71l-76.822-86.65 15.31-9.943zm11.517-6.807l-72.202-97.692 17.088-9.15zm12.113-5.85l-58.997-96.993 16.814-7.273zm12.62-4.848L276.03 46.106l19.403-6.55zm14.034.876l-43.492-116.38 19.06-4.737zm12.323 2.88L325.14 35.114l19.855-3.247zm13.54 14.744L350.274 33.905l19.657-1.595zm13.645 33.645L375.195 36.08h19.294zm12.634-31.945l2.278-146.84 19.657 1.596zm12.112-11.144l14.83-133.49 19.432 3.18zm13.246-7.71L448.782 38.71l19.06 4.736zm15.55-1.346l35.468-118.07 19.188 6.477zm12.618 4.848l48.08-118.84 19.166 8.288zm12.115 5.85l51.842-100.5 16.07 8.607zm11.518 6.806L542.11 70.498l16.793 10.907zm10.835 7.71l82.452-106.942 16.778 13.06zm10.07 8.56l80.602-87.32 13.542 12.56zm9.226 9.338l85.358-77.615 11.873 13.124zm8.314 10.05l108.884-83.048 12.494 16.55zm7.338 10.684l105.325-66.97 9.866 15.85zm6.306 11.236l105.9-55.418 7.942 15.794zm5.226 11.703l116.263-48.988 6.75 17.198zm4.107 12.08l120.424-39.402 5.11 17.68zm2.956 13.072l129.565-30.925 3.59 18.883zm1.783 11.855l125.97-19.408 1.72 18.232zm.594 13.308l136.408-9.804v19.61zm-.594 12.003l140.822 1.297-1.896 20.107zm-1.783 12.56l142.247 12.863-3.835 20.172zm-2.956 12.367l144.724 25.045-5.88 20.38zm-4.107 12.08l144.225 37.27-7.913 20.165zm-5.226 11.703l158.42 55.14-11.05 21.978zM520.418 368l147.516 65.463L655.3 453.76zm-7.338 10.682l148.335 81.267-15.27 20.22zm-8.314 10.05l150.338 99.716-18.358 20.292zm-9.226 9.34L643.047 515.21l-21.217 19.68zm-10.07 8.558l142.426 134.75-24.083 18.743z"/>
<path d="M474.635 414.34L613.12 570.543l-27.6 17.924zm-179.587 0l-119.79 188.11-29.814-19.363z"/>
<path d="M284.214 406.63L161.92 565.247l-24.886-19.368zm-10.07-8.56L151.956 530.445l-20.528-19.04zm-9.226-9.338L130.013 511.398l-18.763-20.74zm-8.314-10.05L121.49 481.736 105.986 461.2zM249.266 368l-134.5 85.518-12.6-20.24zm-6.306-11.237l-139.07 72.775-10.428-20.74zm-5.227-11.703L99.867 403.15l-8.002-20.394zm-4.107-12.08L83.053 382.245l-6.386-22.104zm-2.956-12.37L88.932 354.443l-3.927-20.657zm-1.782-12.558L90.233 329.415l-1.893-20.068z"/>
Expand Down
44 changes: 29 additions & 15 deletions src/lib/communities.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
import fs from 'node:fs/promises';
import __dirname from '../../__dirname';
import path from 'path';
export interface SocialLink {
icon: string;
url: string;
tooltip: string;
}

export interface FileCommunity {
name: string;
shortDescription: string;
image: string | null;
patternsGoogleCalendar: string[];
socialLinks: SocialLink[];
}

export interface Community extends FileCommunity {
key: string;
}

const keyPattern = /([^\/]+?)(\.[^.]*$|$)/;

export async function getList() {
const dataDir = path.join(__dirname, 'data');
const communityFiles = await fs.readdir(dataDir);
return await Promise.all(communityFiles
.filter(f => f.endsWith('.json') && f != 'conferences.json')
.map(async (f) => {
const content = await fs.readFile(path.join(dataDir, f));
const json = JSON.parse(content);
json.key = f.substring(0, f.length - '.json'.length);
return json;
})
);
export function getList(): Community[] {
const files: Record<string, FileCommunity> =
import.meta.glob(['../../data/*.json', '!**/conferences.json'], { eager: true });
return Object.keys(files)
.map((path: string) => {
return {
key: (path.match(keyPattern) ?? [path, path])[1],
...files[path]
};
});
}
2 changes: 1 addition & 1 deletion src/pages/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Layout from '../layouts/Layout.astro';

<Layout>
<main>
<div className="container text-justify">
<div class="container text-justify">
<h2>Qui sommes-nous ?</h2>

<p>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/calendar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import Layout from '../layouts/Layout.astro';

<Layout>
<main>
<div className="container-fluid">
<div className="container">
<div class="container-fluid">
<div class="container">
<h1>
Le calendrier partagé par toutes les communautés lyonnaises<br />
<small>Venez rencontrer toutes ces communautés et leurs participants !</small>
</h1>
<p><span className="fa fa-calendar fa-lg"></span>Ajouter le calendrier des nouveaux événements à vos calendriers (<a
<p><span class="fa fa-calendar fa-lg"></span>Ajouter le calendrier des nouveaux événements à vos calendriers (<a
href="https://www.lyontechhub.org/Lyon-Tech-Hub-Calendar/calendar.ics">au
format ical</a> ou sur Google via le bouton en bas à droite du calendrier)</p>
<p><span className="fa fa-flash fa-lg"></span>Ajouter une alerte Google Calendar pour ne plus en manquer un!</p>
<p><span class="fa fa-flash fa-lg"></span>Ajouter une alerte Google Calendar pour ne plus en manquer un!</p>
<iframe
src="https://calendar.google.com/calendar/embed?height=600&wkst=2&ctz=Europe%2FParis&bgcolor=%23ffffff&showTitle=0&hl=fr&src=Y2sycnVxNmNxZmNoM3Q0Z3NoYmQ2dmRuZDRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&src=N2EyNW9yNW8yMHA1aGJmMWZ0OHQ4ZGVwb2RwY2pqbHBAaW1wb3J0LmNhbGVuZGFyLmdvb2dsZS5jb20&color=%23AD1457&color=%23E67C73"
style="border: solid 1px #777;" width="800" height="600" frameborder="0" scrolling="no"></iframe>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/communities.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import Layout from '../layouts/Layout.astro';
import { getList } from '../lib/communities.ts';
const communities = await getList();
const communities = getList();
---

Expand All @@ -20,7 +20,7 @@ const communities = await getList();
{communities
.map(
(community) => (
<div class="col-sm-6 col-md-4 filterable" key={community.name}>
<div class="col-sm-6 col-md-4 filterable" data-key={community.name}>
<div class="thumbnail">
<a href={`/community/` + community.key}>
<img src={`/imgs/communities/` + community.image}
Expand Down
Loading

0 comments on commit 74f3cfa

Please sign in to comment.