Skip to content

Commit

Permalink
added publicity api beta
Browse files Browse the repository at this point in the history
  • Loading branch information
antongiacomo committed Jun 24, 2024
1 parent b06abb0 commit da4923c
Show file tree
Hide file tree
Showing 8 changed files with 3,733 additions and 1,481 deletions.
1 change: 1 addition & 0 deletions components/ArticleCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ defineProps<{
<div class="flex gap-2 text-lg text-gray-500 font-medium">
<div>{{ article.people.map((person) => person.name).join(", ") }}</div>
</div>

<div class="flex my-4 gap-6 uppercase s">
<div class="flex items-center gap-1 font-medium">
<CalendarIcon class="h-6 w-6 stroke-2" />
Expand Down
10 changes: 8 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,11 @@ export default defineNuxtConfig({
},
},

modules: ["@nuxtjs/tailwindcss", "@nuxt/content", "nuxt-lodash", "@vueuse/nuxt"],
});
modules: [
"@nuxtjs/tailwindcss",
"@nuxt/content",
"nuxt-lodash",
"@vueuse/nuxt",
"@nuxt/image"
],
});
5,142 changes: 3,665 additions & 1,477 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "nuxt-app",
"devDependencies": {
"@nuxt/devtools": "latest",
"@nuxtjs/tailwindcss": "latest",
"@nuxt/image": "^1.7.0",
"@nuxtjs/tailwindcss": "^6.12.0",
"@tailwindcss/typography": "^0.5.10",
"@vueuse/core": "^10.7.0",
"@vueuse/nuxt": "^10.7.0",
Expand Down
38 changes: 38 additions & 0 deletions server/api/seminars/[slug].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { serverQueryContent } from '#content/server'

export default defineEventHandler(async (event) => {

const path = "/seminars/" + getRouterParam(event, 'slug')
console.log('path', path)
const doc = await serverQueryContent(event).where({ _path: path }).findOne();
console.log('doc', doc)
const feedString = ''
event.res.setHeader('content-type', 'text/plain')

const response = `
The CINI National Lab on Data Science is pleased to announce the second seminar in the series Tales on Data Science and Big Data.
*******************************************
Date: ${convertDate(doc.date)}
Time: ${doc.time} CET
Website: https://seminars.sesar.di.unimi.it/
Title: ${convertAscii(doc.title)}
Speakers: ${convertAscii(doc.people[0].name)} (${convertAscii(doc.people[0].affiliation)})
Abstract: ${doc.body.children[1].children[0].value ?? ''}
Track: Academic
Link: ${doc.location}
*******************************************
The seminars Tales on Data Science and Big Data present and discuss the most recent challenges, emerging trends, and theoretical and practical research and development in the field of Data Science and Big Data. Seminars will cover basic and applied research, as well as industrial activities, pertaining to data, from data governance to data processing and analysis. Seminars will also cover research and development in related domains where data and data science technologies are key, such as distributed systems and architectures, cloud-edge continuum, high-performance computing, blockchain, statistics, security and privacy, assurance and certification.
The seminars are structured in three main tracks: academic, featuring renowned Italian and international scientists; industry, featuring speakers from industrial domains; and young, featuring researchers in early-stage careers.
The research seminars target the Italian and international research community at all levels, from PhD students to professors and researchers in both academia, industry, and public administration. Seminars are held in English, virtually, tentatively on a two-month basis.
`
event.res.end(response.trim())
})
13 changes: 13 additions & 0 deletions server/utils/convertAscii.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default function (str) {
// Replace non-ASCII characters with their closest ASCII equivalents or remove them
return str.replace(/[^\x00-\x7F]/g, function (char) {
const asciiMap = {
'á': 'a\'', 'é': 'e\'', 'í': 'i\'', 'ó': 'o\'', 'ú': 'u\'', 'ñ': 'n',
'Á': 'A\'', 'É': 'E\'', 'Í': 'I\'', 'Ó': 'O\'', 'Ú': 'U\'', 'Ñ': 'N',
'à': 'a\'', 'è': 'e\'', 'ì': 'i\'', 'ò': 'o\'', 'ù': 'u\'',
'À': 'A\'', 'È': 'E\'', 'Ì': 'I\'', 'Ò': 'O\'', 'Ù': 'U\''
// Add more mappings as needed
};
return asciiMap[char] || '';
});
}
5 changes: 5 additions & 0 deletions server/utils/convertDate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import moment from "moment";
export default function (date) {
return moment(date, "DD-MM-YYYY").format("DD MMMM YYYY");
}

2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['pages/**/*.{js,jsx,ts,tsx}', 'components/**/*.{js,jsx,ts,tsx}'],
content: ['pages/**/*.{js,jsx,ts,tsx,vue}', 'components/**/*.{js,jsx,ts,tsx,vue}'],
theme: {
extend: {},
},
Expand Down

0 comments on commit da4923c

Please sign in to comment.