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

Мигрирует на Eleventy@3 #359

Merged
merged 2 commits into from
Apr 26, 2024
Merged
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
4 changes: 2 additions & 2 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Typograf = require('typograf');
import Typograf from 'typograf';

const privateLabel = '\uF000';
// Узкий неразрывный пробел для сокращений т.д. и т.п.
Expand Down Expand Up @@ -43,7 +43,7 @@ const typograf = new Typograf({
typograf.enableRule('ru/nnbsp/abbr');
typograf.disableRule('ru/nbsp/abbr');

module.exports = {
export default {
settings: {
commonmark: true,
emphasis: '_',
Expand Down
14 changes: 7 additions & 7 deletions eleventy.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
module.exports = function(eleventyConfig) {
export default async function(eleventyConfig) {
// Настройка Markdown
require('./src/eleventy-config/markdown-library.js')(eleventyConfig);
(await import('./src/eleventy-config/markdown-library.js')).default(eleventyConfig);

// Коллекции
require('./src/eleventy-config/collections.js')(eleventyConfig);
(await import('./src/eleventy-config/collections.js')).default(eleventyConfig);

// Фильтры
require('./src/eleventy-config/filters.js')(eleventyConfig);
(await import('./src/eleventy-config/filters.js')).default(eleventyConfig);

// Трансформации
require('./src/eleventy-config/transforms.js')(eleventyConfig);
(await import('./src/eleventy-config/transforms.js')).default(eleventyConfig);

// Теги
require('./src/eleventy-config/shortcodes.js')(eleventyConfig);
(await import('./src/eleventy-config/shortcodes.js')).default(eleventyConfig);

// Копирование
require('./src/eleventy-config/static-files.js')(eleventyConfig);
(await import('./src/eleventy-config/static-files.js')).default(eleventyConfig);
pepelsbey marked this conversation as resolved.
Show resolved Hide resolved

return {
dir: {
Expand Down
8 changes: 4 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const globals = require('globals');
const js = require('@eslint/js');
const stylisticJs = require('@stylistic/eslint-plugin-js');
import globals from 'globals';
import js from '@eslint/js';
import stylisticJs from '@stylistic/eslint-plugin-js';

module.exports = [
export default [
js.configs.recommended,

// Глобальные переменные только для скриптов Node.js
Expand Down
39 changes: 20 additions & 19 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
const babel = require('gulp-babel');
const buffer = require('vinyl-buffer');
const del = require('del');
const fs = require('fs');
const gulp = require('gulp');
const paths = require('vinyl-paths');
const postcss = require('gulp-postcss');
const replace = require('gulp-replace');
const rev = require('gulp-rev');
const rewrite = require('gulp-rev-rewrite');
const rollup = require('rollup-stream');
const source = require('vinyl-source-stream');
const terser = require('gulp-terser');
import babel from 'gulp-babel';
import buffer from 'vinyl-buffer';
import del from 'del';
import fs from 'fs';
import gulp from 'gulp';
import paths from 'vinyl-paths';
import postcss from 'gulp-postcss';
import replace from 'gulp-replace';
import rev from 'gulp-rev';
import rewrite from 'gulp-rev-rewrite';
import rollup from 'rollup-stream';
import source from 'vinyl-source-stream';
import terser from 'gulp-terser';

// Styles
const postCssPlugins = await Promise.all([
'postcss-import',
'postcss-color-hex-alpha',
'autoprefixer',
'postcss-csso',
].map((name) => import(name).then(module => module.default)));

gulp.task('styles', () => {
return gulp.src('dist/styles/{styles,print}.css')
.pipe(postcss([
require('postcss-import'),
require('postcss-color-hex-alpha'),
require('autoprefixer'),
require('postcss-csso'),
]))
.pipe(postcss(postCssPlugins))
.pipe(gulp.dest('dist/styles'));
});

Expand Down
Loading