Skip to content

Commit

Permalink
Merge pull request #4 from jinjie/develop
Browse files Browse the repository at this point in the history
Version 2
  • Loading branch information
jinjie authored Mar 22, 2021
2 parents 9a82a59 + 0abedbb commit 3336d67
Show file tree
Hide file tree
Showing 13 changed files with 292 additions and 23 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
export PATH := bin:$(PATH)

staging:
ifeq (, $(wildcard composer-stable.phar))
curl -O https://getcomposer.org/composer-stable.phar
chmod a+x composer-stable.phar
ifeq (, $(wildcard composer.phar))
curl -O https://getcomposer.org/download/1.10.20/composer.phar
chmod a+x composer.phar
endif

git fetch
git checkout develop
git pull
yarn install
./composer-stable.phar install
./composer.phar install
./node_modules/gulp/bin/gulp.js
rm -rf silverstripe-cache/
mkdir silverstripe-cache/
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ yarn
vendor/bin/sake dev/build
```

## Silverstripe Elemental

When building for the first time, run `DNADesign-Elemental-Tasks-MigrateContentToElement` task to migrate content to
Elemental



## Start developing

1. Edit [gulpfile.js](gulpfile.js) and change the address of the website
Expand Down
4 changes: 4 additions & 0 deletions app/_config/mysite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ SilverStripe\SiteConfig\SiteConfig:
extensions:
- SwiftDevLabs\Extensions\SiteConfigExtension

Page:
extensions:
- DNADesign\Elemental\Extensions\ElementalPageExtension

---
Name: my-project-assetsflysystem
After: '#assetsflysystem'
Expand Down
Empty file added app/src/Elements/.gitkeep
Empty file.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"fractas/googleanalytics": "^3.0",
"symbiote/silverstripe-gridfieldextensions": "^3.2",
"silverstripe/login-forms": "^4.2",
"jinjie/silverstripe-admin-material-icons": "^0.0.1"
"jinjie/silverstripe-admin-material-icons": "^0.0.1",
"dnadesign/silverstripe-elemental": "^4",
"jinjie/slickhero-elemental": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
Expand Down
158 changes: 157 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 36 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,29 @@ var

browserify = require('gulp-browserify'),

browserSync = require('browser-sync').create();
browserSync = require('browser-sync').create(),

notifier = require('node-notifier')
;

gulp.task('sass', function(cb) {
gulp.src(THEME_DIR + '/client/src/sass/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'compressed',
includePaths: [
// to import other sass something like
// @import "bootstrap/scss/bootstrap.scss";
'./node_modules'
]
})
.on('error', sass.logError))
.pipe(
sass({
outputStyle: 'compressed',
includePaths: [
// to import other sass something like
// @import "bootstrap/scss/bootstrap.scss";
'./node_modules'
]
}).on('error', function(err) {
notifier.notify({
'title': 'SASS Compile Error',
'message': err.message
})
})
)
.pipe(gulp.dest(THEME_DIR + '/client/dist/css'))
.pipe(browserSync.stream());

Expand All @@ -38,14 +46,21 @@ gulp.task('sass', function(cb) {

gulp.task('browserify', function(cb) {
gulp.src(THEME_DIR + '/client/src/js/*.js')
.pipe(browserify())
.pipe(
browserify().on('error', function(err) {
notifier.notify({
'title': 'JS Compile Error',
'message': err.message
})
})
)
.pipe(gulp.dest(THEME_DIR + '/client/dist/js'))
.pipe(browserSync.stream());

cb();
});

gulp.task('watch', function(cb) {
gulp.task('browser-sync', function(cb) {
browserSync.init({
proxy: PROXY_URL,
files: [
Expand All @@ -60,4 +75,12 @@ gulp.task('watch', function(cb) {
cb();
});

gulp.task('default', gulp.series('sass', 'browserify'));
gulp.task('fontawesome', function(cb) {
gulp.src('node_modules/@fortawesome/fontawesome-free/webfonts/**/*')
.pipe(gulp.dest(THEME_DIR + '/client/dist/fontawesome-free/webfonts'));

cb();
});

gulp.task('default', gulp.series('sass', 'fontawesome', 'browserify'));
gulp.task('watch', gulp.series('default', 'browser-sync'));
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"version": "1.0.0",
"description": "SilverStripe 4 Gulp Workflow",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.3",
"bootstrap": "^4",
"browser-sync": "^2.26.7",
"gulp": "^4",
"gulp-browserify": "^0.5.1",
"gulp-sass": "^4",
"gulp-sourcemaps": "^2.6",
"jquery": "3.4.1",
"node-notifier": "^9.0.1",
"popper.js": "^1.16"
}
}
2 changes: 2 additions & 0 deletions themes/app/client/src/sass/includes/variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/**
* Variables
*/

$fa-font-path: "../fontawesome-free/webfonts";
6 changes: 6 additions & 0 deletions themes/app/client/src/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@
@import "includes/tablet";
@import "includes/mobile";

// Fontawesome
@import "@fortawesome/fontawesome-free/scss/fontawesome";
@import "@fortawesome/fontawesome-free/scss/solid";
@import "@fortawesome/fontawesome-free/scss/regular";
@import "@fortawesome/fontawesome-free/scss/brands";

@import "includes/login-form-fix";
1 change: 0 additions & 1 deletion themes/app/templates/Includes/SocialMediaLinks.ss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
</li>
<% end_loop %>
</ul>
<% require css(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css) %>
<% end_if %>
4 changes: 1 addition & 3 deletions themes/app/templates/Layout/Page.ss
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<div class="container my-3">
<div class="row">
<div class="col">
{$Content}

{$Form}
{$ElementalArea}
</div>
</div>
</div>
Loading

0 comments on commit 3336d67

Please sign in to comment.