Skip to content

Commit

Permalink
Latest fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
srosset81 committed May 30, 2024
1 parent e5182b1 commit b2e3d82
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 44 deletions.
4 changes: 3 additions & 1 deletion src/components/blog/GridItem.astro
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ const { post } = Astro.props;
{post['pair:label']}
</a>
</h3>
<p class="text-muted dark:text-slate-400 text-lg line-clamp-4">{post['pair:comment']}</p>
<p class="text-muted dark:text-slate-400 text-lg line-clamp-4">
{post['pair:comment'] || post['pair:description'].substring(0, 180)}
</p>
</article>
2 changes: 1 addition & 1 deletion src/components/blog/Pagination.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface Props {
nextText?: string;
}
const { prevUrl, nextUrl, prevText = 'Newer posts', nextText = 'Older posts' } = Astro.props;
const { prevUrl, nextUrl, prevText = 'Posts plus récents', nextText = 'Posts plus anciens' } = Astro.props;
---

{
Expand Down
24 changes: 15 additions & 9 deletions src/components/blog/SinglePost.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import { Icon } from 'astro-icon/components';
import getReadingTime from 'reading-time';
import Button from '../ui/Button.astro';
import { marked } from 'marked';
import Author from '~/components/blog/Author.astro';
Expand All @@ -22,8 +23,17 @@ const { post } = Astro.props;

<section class="py-8 sm:py-16 lg:py-20 mx-auto">
<article>
<header class={post.image ? '' : ''}>
<div class="flex justify-between flex-col sm:flex-row max-w-4xl mx-auto mt-0 mb-2 px-4 sm:px-6 sm:items-center">
<header class="relative max-w-4xl mx-auto">
<Button
variant="primary"
class="absolute right-0 top-0 px-6 py-2"
target="_blank"
icon="tabler:edit"
href={`https://archipel.assemblee-virtuelle.org/Document/${encodeURIComponent(post.id)}`}
>
Editer
</Button>
<div class="flex justify-between flex-col sm:flex-row mt-0 mb-2 px-4 sm:px-6 sm:items-center">
<p>
<Icon name="tabler:clock" class="w-4 h-4 inline-block -mt-0.5 dark:text-gray-400" />
<!-- <time datetime={String(post['dc:created'])} class="inline-block"
Expand All @@ -43,14 +53,10 @@ const { post } = Astro.props;
<>· {Math.ceil(getReadingTime(post['pair:description']).minutes)} min read</>
</p>
</div>
<h1
class="px-4 sm:px-6 max-w-4xl mx-auto text-4xl md:text-5xl font-bold leading-tighter tracking-tighter font-heading"
>
<h1 class="px-4 sm:px-6 mr-24 text-4xl md:text-5xl font-bold leading-tighter tracking-tighter font-heading">
{post['pair:label']}
</h1>
<p
class="max-w-4xl mx-auto mt-4 mb-8 px-4 sm:px-6 text-xl md:text-2xl text-muted dark:text-slate-400 text-justify"
>
<p class="mt-4 mb-8 px-4 sm:px-6 text-xl md:text-2xl text-muted dark:text-slate-400 text-justify">
{post['pair:comment'] || post['pair:description'].substring(0, 200)}
</p>

Expand Down Expand Up @@ -80,7 +86,7 @@ const { post } = Astro.props;
<Fragment set:html={marked.parse(post['pair:description'] || '')} />
</div>
<div class="mx-auto px-6 sm:px-6 max-w-4xl mt-8 flex justify-between flex-col sm:flex-row">
<Author actorUri={post['dc:creator']} />
{post['dc:creator'] && <Author actorUri={post['dc:creator']} />}
<!-- <Projects title="Projets liés" projectsUris={post['pair:documents']} /> -->
<!-- <SocialShare url={url} text={post.title} class="mt-5 sm:mt-1 align-middle text-gray-500 dark:text-slate-600" /> -->
</div>
Expand Down
22 changes: 16 additions & 6 deletions src/components/documents/Document.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import { marked } from 'marked';
import Button from '../ui/Button.astro';
import type { Document } from '~/types';
Expand All @@ -10,13 +11,22 @@ export interface Props {
const { record } = Astro.props;
---

<section class="py-8 sm:py-16 lg:py-20 mx-auto">
<section class="py-8 sm:py-16 lg:py-20">
<article>
<h1
class="px-4 sm:px-6 max-w-4xl mx-auto text-4xl md:text-5xl font-bold leading-tighter tracking-tighter font-heading"
>
{record['pair:label']}
</h1>
<header class="relative mx-auto max-w-4xl">
<Button
variant="primary"
class="absolute right-0 top-0 px-6 py-2"
target="_blank"
icon="tabler:edit"
href={`https://archipel.assemblee-virtuelle.org/Document/${encodeURIComponent(record.id)}`}
>
Editer
</Button>
<h1 class="px-4 sm:px-6 text-4xl md:text-5xl font-bold leading-tighter tracking-tighter font-heading">
{record['pair:label']}
</h1>
</header>
<div
class="mx-auto px-6 sm:px-6 max-w-4xl prose prose-md prose-headings:font-heading prose-headings:leading-tighter prose-headings:tracking-tighter prose-headings:font-bold prose-a:text-primary prose-img:rounded-md prose-img:shadow-lg mt-8 prose-headings:scroll-mt-[80px]"
>
Expand Down
2 changes: 1 addition & 1 deletion src/config/typesMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const projectTypes = {
methodologies: {
uri: 'https://data.virtual-assembly.org/types/methodologie',
name: 'Méthodologies',
description: "our permettre l'interopérabilité des systèmes d'information",
description: "Reposant sur les principes de l'open-source et du pair-à-pair",
},
'innovations-sociales': {
uri: 'https://data.virtual-assembly.org/types/innovation-sociale',
Expand Down
20 changes: 6 additions & 14 deletions src/navigation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getPermalink, getAsset } from './utils/permalinks';
import { getAsset } from './utils/permalinks';

export const headerData = {
links: [
Expand All @@ -7,23 +7,15 @@ export const headerData = {
links: [
{
text: "Raison d'être et code social",
href: getPermalink(
'/documents/https%3A%2F%2Fdata.virtual-assembly.org%2Fdocuments%2F7bc5eb12-3772-4cad-b14f-ca90966e4810'
),
href: '/documents/https%3A%2F%2Fdata.virtual-assembly.org%2Fdocuments%2F7bc5eb12-3772-4cad-b14f-ca90966e4810',
},
{
text: 'Organisations membres',
href: getPermalink('/organisations'),
},
{
text: "L'équipe",
href: getPermalink('/equipe'),
href: '/organisations',
},
{
text: 'Histoire',
href: getPermalink(
'/documents/https%3A%2F%2Fdata.virtual-assembly.org%2Fdocuments%2F6d255935-1515-495a-95c1-d458d6aaee22'
),
href: '/documents/https%3A%2F%2Fdata.virtual-assembly.org%2Fdocuments%2F6d255935-1515-495a-95c1-d458d6aaee22',
},
],
},
Expand Down Expand Up @@ -120,8 +112,8 @@ export const footerData = {
// { text: 'Privacy Policy', href: getPermalink('/privacy') },
],
socialLinks: [
{ ariaLabel: 'Mastodon', icon: 'tabler:brand-mastodon', href: '#' },
{ ariaLabel: 'X', icon: 'tabler:brand-x', href: '#' },
// { ariaLabel: 'Mastodon', icon: 'tabler:brand-mastodon', href: '#' },
// { ariaLabel: 'X', icon: 'tabler:brand-x', href: '#' },
{ ariaLabel: 'RSS', icon: 'tabler:rss', href: getAsset('/rss.xml') },
{ ariaLabel: 'Github', icon: 'tabler:brand-github', href: 'https://github.com/assemblee-virtuelle' },
],
Expand Down
12 changes: 11 additions & 1 deletion src/pages/organisations/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Image from '~/components/common/Image.astro';
import Members from '~/components/organizations/Members.astro';
import Projects from '~/components/projects/Projects.astro';
import Websites from '~/components/organizations/Websites.astro';
import Button from '~/components/ui/Button.astro';
import type { Organization } from '~/types';
export const prerender = true;
Expand All @@ -30,7 +31,16 @@ const metadata = {
<Layout metadata={metadata}>
<section class="px-6 py-12 sm:py-16 lg:py-20 mx-auto max-w-4xl">
<article>
<header class="flex mb-4">
<header class="flex mb-4 relative">
<Button
variant="primary"
class="absolute right-0 top-0 px-6 py-2"
target="_blank"
icon="tabler:edit"
href={`https://archipel.assemblee-virtuelle.org/Organization/${encodeURIComponent(organization.id)}`}
>
Editer
</Button>
<div class="flex-none w-36">
{
organization.image && (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projets/[type]/[...page].astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const getStaticPaths = (async ({ paginate }) => {
const filteredData = data.filter((resource) => resource['pair:hasType'] === projectTypes[type].uri);
return paginate(filteredData, {
params: { type },
pageSize: 8,
pageSize: 40,
});
});
}) satisfies GetStaticPaths;
Expand Down
18 changes: 12 additions & 6 deletions src/pages/projets/[type]/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Layout from '~/layouts/PageLayout.astro';
import dataProvider from '~/config/dataProvider';
import { projectTypes } from '~/config/typesMapping';
import Actors from '~/components/actors/Actors.astro';
import Button from '~/components/ui/Button.astro';
import type { Project } from '~/types';
export const prerender = true;
Expand Down Expand Up @@ -33,15 +34,20 @@ const metadata = {
<Layout metadata={metadata}>
<section class="py-8 sm:py-16 lg:py-20 mx-auto">
<article>
<header class={project.image ? '' : ''}>
<h1
class="px-4 sm:px-6 max-w-4xl mx-auto text-4xl md:text-5xl font-bold leading-tighter tracking-tighter font-heading"
<header class="relative mx-auto max-w-4xl">
<Button
variant="primary"
class="absolute right-0 top-0 px-6 py-2"
target="_blank"
icon="tabler:edit"
href={`https://archipel.assemblee-virtuelle.org/Project/${encodeURIComponent(project.id)}`}
>
Editer
</Button>
<h1 class="px-4 sm:px-6 text-4xl md:text-5xl font-bold leading-tighter tracking-tighter font-heading">
{project['pair:label']}
</h1>
<p
class="max-w-4xl mx-auto mt-4 mb-8 px-4 sm:px-6 text-xl md:text-2xl text-muted dark:text-slate-400 text-justify"
>
<p class="mt-4 mb-8 px-4 sm:px-6 text-xl md:text-2xl text-muted dark:text-slate-400 text-justify">
{project['pair:comment'] || project['pair:description'].substring(0, 200)}
</p>

Expand Down
27 changes: 23 additions & 4 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,24 @@
{
"type": "header",
"key": "accept",
"value": "application/ld+json"
"value": "application/ld\\+json"
}
],
"destination": "/ontologies/pair-2021-summer/ontology.json",
"statusCode": 303
},
{
"source": "/ontologies/pair",
"has": [
{
"type": "header",
"key": "accept",
"value": "application/rdf\\+xml"
}
],
"destination": "/ontologies/pair-2021-summer/ontology.xml",
"statusCode": 303
},
{
"source": "/ontologies/pair",
"has": [
Expand All @@ -26,12 +38,19 @@
},
{
"source": "/ontologies/pair",
"destination": "/ontologies/pair-2021-summer",
"has": [
{
"type": "header",
"key": "accept",
"value": "application/n-triples"
}
],
"destination": "/ontologies/pair-2021-summer/ontology.nt",
"statusCode": 303
},
{
"source": "/ontologies/pair/:path*",
"destination": "/ontologies/pair-2021-summer/:path*",
"source": "/ontologies/pair",
"destination": "/ontologies/pair-2021-summer",
"statusCode": 303
},
{
Expand Down

0 comments on commit b2e3d82

Please sign in to comment.