Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Préparation du site 2025 #243

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,643 changes: 6,643 additions & 0 deletions 2024/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions 2024/src/conferences.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@
"thumbnail": "https://peertube.openstreetmap.fr/lazy-static/thumbnails/6c1cc8e0-fce8-4f4d-b50a-daf64c6d8036.jpg"
},
{
"id": 41a,
"id": 41,
"title": "Architecture SIG au SDIS34 pour l’exploitation des données OSM",
"author": "Nicolas Moyroud",
"summary": "",
"videoUrl": "https://peertube.openstreetmap.fr/w/46324fxERygYicWzLA9vZf",
"thumbnail": "https://peertube.openstreetmap.fr/lazy-static/thumbnails/6a33e52f-e73d-4d68-971b-5dbb013ae68a.jpg"
},
{
"id": 41b,
"id": 41,
"title": "OSM & accessibilité pour les personnes handicapées: des clés pour comprendre et des outils pour contri.",
"author": "Jean-Louis Zimmermann, Muriel Larrouy",
"summary": "",
Expand Down
13 changes: 13 additions & 0 deletions 2025/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
printWidth: 120
tabWidth: 4
useTabs: false
semi: true
singleQuote: false
trailingComma: "none"
bracketSpacing: false
bracketSameLine: true
arrowParens: "avoid"
htmlWhitespaceSensitivity: "css"
endOfLine: "lf"
embeddedLanguageFormatting: "auto"
singleAttributePerLine: false
27 changes: 27 additions & 0 deletions 2025/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Code contribution

> Website is generated.

To code on the website, you need Node.js and npm.

Run `npm install` to install dependencies.<br>
Then, run `npm run dev` to start a local server with auto-reload in the browser.

The pages in `./src` will be generated to `./dist`

- `./src/html/layout` layout
- `./src/html/pages` pages content
- `./src/html/partials` html chunks like header, footer and navigation
- `./src/fonts` website fonts
- `./src/img` images and pdf
- `./src/js` Javascript code used on website
- `./src/scss` css style used on website

Pages are HTML code + [Nunjucks](https://mozilla.github.io/nunjucks/) blocks.

If you only want to generate the website without local server run `npm run build`.<br>
Generated pages (`./dist`) are not commited.

### Conferences

The [conferences data](./src/js/conferences.json) are injected in the [programme template](./src/html/pages/programme.html).
82 changes: 82 additions & 0 deletions 2025/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// libraries
const { src, dest, parallel, series, watch } = require('gulp')
const fs = require("fs");
const del = require('del');
const header = require("gulp-header");
const nunjucksRender = require("gulp-nunjucks-render");
const data = require("gulp-data");
const sass = require('gulp-sass')(require('sass'));

// dev tools
const browserSync = require("browser-sync").create();

function clean() {
return del(['dist']);
}

function html() {
const conferencesData = JSON.parse(fs.readFileSync("src/js/conferences.json"));
return src('src/html/pages/*.+(html|njk)')
.pipe(data({ conferencesData }))
.pipe(nunjucksRender({ path: ['src/html'] }))
.pipe(header("\n\n<!-- This file generated, do not edit it manually. Instructions in the README. -->\n\n\n"))
.pipe(dest("dist"));
}

function css() {
return src([
'node_modules/bootstrap/dist/css/bootstrap.css',
'src/scss/*css'
])
.pipe(sass().on('error', sass.logError))
.pipe(dest('dist/css'));
};

function javascript() {
return src('src/js/*.js')
.pipe(dest('dist/js'));
}

function jsVendor() {
return src([
'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js',
'node_modules/jquery/dist/jquery.slim.min.js'
])
.pipe(dest('dist/js'))
}


function image() {
return src('src/img/**/*.+(png|jpg|jpeg|gif|svg|pdf)',{ encoding: false })
.pipe(dest('dist/img'));
}

function font() {
return src('src/fonts/*.ttf', { encoding: false })
.pipe(dest('dist/fonts'));
}

// Static Server
function serve() {
series(clean, html, image, font, css, javascript, jsVendor);
browserSync.init({
open: false,
server: "./dist"
});
}

function browserSyncReload(done) {
browserSync.reload();
done();
}

function watchFiles() {
watch('src/html/**/*', series(html, browserSyncReload));
watch('src/scss/*.+(scss|css)', series(css, browserSyncReload));
watch('src/js/*.js', series(javascript, browserSyncReload));
watch('src/img/**/*.+(png|jpg|jpeg|svg)', series(image, browserSyncReload));
}

const _build = series(clean, html, image, font, css, javascript, jsVendor);
exports.serve = parallel(_build, watchFiles, serve);
exports.build = _build;
Loading