This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ../source/index.html.erb --> | |
--- | |
title: Welcome to Middleman | |
--- | |
<!-- ... --> | |
<%= link_to 'About', "about/index.html" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ../souce/about/index.html.erb --> | |
--- | |
title: About | |
--- | |
<h1> | |
Hi there! | |
</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config.rb | |
#... | |
# Build-specific configuration | |
# https://middlemanapp.com/advanced/configuration/#environment-specific-settings | |
configure :build do | |
# Generate relative paths to the repo when deploying to GitHub Pages | |
config[:http_prefix] = '/middleman-webpack-demo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ./github/workflows/deploy.yml | |
name: Deploy Middleman to GH Pages | |
on: | |
push: | |
branches: [master] | |
jobs: | |
build: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Activate and configure extensions | |
# ... | |
# Livereload | |
activate :livereload, host: '0.0.0.0', port: '1234' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker-compose.yml | |
version: '3.7' | |
services: | |
web: | |
build: . | |
command: bundle exec middleman server | |
volumes: | |
- '.:/app' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dockerfile | |
FROM ruby:2.6.3 | |
WORKDIR /app | |
RUN curl -sL https://deb.nodesource.com/setup_13.x -o nodesource_setup.sh && \ | |
bash nodesource_setup.sh && \ | |
apt install nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
... | |
<%= stylesheet_link_tag "style" %> | |
<%= javascript_include_tag "site.min" %> | |
</head> | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Webpack | |
activate :external_pipeline, | |
name: :webpack, | |
command: build? ? | |
"./node_modules/webpack/bin/webpack.js --bail -p" : | |
"./node_modules/webpack/bin/webpack.js --watch -d --progress --color", | |
source: ".tmp/dist", | |
latency: 1 | |
# Dev environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to a webpack.config.js file | |
const path = require('path'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
module.exports = { | |
mode: 'development', | |
entry: { | |
site: ['./source/javascripts/site.js'], | |
style: ['./source/stylesheets/site.css.scss'], | |
}, |
NewerOlder