Synced from site

This commit is contained in:
lovebird 2025-03-13 19:13:51 +01:00
parent ce03635a24
commit 87fc6d64ac
8 changed files with 195 additions and 17 deletions

View File

@ -1 +1,4 @@
export default new Map();
export default new Map([
["src/content/infopages/contact.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Finfopages%2Fcontact.mdx&astroContentModuleFlag=true")]]);

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,27 @@ import mdx from "@astrojs/mdx";
import { defineConfig } from 'astro/config';
import compress from 'vite-plugin-compression';
import sitemap from "@astrojs/sitemap";
import toc from '@jsdevtools/rehype-toc'
import { rehypeAccessibleEmojis } from 'rehype-accessible-emojis';
import getReadingTime from 'reading-time';
import { toString } from 'mdast-util-to-string';
export function remarkReadingTime() {
return function (tree, { data }) {
const textOnPage = toString(tree);
const readingTime = getReadingTime(textOnPage);
// readingTime.text will give us minutes read as a friendly string,
// i.e. "3 min read"
data.astro.frontmatter.minutesRead = readingTime.text;
};
}
/**
* @link : https://github.com/rehypejs/rehype/blob/main/doc/plugins.md
* @link : https://tanggd.github.io/en/guides/markdown-content/#configuring-markdown-and-mdx
*/
export default defineConfig({
site: 'https://polymech.io',
devToolbar: {
@ -16,6 +37,13 @@ export default defineConfig({
defaultLocale: "en",
},
vite: {
resolve: {
alias: {
'@components': '/src/components',
'@layouts': '/src/layouts',
'img': '',
}
},
plugins: [
tailwindcss({
config: './tailwind.config.cjs',
@ -25,7 +53,15 @@ export default defineConfig({
algorithm: 'gzip', // You can also use 'brotliCompress' for Brotli
threshold: 1024, // Compress files larger than 1KB
deleteOriginFile: false, // Keep original files (optional)
})
}),
{
name: 'auto-import-img',
transform(code, id) {
if (id.endsWith('.astro') || id.endsWith('.mdx')) {
// return `import { Img } from 'imagetools/components';\n` + code;
}
},
},
],
build: {
target: 'esnext',
@ -42,15 +78,6 @@ export default defineConfig({
markdown: {
drafts: true,
shikiConfig: {
//'andromeeda' | 'aurora-x' | 'ayu-dark' |
// 'catppuccin-frappe' | 'catppuccin-latte' |
// 'catppuccin-macchiato' | 'catppuccin-mocha' |
// 'dark-plus' | 'dracula' | 'dracula-soft' |
// 'everforest-dark' | 'everforest-light' |
// 'github-dark' | 'github-dark-default' |
// 'github-dark-dimmed' | 'github-dark-high-contrast' |
// 'github-light' | 'github-light-default' |
// 'github-light-high-contrast' | 'houston' | 'kanagawa-dragon' | 'kanagawa-lotus' | 'kanagawa-wave' | 'laserwave' | 'light-plus' | 'material-theme' | 'material-theme-darker' | 'material-theme-lighter' | 'material-theme-ocean' | 'material-theme-palenight' | 'min-dark' | 'min-light' | 'monokai' | 'night-owl' | 'nord' | 'one-dark-pro' | 'one-light' | 'plastic' | 'poimandres' | 'red' | 'rose-pine' | 'rose-pine-dawn' | 'rose-pine-moon' | 'slack-dark' | 'slack-ochin' | 'snazzy-light' | 'solarized-dark' | 'solarized-light' | 'synthwave-84' | 'tokyo-night' | 'vesper' | 'vitesse-black' | 'vitesse-dark' | 'vitesse-light'
theme: "github-light-default"
}
},
@ -64,7 +91,12 @@ export default defineConfig({
sitemap({
}),
mdx(),
mdx({
rehypePlugins: [
rehypeAccessibleEmojis,
remarkReadingTime
],
}),
//AstroPWA({}),
react(),
imagetools,

98
package-lock.json generated
View File

@ -14,6 +14,7 @@
"@astrojs/rss": "^4.0.10",
"@astrojs/sitemap": "^3.2.1",
"@astrolib/seo": "^1.0.0-beta.8",
"@jsdevtools/rehype-toc": "^3.0.2",
"@playwright/test": "^1.50.1",
"@polymech/cache": "file:../polymech-mono/packages/cache",
"@polymech/cad": "file:../polymech-mono/packages/cad",
@ -54,10 +55,13 @@
"picomatch": "^4.0.2",
"potrace": "^2.1.8",
"react-jsx-parser": "^2.3.0",
"reading-time": "^1.5.0",
"rehype-accessible-emojis": "^0.3.2",
"rehype-stringify": "^10.0.1",
"remark": "^15.0.1",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.1",
"remark-toc": "^9.0.0",
"sanitize-html": "^2.14.0",
"schema-dts": "^1.1.2",
"sharp": "^0.29.3",
@ -2199,6 +2203,15 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"node_modules/@jsdevtools/rehype-toc": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@jsdevtools/rehype-toc/-/rehype-toc-3.0.2.tgz",
"integrity": "sha512-n5JEf16Wr4mdkRMZ8wMP/wN9/sHmTjRPbouXjJH371mZ2LEGDl72t8tEsMRNFerQN/QJtivOxqK1frdGa4QK5Q==",
"license": "MIT",
"engines": {
"node": ">=10"
}
},
"node_modules/@mdx-js/mdx": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.0.tgz",
@ -3360,6 +3373,12 @@
"@types/node": "*"
}
},
"node_modules/@types/ungap__structured-clone": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@types/ungap__structured-clone/-/ungap__structured-clone-1.2.0.tgz",
"integrity": "sha512-ZoaihZNLeZSxESbk9PUAPZOlSpcKx81I1+4emtULDVmBLkYutTcMlCj2K9VNlf9EWODxdO6gkAqEaLorXwZQVA==",
"license": "MIT"
},
"node_modules/@types/unist": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
@ -7038,6 +7057,12 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/gemoji": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/gemoji/-/gemoji-4.2.1.tgz",
"integrity": "sha512-V9lUpRSn+KQGavZx8Pk+6mxG3kaz21ae2kTCXuT36KaRPNgYU8eHtj/RcUCNFVvmwppsYYz3nnNS9lmcP5kTsg==",
"license": "MIT"
},
"node_modules/gensync": {
"version": "1.0.0-beta.2",
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
@ -9605,6 +9630,25 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-toc": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/mdast-util-toc/-/mdast-util-toc-7.1.0.tgz",
"integrity": "sha512-2TVKotOQzqdY7THOdn2gGzS9d1Sdd66bvxUyw3aNpWfcPXCLYSJCCgfPy30sEtuzkDraJgqF35dzgmz6xlvH/w==",
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
"@types/ungap__structured-clone": "^1.0.0",
"@ungap/structured-clone": "^1.0.0",
"github-slugger": "^2.0.0",
"mdast-util-to-string": "^4.0.0",
"unist-util-is": "^6.0.0",
"unist-util-visit": "^5.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast/node_modules/ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
@ -12818,6 +12862,12 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/reading-time": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/reading-time/-/reading-time-1.5.0.tgz",
"integrity": "sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg==",
"license": "MIT"
},
"node_modules/recma-build-jsx": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/recma-build-jsx/-/recma-build-jsx-1.0.0.tgz",
@ -12954,6 +13004,34 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/rehype-accessible-emojis": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/rehype-accessible-emojis/-/rehype-accessible-emojis-0.3.2.tgz",
"integrity": "sha512-kChZo+EZsuFQYHUPu6kOZFjDrG7UtQdGxkrCvHBVo9ariKPL6S68QdPVxLxwcAtZSRZIXZhDuTJHgIM8KW24Qw==",
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"gemoji": "^4.2.1",
"hast-util-is-element": "^1.0.3",
"unist-util-flatmap": "^1.0.0"
}
},
"node_modules/rehype-accessible-emojis/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"license": "MIT"
},
"node_modules/rehype-accessible-emojis/node_modules/hast-util-is-element": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz",
"integrity": "sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ==",
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/rehype-parse": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.1.tgz",
@ -13125,6 +13203,20 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-toc": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/remark-toc/-/remark-toc-9.0.0.tgz",
"integrity": "sha512-KJ9txbo33GjDAV1baHFze7ij4G8c7SGYoY8Kzsm2gzFpbhL/bSoVpMMzGa3vrNDSWASNd/3ppAqL7cP2zD6JIA==",
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
"mdast-util-toc": "^7.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remove-trailing-separator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
@ -15258,6 +15350,12 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/unist-util-flatmap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unist-util-flatmap/-/unist-util-flatmap-1.0.0.tgz",
"integrity": "sha512-IG32jcKJlhARCYT2LsYPJWdoXYkzz3ESAdl1aa2hn9Auh+cgUmU6wgkII4yCc/1GgeWibRdELdCZh/p3QKQ1dQ==",
"license": "MIT"
},
"node_modules/unist-util-is": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz",

View File

@ -24,6 +24,7 @@
"@astrojs/rss": "^4.0.10",
"@astrojs/sitemap": "^3.2.1",
"@astrolib/seo": "^1.0.0-beta.8",
"@jsdevtools/rehype-toc": "^3.0.2",
"@playwright/test": "^1.50.1",
"@polymech/cache": "file:../polymech-mono/packages/cache",
"@polymech/cad": "file:../polymech-mono/packages/cad",
@ -64,10 +65,13 @@
"picomatch": "^4.0.2",
"potrace": "^2.1.8",
"react-jsx-parser": "^2.3.0",
"reading-time": "^1.5.0",
"rehype-accessible-emojis": "^0.3.2",
"rehype-stringify": "^10.0.1",
"remark": "^15.0.1",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.1",
"remark-toc": "^9.0.0",
"sanitize-html": "^2.14.0",
"schema-dts": "^1.1.2",
"sharp": "^0.29.3",

View File

@ -1,12 +1,12 @@
export default {
"environment": "build",
"environment": "dev",
"isSsrBuild": false,
"projectBase": "",
"publicDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\public\\",
"rootDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\",
"mode": "production",
"outDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\dist\\",
"assetsDir": "_astro",
"mode": "dev",
"outDir": "dist",
"assetsDir": "/_astro",
"sourcemap": false,
"assetFileNames": "/_astro/[name]@[width].[hash][extname]"
}

View File

@ -0,0 +1,31 @@
---
title: Contact
description: Contact Plastic Hub
layout: '@layouts/Markup.astro'
---
import { Img } from 'imagetools/components'
import { default_image } from '@/app/config.js'
import GalleryK from "@/components/polymech/GalleryK.astro"
<Img src={default_image().src} alt="Contact" />
## {frontmatter.title}
## Administration & Sales
[sales@plastic-hub.com](mailto:/sales@plastic-hub.com)
Anne Barbier - +34 691 952 287
Address - Factory
Polígono Can Clapers
Carrer Can peric 11, 1B
08181 Sentmenat ~ Spain
VAT - ID : ESY0100830N
[Get Directions](https://www.google.com/maps/place/Plastic+Hub/@41.6093789,2.1399009,17z/data=!3m1!4b1!4m5!3m4!1s0x12a4eb80cfabbbfd:0x2cd16f2aff436ed!8m2!3d41.6094019!4d2.1421267)
[Gallery](https://photos.app.goo.gl/cyVD5hGv3uHfuyKU6)

10
src/layouts/Markup.astro Normal file
View File

@ -0,0 +1,10 @@
---
import BaseHead from "../components/BaseHead.astro";
import Navigation from "../components/global/Navigation.astro";
import Footer from "../components/global/Footer.astro";
import { isRTL } from "config/config.js"
const { frontmatter: frontmatter, additionalKeywords, ...rest } = Astro.props;
---
<main class="grow">
<slot />
</main>