A modern, responsive business website built with Vite, Handlebars, and Tailwind CSS, featuring full internationalization support and a component-based architecture.
- Fix form submissions with powerautomate pipeline => done when migrating to new netlify
- Ajouter les cookies de navigation et les popup relevant
- π Multilingual Support - Full internationalization with French and English
- π± Responsive Design - Mobile-first approach with Tailwind CSS
- π§© Component-Based Architecture - Modular partials and reusable components
- β‘ Fast Development - Vite for lightning-fast builds and hot reload
- π Contact Forms - Netlify-ready form handling
- π¨ Custom Styling - Tailwind CSS with custom brand colors
- π Multi-Page Support - Individual pages for different sections
- Node.js (v16 or higher)
- npm or yarn
# Clone the repository
git clone [your-repo-url]
cd site3
# Install dependencies
npm install
# Start development server
npm run devThe site will be available at http://localhost:5173
# Build the project
npm run build
# Preview the production build
npm run previewsrc/
βββ data/ # JSON data files for content
β βββ careers.json
β βββ menu.json
β βββ sections-*.json
β βββ ...
βββ js/ # JavaScript modules
β βββ main.js # Main entry point
β βββ contact.js # Contact form handling
β βββ mobile-menu.js # Mobile navigation
βββ pages/ # HTML page templates
β βββ index.html
β βββ careers.html
β βββ contact.html
β βββ services.html
βββ partials/ # Reusable HTML components
β βββ header.html
β βββ footer.html
β βββ section-*.html
β βββ icons/
βββ styles/ # CSS files
βββ main.css
βββ custom.css
βββ ...
public/
βββ images/ # Static images
βββ locales/ # Translation files
β βββ en/ # English translations
β βββ fr/ # French translations
βββ content/ # Static content files
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run preview- Preview production build locallynpm run format- Format code with Prettier
- Create a new HTML file in
src/pages/ - Add the page to
vite.config.jsin therollupOptions.inputobject - Create corresponding data files in
src/data/if needed - Update navigation in
src/data/menu.json
Example:
// vite.config.js
input: {
// existing pages...
newpage: path.resolve(__dirname, 'src/pages/newpage.html'),
}- Create a new partial in
src/partials/section-[name].html - Add section data to appropriate
src/data/sections-*.jsonfile - Add translations to
public/locales/en/andpublic/locales/fr/
The project uses i18next for translations:
- Translation files:
public/locales/{lang}/{namespace}.json - Usage in HTML:
data-i18n="namespace:key" - Placeholders:
data-i18n-placeholder="namespace:key"
Example:
<h1 data-i18n="hero:title"></h1>
<input data-i18n-placeholder="contact:form-name" />The cookie consent banner records the visitor's choice in localStorage under the
cookie-consent-preference key and exposes it globally as window.__cookieConsentPreference.
Every time the preference changes a cookie-consent-change custom event is dispatched with the
current value (accepted or declined) so additional scripts can react accordingly.
For Google Analytics / Google Tag Manager integrations:
-
Declare the measurement IDs before
src/js/main.jsloads, for example in the page<head>:<script> window.GTAG_MEASUREMENT_IDS = ['G-XXXXXXX']; </script>
-
The
src/js/google-tags.jsmodule automatically listens to the consent events. When visitors accept, it injects the Google tag script, initialises thedataLayer, and configures all declared IDs with IP anonymisation. -
When visitors decline, the module prevents Google tags from firing by removing the injected script, setting
window['ga-disable-<ID>'] = truefor each measurement ID, and keeping Google consent signals in thedeniedstate. No additional action is required on your part.
If you need to handle other third-party tools, hook into the cookie-consent-change event:
document.addEventListener('cookie-consent-change', (event) => {
if (event.detail.value === 'declined') {
// pause or disable additional tracking pixels here
}
});For LinkedIn Insight Tag integrations:
-
Declare the partner IDs before
src/js/main.jsloads, for example in the page<head>:<script> window.LINKEDIN_PARTNER_IDS = ['8366626']; </script>
-
The
src/js/linkedin-tags.jsmodule listens to the same consent events and injects the LinkedIn Insight Tag only after visitors accept tracking. -
If visitors decline, or later revoke consent, the LinkedIn script is removed and no new Insight Tag library loads are triggered.
Custom brand colors are defined in tailwind.config.js:
brand-blue: #0C2830brand-orange: #42B5C5
main.css- Main Tailwind imports and base stylescustom.css- Custom component stylesanimations.css- Animation definitionsbutton.css- Button component stylesmobile-menu.css- Mobile navigation stylesnavbar.css- Navigation styles
Forms are configured for Netlify deployment with the netlify attribute:
<form name="contact" netlify>
<!-- form fields -->
</form>Note: Forms only work when deployed to Netlify. For local development, form submissions will result in 404 errors.
Currently supports:
- French (fr) - Default language
- English (en)
Languages are auto-detected based on browser settings, with French as fallback.
- Connect your repository to Netlify
- Build settings:
- Build command:
npm run build - Publish directory:
dist
- Build command:
- Forms will be automatically handled by Netlify
Build the project and upload the dist folder to your web server:
npm run build
# Upload dist/ folder contentsKey features enabled in vite.config.js:
- Handlebars templating with partials support
- Tailwind CSS integration
- Hot reload for partials changes
- Multi-page build configuration
- Automatic data loading from JSON files
Content is managed through JSON files in src/data/:
sections-*.json- Define which sections appear on each pagemenu.json- Navigation structurecareers.json,team.json, etc. - Page-specific content
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Format code:
npm run format - Commit changes:
git commit -m 'Add feature' - Push to branch:
git push origin feature-name - Open a pull request
ISC License - see package.json for details.
For questions or issues, please contact [email protected] or open an issue in the repository.