Import nuxt 3 and edit to script setup

This commit is contained in:
2021-11-07 22:19:18 +01:00
parent 0ed426b710
commit 83c1eca443
60 changed files with 3293 additions and 7086 deletions

View File

@@ -1,48 +0,0 @@
const srcDir = 'src'
const dir = {
assets: 'assets',
layouts: 'layouts',
middleware: 'middlewares',
pages: 'pages',
static: 'static',
store: 'store',
}
const build = {
extractCss: true,
}
const pageTransition = {
name: 'page',
mode: 'out-in',
}
const target = 'server'
const server = {
port: 3333,
host: '0.0.0.0'
}
const components = [
'components',
'components/icons'
]
const buildDir = '.nuxt'
const ssr = true
const proxy = {
'/api': {
target: 'https://athena.arthurdanjou.fr',
pathRewrite: { "^/api": "" }
}
}
const router = {
middleware: 'maintenance'
}
export default { router, srcDir, dir, build, pageTransition, target, server, buildDir, components, ssr, proxy }

5
settings/AxiosConfig.ts Normal file
View File

@@ -0,0 +1,5 @@
export default {
proxy: true,
credentials: true,
proxyHeaders: true
}

View File

@@ -1,15 +0,0 @@
// Build Configuration: https://go.nuxtjs.dev/config-build
export default {
babel: {
plugins: [
['@babel/plugin-proposal-private-methods', { loose: true }]
],
},
postcss: {
preset: {
features: {
"focus-within-pseudo-class": false
}
}
}
}

View File

@@ -1,40 +0,0 @@
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
import {NuxtOptionsModule} from "@nuxt/types/config/module";
const color_mode = {
preference: 'system',
fallback: 'light',
classPrefix: '',
classSuffix: '',
}
const windicss = {
scan: {
dirs: [ './' ],
exclude: [
'node_modules',
'.git',
'.nuxt/**/*',
'build/**/*',
'*.template.html',
'app.html'
],
include: []
},
transformCSS: 'pre',
preflight: {
alias: {
// add nuxt aliases
'nuxt-link': 'a',
// @nuxt/image module
'nuxt-img': 'img',
}
}
}
export default [
'@nuxt/typescript-build',
'@nuxtjs/composition-api/module',
['nuxt-windicss', windicss],
['@nuxtjs/color-mode', color_mode],
] as NuxtOptionsModule[]

View File

@@ -0,0 +1,6 @@
export default {
preference: 'system',
fallback: 'light',
classPrefix: '',
classSuffix: '',
}

3
settings/EnvConfig.ts Normal file
View File

@@ -0,0 +1,3 @@
export default {
path: process.cwd()
}

View File

@@ -1,46 +0,0 @@
// Global page headers: https://go.nuxtjs.dev/config-head
import {NuxtOptionsHead} from "@nuxt/types/config/head";
const params = {
title: 'arthurdanjou.fr - Web & Software Developer',
color: '#00a0ff',
image: '/images/memojies/Hey.png',
url: 'https://arthurdanjou.fr',
favicon: {
type: 'image/jpg',
href: '/favicon.png',
},
description:
'Web & Software Developer from Paris, France.',
}
export default {
htmlAttrs: { lang: 'fr-FR' },
title: params.title,
meta: [
{ charset: 'utf-8' },
{ lang: 'fr-FR' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: params.description },
/**
* Open graph
* See : https://ogp.me/
*/
{ hid: 'og:type', name: 'og:type', content: 'website' },
{ hid: 'og:url', name: 'og:url', content: params.url },
{ hid: 'og:title', name: 'og:title', content: params.title },
{ hid: 'og:site_name', name: 'og:site_name', content: params.title },
{ hid: 'og:locale', name: 'og:locale', content: 'fr' },
{ hid: 'og:image', name: 'og:image', content: params.image },
{ name: 'msapplication-TileColor', content: params.color },
{ name: 'theme-color', content: params.color },
],
link: [
{ rel: 'icon', type: params.favicon.type, href: params.favicon.href },
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
{ rel: 'preconnect', href: 'https://fonts.googleapis.com', crossOrigin: 'true' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Raleway:wght@500&family=Roboto:wght@900&display=swap' }
],
} as NuxtOptionsHead

11
settings/HeadConfig.ts Normal file
View File

@@ -0,0 +1,11 @@
export default {
title: 'arthurdanjou.fr - Web & Software Developer',
color: '#00a0ff',
image: '/images/memojies/Hey.png',
url: 'https://arthurdanjou.fr',
favicon: {
type: 'image/jpg',
href: '/favicon.png',
},
description: 'Web & Software Developer from Paris, France.',
}

24
settings/I18nConfig.ts Normal file
View File

@@ -0,0 +1,24 @@
export default {
locales: [
{
code: 'en',
name: 'English',
iso: 'en-EN',
file: 'en-EN.ts',
},
{
code: 'fr',
name: 'Français',
iso: 'fr-FR',
file: 'fr-FR.ts'
},
],
strategy: 'no_prefix',
defaultLocale: 'en',
langDir: 'locales/',
lazy: true,
seo: true,
vueI18n: {
fallbackLocale: 'en',
},
}

View File

@@ -1,98 +0,0 @@
import {NuxtOptionsModule} from "@nuxt/types/config/module";
const axios = {
proxy: true,
credentials: true,
proxyHeaders: true
}
const i18n = {
locales: [
{
code: 'en',
name: 'English',
iso: 'en-EN',
file: 'en-EN.ts',
},
{
code: 'fr',
name: 'Français',
iso: 'fr-FR',
file: 'fr-FR.ts'
},
],
strategy: 'no_prefix',
defaultLocale: 'en',
langDir: 'locales/',
lazy: true,
seo: true,
vueI18n: {
fallbackLocale: 'en',
},
}
const content = {
nestedProperties: ['skills.slug'],
markdown: {
prism: {
theme: 'prism-themes/themes/prism-darcula.css'
},
remarkPlugins: [
'remark-squeeze-paragraphs',
'remark-slug',
'remark-autolink-headings',
'remark-external-links',
'remark-footnotes',
],
}
}
const storage = {
cookie: {
prefix: 'arthurdanjou.fr/',
options: {
path: '/'
}
},
}
const sitemap = {
path: '/sitemap.xml',
hostname: 'https://arthurdanjou.fr',
cacheTime: 720000,
gzip: true,
generate: false,
}
const robots = {
UserAgent: '*',
Sitemap: 'https://arthurdanjou.fr/sitemap.xml',
Allow: '*'
}
const redirect = [
{ from: '/source', to: 'https://github.com/arthurdanjou/ares' },
{ from: '/shelf', to: '/blog' },
{ from: '/posts', to: '/blog' },
{ from: '/resume', to: '/cv' }
]
const env = {
path: process.cwd()
}
const sentry = {
dsn: process.env.SENTRY_DSN
}
export default [
['@nuxtjs/axios', axios],
['@nuxtjs/i18n', i18n],
['@nuxt/content', content],
['@nuxtjs/universal-storage', storage],
['@nuxtjs/robots', robots],
['@nuxtjs/sitemap', sitemap],
['@nuxtjs/redirect-module', redirect],
['@nuxtjs/dotenv', env],
['@nuxtjs/sentry', sentry]
] as NuxtOptionsModule[]

View File

@@ -1,6 +0,0 @@
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
export default [
{
src: '~/plugins/i18n.ts'
}
]

View File

@@ -0,0 +1,6 @@
export default [
{ from: '/source', to: 'https://github.com/arthurdanjou/ares' },
{ from: '/shelf', to: '/blog' },
{ from: '/posts', to: '/blog' },
{ from: '/resume', to: '/cv' }
]

5
settings/RobotsConfig.ts Normal file
View File

@@ -0,0 +1,5 @@
export default {
UserAgent: '*',
Sitemap: 'https://arthurdanjou.fr/sitemap.xml',
Allow: '*'
}

View File

@@ -1,9 +0,0 @@
const publicRuntimeConfig = {
}
const privateRuntimeConfig = {
API_TOKEN: process.env.API_TOKEN,
SENTRY_DSN: process.env.SENTRY_DSN
}
export default { publicRuntimeConfig, privateRuntimeConfig}

3
settings/SentryConfig.ts Normal file
View File

@@ -0,0 +1,3 @@
export default {
dsn: process.env.SENTRY_DSN
}

View File

@@ -0,0 +1,7 @@
export default {
path: '/sitemap.xml',
hostname: 'https://arthurdanjou.fr',
cacheTime: 720000,
gzip: true,
generate: false,
}

View File

@@ -0,0 +1,8 @@
export default {
cookie: {
prefix: 'arthurdanjou.fr/',
options: {
path: '/'
}
},
}

View File

@@ -1,4 +0,0 @@
// Global CSS: https://go.nuxtjs.dev/config-css
export default [
'@/assets/css/style.scss'
]

View File

@@ -0,0 +1,23 @@
export default {
scan: {
dirs: [ './' ],
exclude: [
'node_modules',
'.git',
'.nuxt/**/*',
'build/**/*',
'*.template.html',
'app.html'
],
include: []
},
transformCSS: 'pre',
preflight: {
alias: {
// add nuxt aliases
'nuxt-link': 'a',
// @nuxt/image module
'nuxt-img': 'img',
}
}
}