Compare commits
1 Commits
feat/seo
...
ef7951c1e4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef7951c1e4 |
@@ -5,7 +5,7 @@ FROM hugomods/hugo:nightly
|
||||
RUN apk add --no-cache nodejs npm
|
||||
|
||||
# Install Sass (Dart Sass) globally
|
||||
RUN npm install -g sass
|
||||
RUN npm install -g sass yarn
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /app
|
||||
@@ -18,7 +18,7 @@ RUN chmod +x scripts/build.sh
|
||||
|
||||
# Install Node.js dependencies if any (e.g., for fetch-wordpress.js)
|
||||
# Assuming package.json exists and has dependencies
|
||||
RUN if [ -f package.json ]; then npm install; fi
|
||||
RUN if [ -f package.json ]; then yarn install; fi
|
||||
|
||||
# Ensure /usr/local/bin is in PATH for the CMD
|
||||
ENV PATH="/usr/local/bin:$PATH"
|
||||
|
||||
33
hugo.toml
@@ -3,6 +3,7 @@ languageCode = 'fr-fr'
|
||||
title = 'Mistergeek'
|
||||
# theme = "your-theme"
|
||||
ignoreLogs = ["warning-goldmark-raw-html"]
|
||||
enableRobotsTXT = true
|
||||
|
||||
# [permalinks]
|
||||
# posts = "/:section/:slug/"
|
||||
@@ -32,7 +33,7 @@ ignoreLogs = ["warning-goldmark-raw-html"]
|
||||
creator = "@mistergeekfrance"
|
||||
|
||||
# Facebook
|
||||
facebook_page = "mistergeek.fr"
|
||||
facebook_page = "mistergeekfrance"
|
||||
youtube_channel = "UCXXXXXXXXXXXXXXXXXXX"
|
||||
|
||||
# Search Engine Verification
|
||||
@@ -41,27 +42,27 @@ ignoreLogs = ["warning-goldmark-raw-html"]
|
||||
# yandex_verification = "your-yandex-verification-code"
|
||||
|
||||
# Local SEO
|
||||
[params.seo.local]
|
||||
enabled = true
|
||||
country = "FR"
|
||||
language = "fr"
|
||||
region = "Île-de-France"
|
||||
city = "Paris"
|
||||
latitude = "48.8566"
|
||||
longitude = "2.3522"
|
||||
# [params.seo.local]
|
||||
# enabled = true
|
||||
# country = "FR"
|
||||
# language = "fr"
|
||||
# region = "Île-de-France"
|
||||
# city = "Paris"
|
||||
# latitude = "48.8566"
|
||||
# longitude = "2.3522"
|
||||
|
||||
# Rich snippets
|
||||
enable_search_box = true
|
||||
enable_sitelinks_searchbox = true
|
||||
|
||||
# Verification codes
|
||||
[params.seo.verification]
|
||||
google = "your-google-verification-code"
|
||||
bing = "your-bing-verification-code"
|
||||
yandex = "your-yandex-verification-code"
|
||||
alexa = "your-alexa-verification-code"
|
||||
pinterest = "your-pinterest-verification-code"
|
||||
norton = "your-norton-verification-code"
|
||||
# [params.seo.verification]
|
||||
# google = "your-google-verification-code"
|
||||
# bing = "your-bing-verification-code"
|
||||
# yandex = "your-yandex-verification-code"
|
||||
# alexa = "your-alexa-verification-code"
|
||||
# pinterest = "your-pinterest-verification-code"
|
||||
# norton = "your-norton-verification-code"
|
||||
|
||||
# Image optimization for SEO
|
||||
[imaging]
|
||||
|
||||
@@ -20,14 +20,12 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-6 col-sm-6 col-lg-3">
|
||||
<h6 class="font-small fw-medium uppercase">Toutes les catégories</h6>
|
||||
<ul class="list-unstyled">
|
||||
{{ if .Site.Data.wordpress }}
|
||||
{{ $count := 0 }}
|
||||
{{ range $index, $element := .Site.Data.wordpress.categories }}
|
||||
{{ if ne $element.name "Featured" }}
|
||||
{{ if and (ne $element.name "Featured") (gt $element.count 0) }}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/{{ $element.slug }}">{{ $element.name }}</a>
|
||||
</li>
|
||||
|
||||
17
package-lock.json
generated
@@ -9,7 +9,8 @@
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"he": "^1.2.0",
|
||||
"node-fetch": "^3.3.2"
|
||||
"node-fetch": "^3.3.2",
|
||||
"yarn": "^1.22.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"sass": "^1.69.5"
|
||||
@@ -621,6 +622,20 @@
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/yarn": {
|
||||
"version": "1.22.22",
|
||||
"resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.22.tgz",
|
||||
"integrity": "sha512-prL3kGtyG7o9Z9Sv8IPfBNrWTDmXB4Qbes8A9rEzt6wkJV8mUvoirjU0Mp3GGAU06Y0XQyA3/2/RQFVuK7MTfg==",
|
||||
"hasInstallScript": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"bin": {
|
||||
"yarn": "bin/yarn.js",
|
||||
"yarnpkg": "bin/yarn.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,12 @@
|
||||
"name": "hugo-wordpress-blog",
|
||||
"version": "1.0.0",
|
||||
"description": "Hugo static site with WordPress content",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"fetch-data": "node scripts/fetch-wordpress.js",
|
||||
"generate-content": "node scripts/generate-content.js",
|
||||
"prebuild": "npm run fetch-data && npm run generate-content",
|
||||
"build": "npm run build:css && hugo --minify",
|
||||
"build:css": "sass assets/css/scss:static/assets/css",
|
||||
"dev": "npm run fetch-data && npm run generate-content && npm run build:css && hugo server -D",
|
||||
"clean": "rm -rf data/wordpress content/posts public"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -16,6 +15,7 @@
|
||||
"node-fetch": "^3.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"yarn": "^1.22.22",
|
||||
"sass": "^1.69.5"
|
||||
}
|
||||
}
|
||||
37
scripts/README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Website Update Script
|
||||
|
||||
This script triggers the builder container to update the website content using Docker Compose.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Make the script executable:
|
||||
```sh
|
||||
chmod +x scripts/update-website.sh
|
||||
```
|
||||
|
||||
2. Run the script manually to test it:
|
||||
```sh
|
||||
./scripts/update-website.sh
|
||||
```
|
||||
|
||||
3. To set up a cron job, add the following line to your crontab (edit with `crontab -e`):
|
||||
```sh
|
||||
0 2 * * * /home/acid/Documents/mistergeek/scripts/update-website.sh >> /home/acid/Documents/mistergeek/logs/update-website.log 2>&1
|
||||
```
|
||||
|
||||
This will run the update script every day at 2:00 AM.
|
||||
|
||||
Alternatively, you can run the update script every 6 hours:
|
||||
```sh
|
||||
0 */6 * * * /home/acid/Documents/mistergeek/scripts/update-website.sh >> /home/acid/Documents/mistergeek/logs/update-website.log 2>&1
|
||||
```
|
||||
|
||||
## Logs
|
||||
|
||||
Logs are stored in `/home/acid/Documents/mistergeek/logs/update-website.log`.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Docker
|
||||
- Docker Compose
|
||||
- The `docker` and `docker compose` commands must be available in the system's PATH
|
||||
@@ -3,18 +3,33 @@
|
||||
# Exit immediately if a command exits with a non-zero status.
|
||||
set -e
|
||||
|
||||
# Log the start of the build process
|
||||
echo "Starting build process..."
|
||||
|
||||
# Log the beginning of CSS compilation
|
||||
echo "Building CSS..."
|
||||
# Assuming sass is installed and available in the environment or Docker image
|
||||
# Compile theme.scss to theme.css
|
||||
echo "Compiling SASS to CSS..."
|
||||
sass assets/css/scss/theme.scss static/assets/css/theme.css
|
||||
echo "CSS compilation completed successfully."
|
||||
|
||||
# Log the beginning of data fetching from WordPress
|
||||
echo "Fetching content from WordPress..."
|
||||
# Assuming Node.js is installed and available in the environment or Docker image
|
||||
node scripts/fetch-wordpress.js
|
||||
# Assuming Node.js and Yarn are installed and available in the environment or Docker image
|
||||
yarn run fetch-data
|
||||
echo "Content fetched successfully from WordPress."
|
||||
|
||||
# Log the beginning of content generation for Hugo
|
||||
echo "Generating content for Hugo..."
|
||||
yarn run generate-content
|
||||
echo "Content generation for Hugo completed successfully."
|
||||
|
||||
# Log the beginning of Hugo production build
|
||||
echo "Generating production build with Hugo..."
|
||||
|
||||
# Assuming Hugo is installed and available in the environment or Docker image
|
||||
hugo --minify --environment production --config hugo.toml
|
||||
echo "Hugo production build completed successfully."
|
||||
|
||||
# Log the successful completion of the build process
|
||||
echo "Build process completed successfully!"
|
||||
|
||||
@@ -2,7 +2,7 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
|
||||
|
||||
const WORDPRESS_API = 'https://www.mistergeek.net/wp-json/wp/v2';
|
||||
const WORDPRESS_API = 'https://wp.mistergeek.net/wp-json/wp/v2';
|
||||
const OUTPUT_DIR = path.join(__dirname, '..', 'data', 'wordpress');
|
||||
const HUGO_DATA_DIR = path.join(__dirname, '..', 'data');
|
||||
|
||||
|
||||
7
scripts/update-website.cron
Normal file
@@ -0,0 +1,7 @@
|
||||
# Crontab file for updating the website
|
||||
|
||||
# Run the update script every day at 2:00 AM
|
||||
0 2 * * * /home/acid/Documents/mistergeek/scripts/update-website.sh >> /home/acid/Documents/mistergeek/logs/update-website.log 2>&1
|
||||
|
||||
# Alternatively, run the update script every 6 hours
|
||||
# 0 */6 * * * /home/acid/Documents/mistergeek/scripts/update-website.sh >> /home/acid/Documents/mistergeek/logs/update-website.log 2>&1
|
||||
24
scripts/update-website.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Exit immediately if a command exits with a non-zero status.
|
||||
set -e
|
||||
|
||||
# Log the start of the update process
|
||||
echo "Starting website update process..."
|
||||
|
||||
# Navigate to the project directory
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# Build the Docker image if it doesn't exist
|
||||
echo "Checking for Docker image..."
|
||||
if ! docker compose ls | grep -q "builder"; then
|
||||
echo "Docker image not found. Building image..."
|
||||
docker compose build
|
||||
fi
|
||||
|
||||
# Start the builder container
|
||||
echo "Starting builder container..."
|
||||
docker compose run --rm builder
|
||||
|
||||
# Log the successful completion of the update process
|
||||
echo "Website update process completed successfully!"
|
||||
BIN
static/assets/images/android-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
static/assets/images/android-icon-192x192.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
static/assets/images/android-icon-36x36.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
static/assets/images/android-icon-48x48.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
static/assets/images/android-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
static/assets/images/android-icon-96x96.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
static/assets/images/apple-icon-114x114.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
static/assets/images/apple-icon-120x120.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
static/assets/images/apple-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
static/assets/images/apple-icon-152x152.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
static/assets/images/apple-icon-180x180.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
static/assets/images/apple-icon-57x57.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
static/assets/images/apple-icon-60x60.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
static/assets/images/apple-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
static/assets/images/apple-icon-76x76.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
static/assets/images/apple-icon-precomposed.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
static/assets/images/apple-icon.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
2
static/assets/images/browserconfig.xml
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
|
||||
BIN
static/assets/images/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
static/assets/images/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
static/assets/images/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
static/assets/images/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
41
static/assets/images/manifest.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "App",
|
||||
"icons": [
|
||||
{
|
||||
"src": "\/android-icon-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
static/assets/images/ms-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
static/assets/images/ms-icon-150x150.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
static/assets/images/ms-icon-310x310.png
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
static/assets/images/ms-icon-70x70.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
60
yarn.lock
@@ -2,6 +2,46 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@parcel/watcher-android-arm64@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz"
|
||||
integrity sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==
|
||||
|
||||
"@parcel/watcher-darwin-arm64@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz"
|
||||
integrity sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==
|
||||
|
||||
"@parcel/watcher-darwin-x64@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz"
|
||||
integrity sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==
|
||||
|
||||
"@parcel/watcher-freebsd-x64@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz"
|
||||
integrity sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==
|
||||
|
||||
"@parcel/watcher-linux-arm-glibc@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz"
|
||||
integrity sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==
|
||||
|
||||
"@parcel/watcher-linux-arm-musl@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz"
|
||||
integrity sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==
|
||||
|
||||
"@parcel/watcher-linux-arm64-glibc@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz"
|
||||
integrity sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==
|
||||
|
||||
"@parcel/watcher-linux-arm64-musl@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz"
|
||||
integrity sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==
|
||||
|
||||
"@parcel/watcher-linux-x64-glibc@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz"
|
||||
@@ -12,6 +52,21 @@
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz"
|
||||
integrity sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==
|
||||
|
||||
"@parcel/watcher-win32-arm64@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz"
|
||||
integrity sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==
|
||||
|
||||
"@parcel/watcher-win32-ia32@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz"
|
||||
integrity sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==
|
||||
|
||||
"@parcel/watcher-win32-x64@2.5.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz"
|
||||
integrity sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==
|
||||
|
||||
"@parcel/watcher@^2.4.1":
|
||||
version "2.5.1"
|
||||
resolved "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz"
|
||||
@@ -173,3 +228,8 @@ web-streams-polyfill@^3.0.3:
|
||||
version "3.3.3"
|
||||
resolved "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz"
|
||||
integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==
|
||||
|
||||
yarn@^1.22.22:
|
||||
version "1.22.22"
|
||||
resolved "https://registry.npmjs.org/yarn/-/yarn-1.22.22.tgz"
|
||||
integrity sha512-prL3kGtyG7o9Z9Sv8IPfBNrWTDmXB4Qbes8A9rEzt6wkJV8mUvoirjU0Mp3GGAU06Y0XQyA3/2/RQFVuK7MTfg==
|
||||
|
||||