Skip to content
Snippets Groups Projects
Commit 0db9b4f2 authored by Lars Bilke's avatar Lars Bilke
Browse files

[web] Tailwind configured.

parent 8d1ab16d
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ node_modules/
.bundle/
bin/
public/
dist/
themes/ogs/static
import/secret.py
static/
......
......@@ -6,6 +6,7 @@ buildDrafts = true
pygmentsstyle = 'friendly'
enableGitInfo = true
canonifyURLs = true
staticDir = ["dist", "static"]
[params]
alert = "Documentation site under construction; more docs can be found at <a href='https://docs.opengeosys.org'>docs.opengeosys.org</a>."
......
// load all plugins in 'devDependencies' into the variable $
var gulp = require('gulp');
const $ = require('gulp-load-plugins')({
rename: {
'gulp-add-src': 'add_src',
'merge-stream': 'merge_stream',
'gulp-clean-css': 'clean_css',
'gulp-uglifycss': 'uglifycss'
},
pattern: ['*'],
scope: ['devDependencies']
});
// package vars
const pkg = require('./package.json');
// scss - build the scss to the build folder, including the required paths, and writing out a sourcemap
gulp.task('scss', () => {
$.fancyLog("-> Compiling scss: " + pkg.paths.dist.css + pkg.vars.scssName);
sassStream = gulp.src(pkg.paths.src.scss + pkg.vars.scssName)
// .pipe($.plumber({ errorHandler: onError }))
// .pipe($.sourcemaps.init())
.pipe($.sass({
includePaths: [
pkg.paths.scss,
"./node_modules"
]
})
.on('error', $.sass.logError))
.pipe($.cached('sass_compile'))
.pipe($.autoprefixer())
// .pipe($.sourcemaps.write('./'))
.pipe($.size({ showFiles: true }));
cssStream = gulp.src(pkg.globs.distCss);
return $.merge_stream(sassStream, cssStream)
.pipe($.concat(pkg.vars.cssName))
.pipe($.clean_css({compatibility: 'ie8', level: 1}))
.pipe($.size({title: 'Cleaned', showFiles: true}))
.pipe(gulp.dest(pkg.paths.dist.css));
});
gulp.task('watch', function() {
gulp.watch(pkg.paths.src.scss + pkg.vars.scssName, ['scss']);
gulp.watch('./package.json', ['scss']);
});
gulp.task('clean', function() {
return $.del([
'static',
'public',
'content/internal/news.md',
'data/news.json'
]);
});
gulp.task('clean-all', function() {
return $.del([
'static',
'public',
'node_modules',
'content/internal/news.md',
'data/news.json'
]);
});
gulp.task('build', ['scss'])
gulp.task('default', ['scss', 'watch'])
import styles from './src/styles.css'
......@@ -7,7 +7,7 @@
<meta name="description" content="OpenGeoSys">
<meta name="author" content="OpenGeoSys Community">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/styles.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/x-mathjax-config">
......@@ -25,17 +25,17 @@
</head>
<body>
<div class="container">
<nav>
<a href="/" class="black b">benchmarks.opengeosys.org</a>
<div class="container mx-auto">
<nav class="flex">
<a href="/" class="m-2 no-underline">{{ .Site.Title }}</a>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<a href="{{ .URL }}" {{if $currentPage.IsMenuCurrent "main" . }} class="active"{{end}}>{{ .Name }}</a>
<a href="{{ .URL }}" {{if $currentPage.IsMenuCurrent "main" . }}class="active"{{end}} class="m-2">{{ .Name }}</a>
{{ end }}
</nav>
{{ if .Site.Params.alert }}
<div class="f6 flex items-center justify-center pa2 bg-lightest-blue navy">
<i class="fas fa-exclamation-triangle"></i>
<div class="text-sm flex justify-center p-2 bg-blue-lightest text-blue-darker rounded">
<i class="fas fa-exclamation-triangle"></i>&nbsp;
<span class="lh-title ml3">{{ .Site.Params.alert | safeHTML }}</span>
</div>
{{ end }}
......
{
"name": "opengeosys.org",
"version": "0.0.1",
"main": "src/js/app.js",
"repository": "https://github.com/ufz/ogs",
"author": "Lars Bilke",
"license": "BSD-4-Clause",
"scripts": {
"clean": "gulp clean",
"gulp": "gulp",
"hugo": "hugo server --disableKinds=RSS",
"build": "webpack && gulp build && hugo",
"build:release": "webpack --env=production && gulp build && hugo",
"import": "cd import && python import.py",
"convert": "vtkDataConverter",
"webpack": "webpack",
"webpack-watch": "webpack --watch",
"webpack-production": "webpack --env=production"
},
"paths": {
"src": {
"base": "./src/",
"css": "./src/css/",
"fontello": "./src/fontello/",
"fonts": "./src/fonts/",
"json": "./src/json/",
"js": "./src/js/",
"img": "./src/img/",
"scss": "./src/scss/"
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=webpack.config.js",
"prod": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=webpack.config.js"
},
"dist": {
"base": "./static/",
"css": "./static/css/",
"js": "./static/js/",
"fonts": "./static/fonts/",
"img": "./static/img/"
},
"build": {
"base": "./build/",
"css": "./build/css/",
"fontello": "./build/fonts/fontello/",
"fonts": "./build/fonts/",
"js": "./build/js/",
"html": "./build/html/",
"img": "./build/img/"
},
"favicon": {
"src": "./src/img/favicon_src.png",
"dest": "./themes/ogs/static/img/site/",
"path": "/img/site/"
},
"scss": [],
"templates": "./craft/templates/"
},
"urls": {
"live": "https://opengeosys.org/",
"local": "https://opengeosys.dev/",
"critical": "https://opengeosys.org/"
},
"vars": {
"siteCssName": "site.combined.min.css",
"scssName": "main.scss",
"cssName": "main.css"
},
"globs": {
"distCss": [
"./node_modules/normalize.css/normalize.css",
"./node_modules/flexboxgrid/dist/flexboxgrid.min.css",
"./src/css/pandoc-highlighting.css"
],
"img": [
"./public/img/"
],
"components": [
"./src/components/**/*.vue"
],
"fonts": [
"./build/fonts/fontello/font/*.{eot,ttf,woff,woff2}",
"./src/fonts/*.{eot,ttf,woff,woff2}"
],
"critical": [
{
"url": "",
"template": "index"
},
{
"url": "blog/stop-using-htaccess-files-no-really",
"template": "blog/_entry"
},
{
"url": "blog/stop-using-htaccess-files-no-really",
"template": "blog/_amp_entry"
},
{
"url": "blog",
"template": "blog/index"
},
{
"url": "blog",
"template": "blog/amp_index"
},
{
"url": "wordpress",
"template": "wordpress"
},
{
"url": "404",
"template": "404"
}
],
"distJs": [
"./build/js/*.js",
"./node_modules/lazysizes/lazysizes.min.js",
"./node_modules/lazysizes/plugins/bgset/ls.bgset.min.js",
"./node_modules/picturefill/dist/picturefill.min.js",
"./node_modules/vue/dist/vue.min.js",
"./node_modules/vue-resource/dist/vue-resource.min.js"
],
"prismJs": [
"./node_modules/prismjs/prism.js",
"./node_modules/prismjs/components/prism-markup.js",
"./node_modules/prismjs/components/prism-apacheconf.js",
"./node_modules/prismjs/components/prism-css.js",
"./node_modules/prismjs/components/prism-json.js",
"./node_modules/prismjs/components/prism-twig.js",
"./node_modules/prismjs/components/prism-php.js",
"./node_modules/prismjs/components/prism-bash.js",
"./node_modules/prismjs/components/prism-javascript.js",
"./node_modules/prismjs/plugins/line-numbers/prism-line-numbers.min.js"
],
"systemJs": [
"./node_modules/systemjs/dist/system-polyfills.js",
"./node_modules/systemjs/dist/system.js",
"./src/js/system-config.js"
],
"babelJs": [
"./src/js/*.js"
],
"inlineJs": [
"./node_modules/fg-loadcss/src/loadCSS.js",
"./node_modules/fg-loadcss/src/cssrelpreload.js",
"./node_modules/fontfaceobserver/fontfaceobserver.js",
"./src/js/asyncload-blog-fonts.js",
"./src/js/asyncload-site-fonts.js"
],
"siteIcon": "./public/img/site/favicon.*"
},
"devDependencies": {
"babel-loader": "^7.1.2",
"del": "^3.0.0",
"fancy-log": "^1.3.0",
"flexboxgrid": "^6.3.1",
"gulp": "^3.9.1",
"gulp-add-src": "^0.2.0",
"gulp-autoprefixer": "^4.0.0",
"gulp-cached": "^1.1.1",
"gulp-clean-css": "^3.0.3",
"gulp-concat": "^2.6.1",
"gulp-load-plugins": "^1.4.0",
"gulp-plumber": "^1.1.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-size": "^2.1.0",
"kw-web-suite": "^3.1.1",
"merge-stream": "^1.0.1",
"node-sass": "^4.7.2",
"normalize.css": "^7.0.0",
"pygments-css": "^1.0.0",
"string-replace-loader": "^1.3.0",
"tachyons-sass": "^4.7.1",
"vtk.js": "^4.0.0",
"webpack": "^3.6.0",
"webpack-merge": "^4.1.0"
}
"devDependencies": {
"cross-env": "^5.1",
"css-loader": "^0.28.7",
"extract-text-webpack-plugin": "^3.0.2",
"fsevents": "^1.1.3",
"postcss": "^6.0.14",
"postcss-loader": "^2.0.8",
"style-loader": "^0.19.0",
"tailwindcss": "^0.4.0",
"webpack": "^3.8.1"
}
}
module.exports = {
plugins: [
require('tailwindcss')('./tailwind.js')
]
}
@tailwind preflight;
@tailwind utilities;
This diff is collapsed.
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const parts = require('./webpack.parts');
const pkg = require('./package.json');
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const path = require('path')
const commonConfig = merge([
{
entry: {
app: pkg.paths.src.js + 'app.js', // PATHS.app,
},
output: {
path: __dirname + "/" + pkg.paths.dist.js,
filename: 'bundle.js'
},
module: {
rules: [
{
test: require.resolve("./src/js/app.js"),
loader: "expose-loader?MyWebApp"
}
].concat(module.exports = parts.loaders()),
},
resolve: {
extensions: ['.webpack-loader.js', '.web-loader.js', '.loader.js', '.js', '.jsx'],
modules: [
path.resolve(__dirname, 'node_modules')
],
module.exports = {
entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'styles.css',
},
// postcss: [
// require('autoprefixer')({ browsers: ['last 2 versions'] }),
// ],
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{ loader: 'css-loader', options: { importLoaders: 1 } },
'postcss-loader'
]
})
}
]
},
// parts.lintJavaScript({ include: pkg.paths.src.js + '/app.js' }),
]);
const productionConfig = merge([
parts.productionEnv(),
parts.minifyJavaScript({ useSourceMap: true })
]);
const developmentConfig = merge([
{
// plugins: [
// new webpack.NamedModulesPlugin(),
// ],
}
]);
module.exports = function(env) {
if (env === 'production') {
return merge(commonConfig, productionConfig);
}
return merge(commonConfig, developmentConfig);
};
plugins: [
new ExtractTextPlugin('styles.css')
]
}
const webpack = require('webpack');
exports.minifyJavaScript = function() {
return {
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
}),
],
};
};
exports.productionEnv = function() {
return {
plugins: [
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production"),
},
})
]
}
}
exports.loaders = function() {
var replaceConfig = JSON.stringify({
multiple: [
{ search: 'test.onlyIfWebGL', replace: process.env.TRAVIS ? 'test.skip' : 'test', flags: 'g' },
],
});
return [
{
test: /\.svg$/,
loader: 'svg-sprite',
exclude: /fonts/,
}, {
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=60000&mimetype=application/font-woff',
}, {
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=60000',
include: /fonts/,
}, {
test: /\.(png|jpg)$/,
exclude: /test[^\.]*\.(png|jpg)$/,
loader: 'url-loader?limit=8192',
}, {
test: /test[^\.]*\.(png|jpg)$/,
loader: 'url-loader?limit=1048576',
}, {
test: /\.css$/,
loader: 'style-loader!css-loader!postcss-loader',
}, {
test: /\.mcss$/,
loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]_[local]_[hash:base64:5]!postcss-loader',
}, {
test: /\.c$/i,
loader: 'shader-loader',
}, {
test: /\.glsl$/i,
loader: 'shader-loader',
}, {
test: /\.json$/,
loader: 'json-loader',
}, {
test: /\.cjson$/,
loader: 'json-loader',
}, {
test: /\.html$/,
loader: 'html-loader',
}, {
test: /\.js$/,
include: /node_modules(\/|\\)vtk\.js(\/|\\)/,
loader: `babel-loader?presets[]=es2015,presets[]=react!string-replace-loader?${replaceConfig}`,
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: `babel-loader?presets[]=es2015,presets[]=react!string-replace-loader?${replaceConfig}`,
}];
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment