diff --git a/docs/api/templates/filters/tojson/index.html b/docs/api/templates/filters/tojson/index.html index 9bf9ea74..f9f5eee8 100644 --- a/docs/api/templates/filters/tojson/index.html +++ b/docs/api/templates/filters/tojson/index.html @@ -195,8 +195,8 @@ supported by JSON directly and the return value will be in a format that allows safe embedding in HTML. However if you want to use this value in an attribute of an element it needs to use single quotes otherwise it will generate a syntax error due to the embedded quotes.

-

Examples

<script type="text/javascript">
-  var options = {{ {'foo': 'bar'}|tojson }};
+

Examples

<script type="text/javascript">
+  var options = {{ {'foo': 'bar'}|tojson }};
 </script>
 

If used in attributes, single quotes are required:

diff --git a/docs/guides/webpack/index.html b/docs/guides/webpack/index.html index b304e2d4..a57a7bd2 100644 --- a/docs/guides/webpack/index.html +++ b/docs/guides/webpack/index.html @@ -232,48 +232,48 @@ installed for as long as someone else ran it before.

  • all built files will go to assets/static/gen
  • there will be a gen/app.js and a gen/styles.css file to include
  • -
    var webpack = require('webpack');
    -var path = require('path');
    -var ExtractTextPlugin = require('extract-text-webpack-plugin');
    +
    var webpack = require('webpack');
    +var path = require('path');
    +var ExtractTextPlugin = require('extract-text-webpack-plugin');
     
    -module.exports = {
    -  entry: {
    -    'app': './js/main.js',
    -    'styles': './scss/main.scss'
    -  },
    -  output: {
    -    path: path.dirname(__dirname) + '/assets/static/gen',
    -    filename: '[name].js'
    -  },
    -  devtool: '#cheap-module-source-map',
    -  resolve: {
    -    modules: ['node_modules'],
    -    extensions: ['.js']
    -  },
    -  module: {
    -    rules: [
    -      { test: /\.js$/, exclude: /node_modules/,
    -        loader: 'babel-loader' },
    -      { test: /\.scss$/,
    -        loader: ExtractTextPlugin.extract({
    -          fallback: 'style-loader',
    -          use: 'css-loader!sass-loader' } ) },
    -      { test: /\.css$/,
    -        loader: ExtractTextPlugin.extract({
    -          fallback: 'style-loader',
    -          use: 'css-loader' } ) },
    -      { test: /\.(woff2?|ttf|eot|svg|png|jpe?g|gif)$/,
    -        loader: 'file' }
    -    ]
    -  },
    -  plugins: [
    -    new ExtractTextPlugin({
    -      filename: 'styles.css',
    -      allChunks: true
    -    }),
    -    new webpack.optimize.UglifyJsPlugin()
    -  ]
    -};
    +module.exports = {
    +  entry: {
    +    'app': './js/main.js',
    +    'styles': './scss/main.scss'
    +  },
    +  output: {
    +    path: path.dirname(__dirname) + '/assets/static/gen',
    +    filename: '[name].js'
    +  },
    +  devtool: '#cheap-module-source-map',
    +  resolve: {
    +    modules: ['node_modules'],
    +    extensions: ['.js']
    +  },
    +  module: {
    +    rules: [
    +      { test: /\.js$/, exclude: /node_modules/,
    +        loader: 'babel-loader' },
    +      { test: /\.scss$/,
    +        loader: ExtractTextPlugin.extract({
    +          fallback: 'style-loader',
    +          use: 'css-loader!sass-loader' } ) },
    +      { test: /\.css$/,
    +        loader: ExtractTextPlugin.extract({
    +          fallback: 'style-loader',
    +          use: 'css-loader' } ) },
    +      { test: /\.(woff2?|ttf|eot|svg|png|jpe?g|gif)$/,
    +        loader: 'file' }
    +    ]
    +  },
    +  plugins: [
    +    new ExtractTextPlugin({
    +      filename: 'styles.css',
    +      allChunks: true
    +    }),
    +    new webpack.optimize.UglifyJsPlugin()
    +  ]
    +};
     

    Creating the App

    Now we can start building our app. We configured at least two files in webpack: js/main.js and scss/main.scss. Those are the entry diff --git a/index.html b/index.html index 372e399d..116fe3b2 100644 --- a/index.html +++ b/index.html @@ -151,7 +151,7 @@ speak multiple languages and allow you to easily create localized websites.

    -

    parcel/main.js

    A simple Javascript file that imports the SCSS file so that Parcel will know to include it as well.

    -
    import './main.scss';
    +
    import './main.scss';
     

    Running the Server

    Now you're ready to go. When you run lektor server nothing wil happen, diff --git a/plugins/lektor-webpack-html-helper/index.html b/plugins/lektor-webpack-html-helper/index.html index fad0b4f7..8de570b6 100644 --- a/plugins/lektor-webpack-html-helper/index.html +++ b/plugins/lektor-webpack-html-helper/index.html @@ -138,47 +138,47 @@ These files will then be copied over to Lektors templates folder so that they can be used by Lektor. This plugin depends on the lektor-webpack-support plugin to be really useful.

    webpack/webpack.config.js

    -
    const path = require("path");
    -const MiniCssExtractPlugin = require("mini-css-extract-plugin");
    -const HtmlWebpackPlugin = require("html-webpack-plugin");
    -const { CleanWebpackPlugin } = require("clean-webpack-plugin");
    +
    const path = require("path");
    +const MiniCssExtractPlugin = require("mini-css-extract-plugin");
    +const HtmlWebpackPlugin = require("html-webpack-plugin");
    +const { CleanWebpackPlugin } = require("clean-webpack-plugin");
     
     
    -module.exports = {
    -    mode: "production",
    -    entry: {
    -        main: "./src/index.js"
    -    },
    -    output: {
    -        filename: "[name].bundle.js",
    -        path: path.dirname(__dirname) + "/assets/generated" 
    -    },
    -    optimization: {
    -        minimizer: [
    -            new HtmlWebpackPlugin({
    -                inject: false,
    -                filename: "layout_generated.html",
    -                template: "./src/layout_template.html"
    -            })
    -        ],
    -    },
    -    plugins: [
    -        new CleanWebpackPlugin(),
    -        new MiniCssExtractPlugin({
    -            filename: "[name].css"
    -        })
    -    ],
    -    module: {
    -        rules: [{
    -            test: /\.scss$/,
    -            use: [
    -                MiniCssExtractPlugin.loader,
    -                "css-loader",
    -                "sass-loader"
    -            ]
    -        }]
    -    }
    -}
    +module.exports = {
    +    mode: "production",
    +    entry: {
    +        main: "./src/index.js"
    +    },
    +    output: {
    +        filename: "[name].bundle.js",
    +        path: path.dirname(__dirname) + "/assets/generated" 
    +    },
    +    optimization: {
    +        minimizer: [
    +            new HtmlWebpackPlugin({
    +                inject: false,
    +                filename: "layout_generated.html",
    +                template: "./src/layout_template.html"
    +            })
    +        ],
    +    },
    +    plugins: [
    +        new CleanWebpackPlugin(),
    +        new MiniCssExtractPlugin({
    +            filename: "[name].css"
    +        })
    +    ],
    +    module: {
    +        rules: [{
    +            test: /\.scss$/,
    +            use: [
    +                MiniCssExtractPlugin.loader,
    +                "css-loader",
    +                "sass-loader"
    +            ]
    +        }]
    +    }
    +}
     

    webpack/src/layout_template.html

    <!DOCTYPE html>
    diff --git a/plugins/lektor-webpack-support/index.html b/plugins/lektor-webpack-support/index.html
    index f36c12af..54e9ede1 100644
    --- a/plugins/lektor-webpack-support/index.html
    +++ b/plugins/lektor-webpack-support/index.html
    @@ -182,43 +182,43 @@ setup that's good enough to cover most things you will encounter. The
     idea is to build the files from webpack/scss and webpack/js into
     assets/static/gen so that we can use it even if we do not have webpack
     installed for as long as someone else ran it before.

    -
    const path = require("path");
    -const MiniCssExtractPlugin = require("mini-css-extract-plugin");
    +
    const path = require("path");
    +const MiniCssExtractPlugin = require("mini-css-extract-plugin");
     
    -module.exports = = {
    -  entry: {
    -    app: "./js/main.js",
    -    styles: "./scss/main.scss",
    -  },
    -  output: {
    -    path: path.join(path.dirname(__dirname), "assets", "static", "gen"),
    -    filename: "[name].js",
    -  },
    -  devtool: "source-map",
    -  mode: "production",
    -  module: {
    -    rules: [
    -      {
    -        test: /\.js$/,
    -        exclude: /node_modules/,
    -        use: ["babel-loader"],
    -      },
    -      {
    -        test: /\.scss$/,
    -        use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
    -      },
    -      {
    -        test: /\.css$/,
    -        use: [MiniCssExtractPlugin.loader, "css-loader"],
    -      },
    -      {
    -        test: /\.(woff2?|ttf|eot|svg|png|jpe?g|gif)$/,
    -        use: ["file"],
    -      },
    -    ],
    -  },
    -  plugins: [new MiniCssExtractPlugin({ filename: "styles.css" })],
    -};
    +module.exports = = {
    +  entry: {
    +    app: "./js/main.js",
    +    styles: "./scss/main.scss",
    +  },
    +  output: {
    +    path: path.join(path.dirname(__dirname), "assets", "static", "gen"),
    +    filename: "[name].js",
    +  },
    +  devtool: "source-map",
    +  mode: "production",
    +  module: {
    +    rules: [
    +      {
    +        test: /\.js$/,
    +        exclude: /node_modules/,
    +        use: ["babel-loader"],
    +      },
    +      {
    +        test: /\.scss$/,
    +        use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
    +      },
    +      {
    +        test: /\.css$/,
    +        use: [MiniCssExtractPlugin.loader, "css-loader"],
    +      },
    +      {
    +        test: /\.(woff2?|ttf|eot|svg|png|jpe?g|gif)$/,
    +        use: ["file"],
    +      },
    +    ],
    +  },
    +  plugins: [new MiniCssExtractPlugin({ filename: "styles.css" })],
    +};
     

    Creating the App

    Now we can start building our app. We configured at least two files