ducksoupdev / gulp-site-generator Goto Github PK
View Code? Open in Web Editor NEWA static site generator using Gulp
A static site generator using Gulp
Re: the images minification and running gulp develop (the live-reload task), this takes a while to complete (couple of minutes in my case), I guess depending on the size and amount of your images.
Wonder if it would be more efficient to have a separate task for image minification that only optimises images for production. What do you think?
When i try to add new propety in site.json file, i am not able to reach it in handlebars template.
After installing and running gulp
for the first time, I get the following error:
TypeError: require.extensions.hasOwnProperty is not a function
at requireDir (/Users/alexrodriguez/Sites/_practice/qwe/node_modules/require-dir/index.js:97:37)
I updated the require-dir
npm package to "require-dir": "^0.3.2"
and everything worked perfectly. (I am running node version v8.1.3).
Test with Node 8.x and uplift dependencies if required. See #33
hi.
root@AR:/usr/local/gulp-site-generator# gulp
[10:31:48] Using gulpfile /usr/local/gulp-site-generator/gulpfile.js
[10:31:48] Starting 'sass'...
[10:31:48] Starting 'copy-fonts'...
[10:31:48] Starting 'copy-css'...
[10:31:48] Starting 'concat-js'...
[10:31:48] Starting 'image-min'...
[10:31:48] Finished 'copy-fonts' after 43 ms
[10:31:48] Finished 'copy-css' after 43 ms
[10:31:48] Finished 'concat-js' after 45 ms
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn /usr/local/gulp-site-generator/node_modules/mozjpeg/vendor/cjpeg ENOENT
at exports._errnoException (util.js:855:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:455:9)
at process._tickCallback (node.js:369:17)
root@AR:/usr/local/gulp-site-generator#
sass to css conversion works fine, but running uncss results in an empty css file. There are a lot of CSS classifiers which are used in my HTML files, so these should remain in the final css file.
Hi duck,
gsg is super cool and thank you, I have some issues regarding js. I have added some js files to my site, which add some animations and functionality to my site. while adding js files they should be follow an order, to get right functionality but in the site generator the concat js task mix all the js files in alphabetic order and js related functionality is not working.
I tried using gulp-useref but I didn't found a solution. can you please help for this issue.
The generator allows us to write classes in scss but I haven't figured out how to add the classes from the content I write in markdown.
Hi, I tried to add watch, server, and livereload tasks in default task.
However, it does not work well.
Could you tell me the way?
Can you add feature or maybe as a fallback if post slug are undefined then it takes post title and convert it to valid slug?
title: This is Title
Will be like this before compiled:
title: This is Title
slug: this-is-title
$ node tools/install
This didn't run for me. :/
Testing this system out on Windows 7 Pro 64bit using Node 6.0.0.
For whatever reason, the default {{resolve }}
helper in gulp-site-generator
is taking the default markup contents and prefixing their href
contents with ./
...
<!-- resulting markup -->
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=utf-8>
<meta http-equiv=X-UA-Compatible content="IE=edge">
<meta name=viewport content="width=device-width, initial-scale=1">
<meta name=description>
<meta name=author>
<link rel=icon href=./favicon.ico>
<title>
</title>
<link rel=stylesheet type=text/css href=./css/style.min.css>
<meta name=generator content="Gulp 3.9.1">
<link rel=alternate type=application/rss+xml href=./rss.xml>
</head>
<body>
These ./
prefixes cause Chrome to interpret these links in wierd ways, where each subsequent click appends the links href
value to the end of the current page URL and redirects to that now non-existent route.
Did a cursory look into the resolve
helper, and its implementation makes little sense to me... it seems this resolvePaths
handler defined through the tools/
files is using some seriously inconceivable routes (eg: url: "../../../..",
...) when it would be prudent to use something like process.cwd()
to construct a relative directory reference.
Is there anyway to do this? I'm building a SEO friendly apps store with this generator, I need thumbnails and possibly other images to be passed into the handlebars each loop
Maybe if we could set dynamic attributes?
I followed the install instructions and encountered problems with the initial gulp
task. I guess pagination.hbs
is missing in the array of files in install.js?
Is there a way of implementing a "Related Posts functionality" ? Or can it be achieved in some other manner?
Hello,
I am converting a static site with a custom gulpfile.js
to your gulp-site-generator
setup. I used the subrepo approach. After adding all the dependencies to my package.json
, I got this as result on first build:
> gulp
[14:40:58] Using gulpfile /pipeline/source/gulpfile.js
[14:40:58] Starting 'sass'...
[14:40:58] Starting 'copy-fonts'...
[14:40:58] Starting 'copy-css'...
[14:40:58] Starting 'concat-js'...
[14:40:58] Starting 'image-min'...
[14:40:58] 'image-min' errored after 4.26 ms
[14:40:58] TypeError: dest.on is not a function
at DestroyableTransform.Readable.pipe (/pipeline/source/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:516:8)
at Gulp.<anonymous> (/pipeline/source/tools/gulp/tasks/image-min.js:16:14)
at module.exports (/pipeline/source/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/pipeline/source/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/pipeline/source/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/pipeline/source/node_modules/orchestrator/index.js:134:8)
at /pipeline/source/node_modules/gulp/bin/gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:592:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
(node:104) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Expected a buffer
[14:40:58] Finished 'copy-fonts' after 29 ms
[14:40:58] Finished 'copy-css' after 29 ms
[14:40:58] Finished 'concat-js' after 27 ms
[14:40:58] Finished 'sass' after 91 ms
Here is my package.json
:
{
"name": "rq-website",
"version": "2016.08.03",
"description": "ReleaseQueue Product Website",
"main": "index.js",
"author": "Ringo De Smet",
"license": "Commercial",
"repository": {
"type": "git",
"url": "[email protected]:releasequeue/rq-website.git"
},
"homepage": "https://bitbucket.com/releasequeue/rq-website",
"devDependencies": {
"bluebird": "^3.4.6",
"downsize": "0.0.8",
"gulp": "^3.9.1",
"gulp-compile-handlebars": "^0.6.1",
"gulp-concat": "^2.6.0",
"gulp-connect": "^5.0.0",
"gulp-markdown-to-json": "^1.0.1",
"gulp-minify-css": "^1.2.4",
"gulp-minify-html": "^1.0.6",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-sass": "^2.3.2",
"gulp-uglify": "^2.0.0",
"gulp-uncss": "^1.0.6",
"imagemin-mozjpeg": "^6.0.0",
"imagemin-optipng": "^5.2.1",
"imagemin-pngquant": "^5.0.0",
"moment": "^2.15.1",
"mout": "^1.0.0",
"node-inspector": "^0.12.8",
"require-dir": "^0.3.0",
"rss": "^1.2.1"
},
"scripts": {
"help": "gulp --tasks",
"clean": "gulp clean",
"build": "gulp"
}
}
Anything wrong on my side?
Ringo
To avoid repeating frequently used front matter variables for each piece of content, just define defaults for them and only override them where necessary (or not at all).
Also add the ability to use pure markdown (without front-matter) when defaults exist
When using a CDN, asset revisioning is important.
Please support asset revisioning for:
Shouldn't the code allow for passing a markdown parser to the gulp plugin? The documentation states clearly that you still have to add your own parser:
https://github.com/sparkartgroup/gulp-markdown-to-json#dependencies
The current state of the code doesn't pass anything:
gulp-site-generator/gulp/tasks/content.js
Line 10 in be58dcd
Currently, I get this error:
> gulp
[15:46:57] Using gulpfile /pipeline/source/gulpfile.js
[15:46:57] Starting 'sass'...
[15:46:57] Starting 'copy-fonts'...
[15:46:57] Starting 'copy-css'...
[15:46:57] Starting 'concat-js'...
[15:46:57] Starting 'image-min'...
[15:46:57] Finished 'copy-fonts' after 35 ms
[15:46:57] Finished 'concat-js' after 30 ms
[15:46:57] Finished 'copy-css' after 55 ms
[15:46:57] Finished 'sass' after 98 ms
[15:46:57] Finished 'image-min' after 142 ms
[15:46:57] Starting 'copy-assets'...
[15:46:57] Finished 'copy-assets' after 4 ms
[15:46:57] Starting 'content'...
/pipeline/source/node_modules/gulp-markdown-to-json/lib/plugin.js:45
if (!config.renderer || typeof config.renderer !== 'function') return callback(pluginError('Markdown renderer function required'));
^
TypeError: Cannot read property 'renderer' of undefined
at DestroyableTransform._transform (/pipeline/source/node_modules/gulp-markdown-to-json/lib/plugin.js:45:16)
at DestroyableTransform.Transform._read (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
at DestroyableTransform.Transform._write (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)
at doWrite (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64)
at writeOrBuffer (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5)
at DestroyableTransform.Writable.write (/pipeline/source/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:241:11)
at Transform.ondata (/pipeline/source/node_modules/readable-stream/lib/_stream_readable.js:542:20)
at emitOne (events.js:96:13)
at Transform.emit (events.js:188:7)
at readableAddChunk (/pipeline/source/node_modules/readable-stream/lib/_stream_readable.js:213:18)
at Transform.Readable.push (/pipeline/source/node_modules/readable-stream/lib/_stream_readable.js:172:10)
at Transform.push (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:123:32)
at afterTransform (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:79:51)
at TransformState.afterTransform (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:58:12)
at doReplace (/pipeline/source/node_modules/gulp-replace/index.js:52:18)
at Transform.transform [as _transform] (/pipeline/source/node_modules/gulp-replace/index.js:74:7)
at Transform._read (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:159:10)
at Transform._write (/pipeline/source/node_modules/readable-stream/lib/_stream_transform.js:147:83)
at doWrite (/pipeline/source/node_modules/readable-stream/lib/_stream_writable.js:319:64)
at writeOrBuffer (/pipeline/source/node_modules/readable-stream/lib/_stream_writable.js:308:5)
at Transform.Writable.write (/pipeline/source/node_modules/readable-stream/lib/_stream_writable.js:246:11)
at write (/pipeline/source/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:623:24)
I followed the installation steps described in the README but the gulp commands do not work.
First after installation node tools/install
it gave an error saying that the module "browser-sync" was not found but was solved by installing the packages of the tools folder (this was not described in the README).
But now none of the "build", "develop", "update" commands are working:
I don't know if you have the time or interest in fixing this error but would like to use your project because it was the simplest and most complete I found.
The pagination doesn't work with the installed templates. MaxItems is available as a config setting but isn't implemented.
It would be nice to have subpages.
Hi,
I think it should put browser-sync
as devDependencies
while generating package.json
in root directory!
And also, It would be better if it compare and then merge existing package.json
(if any) while generating the new one.
What you think?
Thanks for this helpful tool anyway ...
LiveReload didn't seem to be working properly for me when running the develop task, so I replaced it with browsersync and it's working much better. If I get time to do it right I can submit a PR if you approve.
Create new task gulp editor
that runs in develop mode whilst providing a markdown editor for easy editing and previewing of posts and pages. A tree view of content to edit is available as well as being able to create new content.
Hi,
I want to use vendor UI kits (such as bootstrap
for example). So, How can I concatenate those libs' css files into main style.css
like concatJs
option?
P.S. I know I can use import
command in less files for this!
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.