diff --git a/homepage/_footer/en/footer.json b/homepage/_footer/en/footer.json index e872d530..f9086dd7 100644 --- a/homepage/_footer/en/footer.json +++ b/homepage/_footer/en/footer.json @@ -13,6 +13,20 @@ "display_text": "Play Online!", "url": "/resource/#play-online" } + ], + "logos": [ + { + "alt_text": "open culture foundation", + "image_url": "/images/uploads/logo__ocf.svg", + "title": "Initiator", + "link_url": "https://ocf.tw/" + }, + { + "alt_text": "Friedrich Naumann Foundation for Freedom", + "image_url": "/images/uploads/logo__fnf.png", + "title": "Sponsor", + "link_url": "https://www.freiheit.org/" + } ] } -} \ No newline at end of file +} diff --git a/homepage/_footer/zh-tw/footer.json b/homepage/_footer/zh-tw/footer.json index a40390ac..1c9caf14 100644 --- a/homepage/_footer/zh-tw/footer.json +++ b/homepage/_footer/zh-tw/footer.json @@ -13,6 +13,20 @@ "display_text": "來玩線上桌遊!", "url": "/resource/#線上桌遊一起玩" } + ], + "logos": [ + { + "text": "open culture foundation", + "image_url": "/images/uploads/logo__ocf.svg", + "title": "Initiator", + "link_url": "https://ocf.tw/" + }, + { + "text": "Friedrich Naumann Foundation for Freedom", + "image_url": "/images/uploads/logo__fnf.png", + "title": "Sponsor", + "link_url": "https://www.freiheit.org/" + } ] } -} \ No newline at end of file +} diff --git a/homepage/public/css/style.css b/homepage/public/css/style.css index fd61cadf..91cc2dc5 100644 --- a/homepage/public/css/style.css +++ b/homepage/public/css/style.css @@ -916,7 +916,7 @@ code { margin-left: 1rem; } .logo-margin { - margin: 0 15px; + margin: 0 1rem; } .avatar { margin: 0.5rem auto; @@ -985,9 +985,6 @@ code { .logos { flex-wrap: wrap; } - .logo-margin { - margin: 10px auto; - } } @media only screen and (max-width: 568px) { .photos-page-list .item { @@ -1021,6 +1018,9 @@ code { .blogs-list .item .inner .details .title { font-size: 20px; } + .logo-margin { + margin: 0.25rem auto; + } } @media only screen and (max-width: 480px) { /* .image-and-text-main .left img{height:400px} */ diff --git a/homepage/public/images/uploads/logo__fnf.png b/homepage/public/images/uploads/logo__fnf.png new file mode 100644 index 00000000..0cd184dd Binary files /dev/null and b/homepage/public/images/uploads/logo__fnf.png differ diff --git a/homepage/public/images/uploads/logo__ocf.svg b/homepage/public/images/uploads/logo__ocf.svg new file mode 100644 index 00000000..c9251d66 --- /dev/null +++ b/homepage/public/images/uploads/logo__ocf.svg @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/homepage/src/CMS/decap-cms.config.js b/homepage/src/CMS/decap-cms.config.js index cb469ce0..d4c4e922 100644 --- a/homepage/src/CMS/decap-cms.config.js +++ b/homepage/src/CMS/decap-cms.config.js @@ -364,7 +364,7 @@ module.exports = { label: 'Links', label_singular: 'Link', widget: 'list', - summary: '{{fields.type} - {{fields.url}}', + summary: '{{fields.type}} - {{fields.url}}', fields: [ { label: 'Type', @@ -429,6 +429,36 @@ module.exports = { }, ], }, + { + label: 'Logos', + name: 'logos', + label_singular: 'Logo', + widget: 'list', + i18n: true, + summary: '{{fields.title}} | {{fields.alt_text}}', + fields: [ + { + label: 'Title', + name: 'title', + widget: 'string', + }, + { + label: 'Alt Text', + name: 'alt_text', + widget: 'string', + }, + { + label: 'Image', + name: 'image_url', + widget: 'image', + }, + { + label: 'Link Url', + name: 'link_url', + widget: 'string', + }, + ], + }, ], }, ], diff --git a/homepage/src/components/logo.jsx b/homepage/src/components/logo.jsx index 32afbebd..70538f07 100644 --- a/homepage/src/components/logo.jsx +++ b/homepage/src/components/logo.jsx @@ -1,18 +1,21 @@ import Image from 'next/image'; +import Link from 'next/link'; -const Logo = ({ text, src, dimension }) => ( -
- {text} - {`${text}-logo`} +const Logo = ({ title, altText, src, dimension, link }) => ( +
+ {title} + + {altText} +
); diff --git a/homepage/src/layouts/contentMapper.jsx b/homepage/src/layouts/contentMapper.jsx index 06d60cf5..91681bd9 100644 --- a/homepage/src/layouts/contentMapper.jsx +++ b/homepage/src/layouts/contentMapper.jsx @@ -10,19 +10,19 @@ import { componentTypes } from '../lib/componentMapper'; const contentMapper = (component) => { switch (component.type) { case componentTypes.Banner: - return ; + return ; case componentTypes.Headline: - return ; + return ; case componentTypes.ImageAndText: - return ; + return ; case componentTypes.OneColumn: - return
; + return
; case componentTypes.TwoColumns: - return ; + return ; case componentTypes.ThreeColumns: - return ; + return ; case componentTypes.Cards: - return ; + return ; default: return null; } diff --git a/homepage/src/layouts/footer/footer.jsx b/homepage/src/layouts/footer/footer.jsx index 30a24db4..58f5066b 100644 --- a/homepage/src/layouts/footer/footer.jsx +++ b/homepage/src/layouts/footer/footer.jsx @@ -1,36 +1,25 @@ -import { useRouter } from 'next/router'; import SocialMedia from '../../components/socialMedia'; import Logo from '../../components/logo'; -import footerZh from '../../../_footer/zh-tw/footer.json'; -import footerEn from '../../../_footer/en/footer.json'; import FooterLinks from './footerLinks'; -const Footer = ({ siteData, footer }) => { - const router = useRouter(); - const locale = router.locale; - const footerData = locale === 'en' ? footerEn : footerZh; - const footerLinks = footer?.links ?? footerData?.footer?.links ?? []; - const links = footerLinks.map((link) => ({ - displayText: link.display_text, - url: link.url, - })); +const Footer = ({ siteData, links = [], logos = [] }) => { return (