diff --git a/projects/frontend/src/components/web-components/index.ts b/projects/frontend/src/components/web-components/index.ts new file mode 100644 index 0000000..40fb2f3 --- /dev/null +++ b/projects/frontend/src/components/web-components/index.ts @@ -0,0 +1,5 @@ +import { registerProjectTile } from './project-tile' + +export const register = () => { + registerProjectTile() +} diff --git a/projects/frontend/src/components/web-components/project-tile.ts b/projects/frontend/src/components/web-components/project-tile.ts new file mode 100644 index 0000000..a43b957 --- /dev/null +++ b/projects/frontend/src/components/web-components/project-tile.ts @@ -0,0 +1,9 @@ +import { defineCustomElement } from 'vue' + +import ProjectTileSFC from 'src/views/project/project-tile.vue' + +export const ProjectTile = defineCustomElement(ProjectTileSFC) + +export const registerProjectTile = () => { + customElements.define('project-tile', ProjectTile) +} diff --git a/projects/frontend/src/main.ts b/projects/frontend/src/main.ts index 2a63009..9512a28 100644 --- a/projects/frontend/src/main.ts +++ b/projects/frontend/src/main.ts @@ -9,6 +9,7 @@ import './main.sass' import { createRoutes, initializeRouteStore } from './routes' import { headingSectionsExtension } from './utilities/marked' +import { register } from './components/web-components' marked .use(headingSectionsExtension() as any) @@ -27,6 +28,7 @@ export const createApp = ViteSSG( { routes: createRoutes() }, // function to have custom setups ({ app, router, routes, isClient, initialState }) => { + register() app.use(createPinia()) initializeRouteStore(routes) }, diff --git a/projects/frontend/src/utilities/fetch.ts b/projects/frontend/src/utilities/fetch.ts index 490e0bd..c9cb4b5 100644 --- a/projects/frontend/src/utilities/fetch.ts +++ b/projects/frontend/src/utilities/fetch.ts @@ -19,6 +19,15 @@ const domPurifyConfig = { 'src', 'style', 'title', + + // project-tile + 'info', + 'view-path', + 'thumbnail-background', + 'thumbnail-position', + 'caption', + 'subtitle', + 'summary', ], ALLOWED_TAGS: [ 'a', @@ -70,6 +79,8 @@ const domPurifyConfig = { 'dd', 'dl', 'dt', + + 'project-tile', ], } diff --git a/projects/frontend/src/views/project/project-list.vue b/projects/frontend/src/views/project/project-list.vue index 448f3b7..4df80ab 100644 --- a/projects/frontend/src/views/project/project-list.vue +++ b/projects/frontend/src/views/project/project-list.vue @@ -1,5 +1,5 @@