mirror of
https://github.com/maxboeck/webring
synced 2025-02-17 02:08:23 +00:00
basic eleventy setup
This commit is contained in:
parent
095a4cfd74
commit
7b3d56d9f0
11 changed files with 60 additions and 32 deletions
|
@ -6,6 +6,8 @@ module.exports = function(config) {
|
||||||
|
|
||||||
config.addLayoutAlias('base', 'base.njk')
|
config.addLayoutAlias('base', 'base.njk')
|
||||||
|
|
||||||
|
config.addPassthroughCopy('src/assets/images')
|
||||||
|
|
||||||
config.addTransform('htmlmin', function(content, outputPath) {
|
config.addTransform('htmlmin', function(content, outputPath) {
|
||||||
if (outputPath.endsWith('.html')) {
|
if (outputPath.endsWith('.html')) {
|
||||||
return htmlMinifier.minify(content, {
|
return htmlMinifier.minify(content, {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import meta from '../src/data/meta'
|
import meta from '../../src/data/meta'
|
||||||
import members from '../src/data/members'
|
import members from '../../src/data/members'
|
||||||
|
|
||||||
export const redirect = site => {
|
export const redirect = site => {
|
||||||
const location = site && site.url ? site.url : meta.url
|
const location = site && site.url ? site.url : meta.url
|
|
@ -1,7 +1,7 @@
|
||||||
const gulp = require('gulp')
|
const gulp = require('gulp')
|
||||||
const sass = require('gulp-sass')
|
const sass = require('gulp-sass')
|
||||||
|
|
||||||
gulp.task('css', function() {
|
gulp.task('styles', function() {
|
||||||
return gulp
|
return gulp
|
||||||
.src('./src/assets/styles/*.scss')
|
.src('./src/assets/styles/*.scss')
|
||||||
.pipe(
|
.pipe(
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "webring",
|
"name": "webring",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "A boilerplate for hosting a webring on github/netlify",
|
"description": "A boilerplate for hosting a webring community",
|
||||||
"author": "Max Böck",
|
"author": "Max Böck",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -9,10 +9,10 @@
|
||||||
"url": "http://github.com/maxboeck/webring"
|
"url": "http://github.com/maxboeck/webring"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "gulp build && eleventy serve",
|
"start": "gulp build && eleventy --serve && yarn run serve:lambda",
|
||||||
"build": "gulp build && yarn run build:lambda",
|
"build": "gulp build && yarn run build:lambda",
|
||||||
"serve:lambda": "netlify-lambda serve lambda",
|
"serve:lambda": "netlify-lambda serve _lambda",
|
||||||
"build:lambda": "netlify-lambda build lambda"
|
"build:lambda": "netlify-lambda build _lambda"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@11ty/eleventy": "^0.8.2",
|
"@11ty/eleventy": "^0.8.2",
|
||||||
|
|
4
src/assets/styles/main.scss
Normal file
4
src/assets/styles/main.scss
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
layout: base
|
||||||
|
---
|
||||||
|
<h1>{{ meta.title }}</h1>
|
18
src/layouts/base.njk
Normal file
18
src/layouts/base.njk
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
|
||||||
|
<title>{{ meta.title }}</title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="{{ '/assets/styles/main.css' | url }}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{{ content | safe }}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue