-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add blog post about Symfony Webpack Encore. #7
Open
bellisk
wants to merge
1
commit into
sculpin:master
Choose a base branch
from
bellisk:webpack-encore-blog-post
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
source/_posts/2019-03-23-using-symfony-webpack-encore-with-sculpin.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: "Using Symfony Webpack Encore with Sculpin" | ||
author: | ||
shortname: Rae | ||
name: Rae Knowler | ||
twitter: RaeKnowler | ||
--- | ||
|
||
The [Sculpin Blog Skeleton](https://github.com/sculpin/sculpin-blog-skeleton) is a template for creating a blog with Sculpin. It's used in the [Get | ||
Started](https://sculpin.io/getstarted/) tutorial on sculpin.io, making it an important part of the Sculpin experience for many users. Until recently, | ||
the Blog Skeleton handled JavaScript assets by installing components via Composer. It's now been updated to use Symfony's | ||
[Webpack Encore](https://symfony.com/doc/current/frontend.html) library instead. | ||
|
||
Three of us at [Liip](https://www.liip.ch/en), [Christian Riesen](https://twitter.com/christianriesen), [David Buchmann](https://twitter.com/dbu) and | ||
I, had a hackday to work on Sculpin. [Kevin Boyd](https://twitter.com/beryllium9) offered us some suggestions of where to start, one of which was the | ||
move to Webpack: a more modern way of handling JS and CSS assets. | ||
|
||
Of course, you *can* make a website without any JS at all, but even a simple website needs some styling to look nice. The Blog Skeleton, which isn't | ||
meant to look fancy, uses jQuery, Bootstrap and HighlightJS as well as a little custom CSS. With more dependencies, keeping everything organised can | ||
get difficult. Encore takes all your CSS and JS files, as well as their dependencies, and bundles them up into one of each that you can link | ||
to in your HTML (or Twig) templates. | ||
|
||
It was simple to install Encore and configure it to work with Sculpin's file structure. Now, anyone building their blog using the Blog Skeleton as a | ||
base can add their own JS and CSS in the default files, add require statements for any external libraries they want to use, and run Encore. The | ||
links in the base Twig template won't change, but the new code will all be included. | ||
|
||
We also spent some time cleaning up the Sculpin documentation in several places: | ||
|
||
- The Sculpin Blog Skeleton README is now as small as possible, only what's needed to get the app up and running. | ||
- The [Basic Project](https://sculpin.io/documentation/basic-project/) page on sculpin.io had a lot of information removed that duplicated the Get | ||
Started tutorial. Now it explains the basic concepts of Sculpin more clearly. | ||
- Documentation for using Webpack Encore with Sculpin has been added in the Basic Project page as well. | ||
|
||
These changes will make it easier to get started using Sculpin to build a modern static website. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "simple" can be deterring for people trying to do this and not figuring out how to do it (see "belitteling language"). maybe instead say "You can see the changes that where necessary to install Encore and configure it to work with Sculpin's file structure in this blogpost." - that would also help people who want to do this themselves.