Skip to content

Commit

Permalink
add columns
Browse files Browse the repository at this point in the history
  • Loading branch information
samipe committed Sep 22, 2024
1 parent 605fcc5 commit dbdeee9
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 43 deletions.
78 changes: 39 additions & 39 deletions docs/assets/index-uf88RFse.js → docs/assets/index-BVnGV-ih.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/assets/index-BW0xLFLI.css

This file was deleted.

1 change: 1 addition & 0 deletions docs/assets/index-CcbfNexT.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RoboCon - Robot Framework Conference</title>
<script type="module" crossorigin src="/assets/index-uf88RFse.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BW0xLFLI.css">
<script type="module" crossorigin src="/assets/index-BVnGV-ih.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CcbfNexT.css">
</head>
<body>
<div id="app"></div>
Expand Down
4 changes: 4 additions & 0 deletions src/assets/css/grid.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
position: sticky;
}

.gap-sm {
gap: var(--size-small);
}

.row {
box-sizing: border-box;
display: -webkit-box;
Expand Down
36 changes: 36 additions & 0 deletions src/components/SectionColumns.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<div class="columns-container row gap-sm mt-large">
<div class="col-sm-12 col-md-6">
<RichTextRenderer
:document="left"
:nodeRenderers="renderNodes()"
:markRenderers="renderMarks()" />
</div>
<div class="col-sm-12 col-md-6">
<RichTextRenderer
:document="right"
:nodeRenderers="renderNodes()"
:markRenderers="renderMarks()" />
</div>
</div>
</template>

<script setup lang="ts">
import type { PropType } from 'vue';
import type { Document } from "@contentful/rich-text-types";
import RichTextRenderer from 'contentful-rich-text-vue-renderer';
import { renderNodes, renderMarks } from 'Content/renderContent';
defineProps({
left: Object as PropType<Document>,
right: Object as PropType<Document>
})
</script>

<style scoped>
@media screen and (min-width: 768px) {
.columns-container {
flex-wrap: nowrap;
}
}
</style>
2 changes: 2 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Navbar from './Navbar.vue'
import NavMobile from './NavMobile.vue'
import PageSection from './PageSection.vue'
import SectionRow from './SectionRow.vue'
import SectionColumns from './SectionColumns.vue'
import TabBox from './TabBox.vue'
import Sponsors from './Sponsors.vue'
import TicketItem from './TicketItem.vue'
Expand Down Expand Up @@ -34,6 +35,7 @@ export {
NavMobile,
PageSection,
SectionRow,
SectionColumns,
TabBox,
Sponsors,
TicketItem,
Expand Down
8 changes: 7 additions & 1 deletion src/content/renderContent.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Node } from '@contentful/rich-text-types';
import { documentToHtmlString } from '@contentful/rich-text-html-renderer';
import { endOfDay, isWithinInterval, startOfDay } from 'date-fns'
import { PageSection, TicketItem, SponsorItem, SectionRow, Banner, CardItem } from 'Components'
import { PageSection, TicketItem, SponsorItem, SectionRow, Banner, CardItem, SectionColumns } from 'Components'
import { h } from 'vue'
import type { Entry } from 'contentful';

Expand All @@ -13,6 +13,12 @@ export const renderNodes = () => {
if (type === 'pageSection') {
return h(PageSection, { content: node.data.target })
}
if (type === 'columns') {
return h(SectionColumns, {
left: node.data.target.fields.left,
right: node.data.target.fields.right
})
}
if (type === 'row') {
return h(SectionRow, { content: node.data.target.fields.content, class: 'm-large pb-small' })
}
Expand Down

0 comments on commit dbdeee9

Please sign in to comment.