Skip to content
Snippets Groups Projects
Commit f7772d98 authored by Emmanuel Salomon's avatar Emmanuel Salomon :fist:
Browse files

chore: move all raw forum and map url to global config

parent 4f08bca8
No related branches found
No related tags found
No related merge requests found
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
v-for="network in networks" v-for="network in networks"
:key="network.name" :key="network.name"
:network="network.network" :network="network.network"
:url="$config.siteUrl + document.path.replace(/^\/pages\//, '/')" :url="$config.site_url + document.path.replace(/^\/pages\//, '/')"
:title="document.title" :title="document.title"
:description="document.description" :description="document.description"
:quote="document.description" :quote="document.description"
:hashtags="$config.socialNetworksHashtags" :hashtags="$config.social_networks_hashtags"
:twitter-user="$config.twitterUser" :twitter-user="$config.twitter_user"
:media="media" :media="media"
class=" class="
flex flex
......
...@@ -4,7 +4,17 @@ ...@@ -4,7 +4,17 @@
<span <span
v-show="hovered" v-show="hovered"
id="tooltip-mini-map" id="tooltip-mini-map"
class="absolute whitespace-nowrap pointer-events-none p-1 shadow-lg rounded text-xs bg-opacity-90 bg-white dark:bg-gray-700" class="
absolute
whitespace-nowrap
pointer-events-none
p-1
shadow-lg
rounded
text-xs
bg-opacity-90 bg-white
dark:bg-gray-700
"
> >
{{ hovered && hovered.name }} {{ hovered && hovered.name }}
</span> </span>
...@@ -223,7 +233,7 @@ export default { ...@@ -223,7 +233,7 @@ export default {
region.addEventListener('click', (evt) => { region.addEventListener('click', (evt) => {
window.open( window.open(
`https://forum.monnaie-libre.fr/c/${regions[evt.target.id].id}`, `${this.$config.forum_url}/c/${regions[evt.target.id].id}`,
'_blank' '_blank'
) )
}) })
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
<iframe <iframe
:src="intersected ? 'https://carte.monnaie-libre.fr/?zoom=5' : null" :src="intersected ? $config.map_url : null"
class="w-screen bg-gray-200" class="w-screen bg-gray-200"
style="height: 50vh; min-height: 600px" style="height: 50vh; min-height: 600px"
title="Carte monnaie-libre" title="Carte monnaie-libre"
......
...@@ -3,9 +3,18 @@ ...@@ -3,9 +3,18 @@
<div class="border-b-2 container flex items-end mb-3 pb-2"> <div class="border-b-2 container flex items-end mb-3 pb-2">
<JuneCalendar class="w-12 mr-3 fill-current dark:text-gray-100" /> <JuneCalendar class="w-12 mr-3 fill-current dark:text-gray-100" />
<a <a
href="https://forum.monnaie-libre.fr/calendar" :href="`${$config.forum_url}/calendar`"
target="_blank" target="_blank"
class="group bg-clip-text bg-gradient-to-r font-extrabold from-purple-800 hover:underline text-4xl text-transparent to-blue-600 uppercase" class="
group
bg-clip-text bg-gradient-to-r
font-extrabold
from-purple-800
hover:underline
text-4xl text-transparent
to-blue-600
uppercase
"
rel="noopener noreferrer" rel="noopener noreferrer"
> >
Agenda Agenda
...@@ -26,9 +35,17 @@ ...@@ -26,9 +35,17 @@
<a <a
v-for="(event, index) in column" v-for="(event, index) in column"
:key="index" :key="index"
:href="`https://forum.monnaie-libre.fr/t/${event.slug}/${event.id}`" :href="`${$config.forum_url}/t/${event.slug}/${event.id}`"
target="_blank" target="_blank"
class="block hover:bg-hover-light dark-hover:text-gray-800 p-2 mt-1 rounded-lg transition-colors" class="
block
hover:bg-hover-light
dark-hover:text-gray-800
p-2
mt-1
rounded-lg
transition-colors
"
rel="noopener noreferrer" rel="noopener noreferrer"
> >
<div class="event-date text-sm text-gray-500"> <div class="event-date text-sm text-gray-500">
......
<template> <template>
<div class="flex"> <div class="flex">
<template v-for="(item, index) of menu"> <template v-for="(item, index) of menu">
<nuxt-link <nuxt-link v-if="item.url" :key="index" class="menu-item" :to="item.url">
v-if="item.url.startsWith('/')"
:key="index"
class="menu-item"
:to="item.url"
>
{{ item.title }} {{ item.title }}
</nuxt-link> </nuxt-link>
</template> <t-dropdown
v-else-if="item.title.toLowerCase() === 'forum'"
<t-dropdown :key="index"
toggle-on-hover toggle-on-hover
:hide-on-leave-timeout="0" :hide-on-leave-timeout="0"
:classes="{ :classes="{
dropdown: dropdown:
'absolute right-0 rounded-md shadow-lg bg-white dark:bg-gray-600 dark:border-gray-500 border transform translate-y-1', 'absolute right-0 rounded-md shadow-lg bg-white dark:bg-gray-600 dark:border-gray-500 border transform translate-y-1',
}" }"
>
<a
slot="trigger"
class="menu-item"
href="https://forum.monnaie-libre.fr/"
target="_blank"
rel="noopener noreferrer"
> >
Forum <a
<fa slot="trigger"
icon="external-link-alt" class="menu-item"
class="w-3 ml-1.5 text-gray-500 opacity-75" :href="$config.forum_url"
/> target="_blank"
</a> rel="noopener noreferrer"
<LayoutHeaderMenuForum /> >
</t-dropdown> Forum
<fa
icon="external-link-alt"
class="w-3 ml-1.5 text-gray-500 opacity-75"
/>
</a>
<LayoutHeaderMenuForum />
</t-dropdown>
</template>
</div> </div>
</template> </template>
......
...@@ -6,8 +6,15 @@ ...@@ -6,8 +6,15 @@
<a <a
v-for="(cat, index) in categories" v-for="(cat, index) in categories"
:key="index" :key="index"
class="block text-gray-600 hover:text-gray-700 hover:bg-hover-light dark:text-gray-200 p-2 w-full" class="
:href="`https://forum.monnaie-libre.fr/c/${cat.slug}/${cat.id}`" block
text-gray-600
hover:text-gray-700 hover:bg-hover-light
dark:text-gray-200
p-2
w-full
"
:href="`${$config.forum_url}/c/${cat.slug}/${cat.id}`"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
> >
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</li> </li>
<li> <li>
<a <a
:href="`https://forum.monnaie-libre.fr/search?q=${query}`" :href="`${$config.forum_url}/search?q=${query}`"
class="hover:underline" class="hover:underline"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
export default async ({ publicRuntimeConfig, config, paths }) => { export default async ({ publicRuntimeConfig, config, paths }) => {
const { $content } = require('@nuxt/content') const { $content } = require('@nuxt/content')
const siteUrl = publicRuntimeConfig.siteUrl const link = publicRuntimeConfig.site_url
const basePath = '/feed' const basePath = '/feed'
// auto fetch all first level dirs in content // auto fetch all first level dirs in content
...@@ -26,7 +26,7 @@ export default async ({ publicRuntimeConfig, config, paths }) => { ...@@ -26,7 +26,7 @@ export default async ({ publicRuntimeConfig, config, paths }) => {
const feedOptions = { const feedOptions = {
title: config.site_title, title: config.site_title,
link: siteUrl, link,
description: config.site_description, description: config.site_description,
language: 'fr', language: 'fr',
} }
...@@ -52,7 +52,7 @@ export default async ({ publicRuntimeConfig, config, paths }) => { ...@@ -52,7 +52,7 @@ export default async ({ publicRuntimeConfig, config, paths }) => {
feed.options = feedOptions feed.options = feedOptions
posts.forEach((post) => { posts.forEach((post) => {
const url = `${siteUrl}${post.path}` const url = `${link}${post.path}`
feed.addItem({ feed.addItem({
id: url, id: url,
link: url, link: url,
......
...@@ -6,12 +6,13 @@ import sitemapRoutes from './libs/sitemapRoutes.js' ...@@ -6,12 +6,13 @@ import sitemapRoutes from './libs/sitemapRoutes.js'
import feedFactory from './libs/feedFactory.js' import feedFactory from './libs/feedFactory.js'
const publicRuntimeConfig = { const publicRuntimeConfig = {
siteUrl: process.env.SITE_URL || 'https://monnaie-libre.fr', site_url: process.env.site_url || 'https://monnaie-libre.fr',
forumUrl: process.env.FORUM_URL || 'https://forum.monnaie-libre.fr', forum_url: process.env.forum_url || 'https://forum.monnaie-libre.fr',
mapUrl: process.env.MAP_URL || 'https://carte.monnaie-libre.fr', map_url: process.env.map_url || 'https://carte.monnaie-libre.fr',
socialNetworksHashtags: twitter_user: process.env.twitter_user || 'monnaie_libre',
process.env.SOCIAL_NETWORKS_HASHTAGS || 'MonnaieLibre,Ğ1', social_networks_hashtags:
twitterUser: process.env.TWITTER_USER || 'monnaie_libre', process.env.social_networks_hashtags || 'MonnaieLibre,Ğ1',
...config,
} }
export default { export default {
...@@ -171,7 +172,7 @@ export default { ...@@ -171,7 +172,7 @@ export default {
hooks, hooks,
sitemap: { sitemap: {
hostname: publicRuntimeConfig.siteUrl, hostname: publicRuntimeConfig.site_url,
gzip: true, gzip: true,
routes: sitemapRoutes, routes: sitemapRoutes,
}, },
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</li> </li>
<li> <li>
<a <a
:href="`https://forum.monnaie-libre.fr/search?q=${query}`" :href="`${$config.forum_url}/search?q=${query}`"
class="hover:underline" class="hover:underline"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
......
...@@ -16,7 +16,16 @@ ...@@ -16,7 +16,16 @@
)" )"
:key="item.path" :key="item.path"
:to="item.path.replace(/^\/pages\//, '/')" :to="item.path.replace(/^\/pages\//, '/')"
class="block cursor-pointer dark-hover:bg-gray-700 hover:bg-gray-100 mb-2 p-2 rounded-lg transition-colors" class="
block
cursor-pointer
dark-hover:bg-gray-700
hover:bg-gray-100
mb-2
p-2
rounded-lg
transition-colors
"
> >
<div <div
class="rounded text-gray-400 text-xs uppercase font-semibold" class="rounded text-gray-400 text-xs uppercase font-semibold"
...@@ -65,7 +74,16 @@ ...@@ -65,7 +74,16 @@
:href="item.href" :href="item.href"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
class="block cursor-pointer dark-hover:bg-gray-700 hover:bg-gray-100 mb-2 p-2 rounded-lg transition-colors" class="
block
cursor-pointer
dark-hover:bg-gray-700
hover:bg-gray-100
mb-2
p-2
rounded-lg
transition-colors
"
> >
<h1 class="text-xl" v-html="item.title" /> <h1 class="text-xl" v-html="item.title" />
<div <div
...@@ -128,7 +146,7 @@ export default { ...@@ -128,7 +146,7 @@ export default {
} }
let results = await fetch( let results = await fetch(
`https://forum.monnaie-libre.fr/search.json?q=${query}` `${this.$config.forum_url}/search.json?q=${query}`
).then((response) => response.json()) ).then((response) => response.json())
if (!results.posts) { if (!results.posts) {
...@@ -145,7 +163,7 @@ export default { ...@@ -145,7 +163,7 @@ export default {
post_number: item.post_number, post_number: item.post_number,
title: topic.title, title: topic.title,
description: item.blurb, description: item.blurb,
href: `https://forum.monnaie-libre.fr/t/${topic.slug}/${item.topic_id}/${item.post_number}`, href: `${this.$config.forum_url}/t/${topic.slug}/${item.topic_id}/${item.post_number}`,
} }
}) })
......
...@@ -142,7 +142,7 @@ collections: ...@@ -142,7 +142,7 @@ collections:
widget: list widget: list
fields: fields:
- { label: Titre, name: title } - { label: Titre, name: title }
- { name: url } - { name: url, required: false }
- { label: Icône, name: icon, required: false } - { label: Icône, name: icon, required: false }
- label: Menus du footer - label: Menus du footer
name: menu_footer name: menu_footer
...@@ -175,4 +175,7 @@ collections: ...@@ -175,4 +175,7 @@ collections:
- { label: Titre du site, name: site_title, widget: string } - { label: Titre du site, name: site_title, widget: string }
- { label: Logo du site, name: site_logo, widget: image, allow_multiple: false } - { label: Logo du site, name: site_logo, widget: image, allow_multiple: false }
- { label: Meta description du site, name: site_description, widget: string } - { label: Meta description du site, name: site_description, widget: string }
- { label: Url du forum, name: forum_url, widget: string } - { label: Url du forum, name: forum_url, widget: string }
\ No newline at end of file - { label: Url de la carte, name: map_url, widget: string }
- { label: Compte Twitter, name: twitter_user, widget: string, hint: Sans @ }
- { label: Hashtags pour les réseaux sociaux, name: social_networks_hashtags, widget: string, hint: "Sans #, séparé par des virgules" }
\ No newline at end of file
{ {
"site_url": "https://monnaie-libre.fr/", "site_url": "https://monnaie-libre.fr",
"site_logo": "/img/logo-monnaie-libre.svg",
"site_title": "monnaie-libre.fr", "site_title": "monnaie-libre.fr",
"forum_url": "https://forum.monnaie-libre.fr/", "site_logo": "/img/logo-monnaie-libre.svg",
"site_description": "Tout savoir sur la monnaie libre ! Une monnaie au service de l'homme, le mettant au centre de l'économie." "site_description": "Tout savoir sur la monnaie libre ! Une monnaie au service de l'homme, le mettant au centre de l'économie.",
} "forum_url": "https://forum.monnaie-libre.fr",
\ No newline at end of file "map_url": "https://carte.monnaie-libre.fr/?zoom=5",
"twitter_user": "monnaie_libre",
"social_networks_hashtags": "MonnaieLibre,Ğ1"
}
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
"url": "/lexique" "url": "/lexique"
}, },
{ {
"title": "Forum", "title": "Forum"
"url": "https://forum.monnaie-libre.fr"
} }
], ],
"menu_footer": [ "menu_footer": [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment