From 50b7789d88c00edfe1f8f2f7a98c8138e989a91d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 9 Nov 2019 00:52:38 +0000 Subject: [PATCH] Initial commit --- .editorconfig | 17 +++++++++++ .gitignore | 2 ++ LICENSE | 21 +++++++++++++ README.md | 50 +++++++++++++++++++++++++++++++ app/config/sculpin_kernel.yml | 3 ++ app/config/sculpin_site.yml | 2 ++ app/config/sculpin_site_prod.yml | 3 ++ composer.json | 29 ++++++++++++++++++ source/_layouts/app.html.twig | 12 ++++++++ source/_layouts/default.html.twig | 5 ++++ source/index.md | 4 +++ 11 files changed, 148 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 app/config/sculpin_kernel.yml create mode 100644 app/config/sculpin_site.yml create mode 100644 app/config/sculpin_site_prod.yml create mode 100644 composer.json create mode 100644 source/_layouts/app.html.twig create mode 100644 source/_layouts/default.html.twig create mode 100644 source/index.md diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..349cc2b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +# This file is used by editors and IDEs to unify coding standards +# @see http://EditorConfig.org +# @standards PHP: http://www.php-fig.org/psr/psr-2/ +root = true + +# Default configuration (applies to all file types) +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_size = 4 +indent_style = space + +# Markdown customizations +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9507744 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/output_*/ +/vendor/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0e49b90 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Oliver Davies + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4adf53d --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# Sculpin Skeleton + +A minimal, generic skeleton project for the [Sculpin][1] static site generator. + +## Usage + +1. Download the project by running `composer create-project opdavies/sculpin-skeleton --no-interaction --no-progress --prefer-dist my-sculpin-site`. +1. Run `cd my-sculpin-site` to change into the project directory, and `composer watch` to generate and serve the site. +1. Start adding content to `source/index.md`. +1. Add more content, settings, layouts, includes etc as needed. + +## Scripts + +This project includes some custom Composer scripts that you can use rather than running `vendor/bin/sculpin` directly, and that include some additional default options. + +These are: + +- `composer generate` and `composer dev` - These generate the site in the development mode. +- `composer watch` - Generates and serves the site in development mode, watching for any changes. +- `composer prod` - Generates the site in production mode. + +You can still pass additional options by separating the command and options with `--`. For example, running `composer watch -- --port=8002` would run the default watch command but also update the server port: + +``` +composer watch -- --port=8002 +> composer generate -- --server --watch '--port=8002' +> sculpin generate --clean --no-interaction '--server' '--watch' '--port=8002' +Deleting /Users/opdavies/Code/Personal/sculpin-skeleton/output_dev +Detected new or updated files +Generating: 100% (1 sources / 0.00 seconds) +Converting: 100% (1 sources / 0.20 seconds) +Formatting: 100% (1 sources / 0.00 seconds) +Processing completed in 0.27 seconds +Starting Sculpin server for the dev environment with debug true +Development server is running at http://localhost:8002 +Quit the server with CONTROL-C. +``` + +## Notes + +- The `posts` content type is disabled by default. Re-enable it if needed by removing `enabled: false` from `app/config/sculpin_kernel.yml`. + +[1]: https://sculpin.io +[2]: https://getcomposer.org/doc/06-config.md#process-timeout + +## License + +[MIT][0] + +[0]: https://github.com/opdavies/sculpin-skeleton/blob/master/LICENSE diff --git a/app/config/sculpin_kernel.yml b/app/config/sculpin_kernel.yml new file mode 100644 index 0000000..8d3b2b3 --- /dev/null +++ b/app/config/sculpin_kernel.yml @@ -0,0 +1,3 @@ +sculpin_content_types: + posts: + enabled: false diff --git a/app/config/sculpin_site.yml b/app/config/sculpin_site.yml new file mode 100644 index 0000000..dd35d11 --- /dev/null +++ b/app/config/sculpin_site.yml @@ -0,0 +1,2 @@ +name: 'My New Sculpin Site' +locale: en diff --git a/app/config/sculpin_site_prod.yml b/app/config/sculpin_site_prod.yml new file mode 100644 index 0000000..1b449f6 --- /dev/null +++ b/app/config/sculpin_site_prod.yml @@ -0,0 +1,3 @@ +--- +imports: + - sculpin_site.yml diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..80ed125 --- /dev/null +++ b/composer.json @@ -0,0 +1,29 @@ +{ + "name": "opdavies/sculpin-skeleton", + "description": "A skeleton Sculpin site.", + "license": "MIT", + "authors": [ + { + "name": "Oliver Davies", + "homepage": "https://www.oliverdavies.uk", + "role": "Developer" + } + ], + "require": { + "sculpin/sculpin": "^3.0" + }, + "scripts": { + "dev": "composer run-script generate", + "generate": "sculpin generate --clean --no-interaction", + "prod": "composer run-script generate -- --env prod", + "watch": [ + "Composer\\Config::disableProcessTimeout", + "composer run-script generate -- --watch --server" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + } +} diff --git a/source/_layouts/app.html.twig b/source/_layouts/app.html.twig new file mode 100644 index 0000000..05ae600 --- /dev/null +++ b/source/_layouts/app.html.twig @@ -0,0 +1,12 @@ + + + + + + + {{ site.name|default('Sculpin Skeleton') }} + + + {% block body %}{% endblock %} + + diff --git a/source/_layouts/default.html.twig b/source/_layouts/default.html.twig new file mode 100644 index 0000000..56c9c99 --- /dev/null +++ b/source/_layouts/default.html.twig @@ -0,0 +1,5 @@ +{% extends 'app' %} + +{% block body %} + {% block content %}{% endblock %} +{% endblock %} diff --git a/source/index.md b/source/index.md new file mode 100644 index 0000000..d620bba --- /dev/null +++ b/source/index.md @@ -0,0 +1,4 @@ +--- +layout: default +--- +Hello, World!