Skip to content
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

Various required changes #10

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# http://editorconfig.org/

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,js,json,css,scss,eslintrc,feature}]
indent_size = 2
indent_style = space

[composer.json]
indent_size = 4

# Don't perform any clean-up on thirdparty files

[thirdparty/**]
trim_trailing_whitespace = false
insert_final_newline = false

[admin/thirdparty/**]
trim_trailing_whitespace = false
insert_final_newline = false
22 changes: 22 additions & 0 deletions .github/workflows/add-prs-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Add new PRs to github project

on:
pull_request_target:
types:
- opened
- ready_for_review

permissions: {}

jobs:
addprtoproject:
name: Add PR to GitHub Project
# Only run on the silverstripe account
if: github.repository_owner == 'silverstripe'
runs-on: ubuntu-latest
steps:
- name: Add PR to github project
uses: silverstripe/gha-add-pr-to-project@v1
with:
app_id: ${{ vars.PROJECT_PERMISSIONS_APP_ID }}
private_key: ${{ secrets.PROJECT_PERMISSIONS_APP_PRIVATE_KEY }}
21 changes: 21 additions & 0 deletions .github/workflows/keepalive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Keepalive

on:
# At 9:45 AM UTC, on day 18 of the month
schedule:
- cron: '45 9 18 * *'
workflow_dispatch:

permissions: {}

jobs:
keepalive:
name: Keepalive
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Keepalive
uses: silverstripe/gha-keepalive@v1
22 changes: 22 additions & 0 deletions .github/workflows/merge-up.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Merge-up

on:
# At 12:00 AM UTC, only on Friday
schedule:
- cron: '0 0 * * 5'
workflow_dispatch:

permissions: {}

jobs:
merge-up:
name: Merge-up
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- name: Merge-up
uses: silverstripe/gha-merge-up@v1
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2025, Silverstripe Limited - www.silverstripe.com
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59 changes: 13 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,22 @@
# startup-theme

The default theme for Silverstripe CMS. Startup has been designed to be quickly customisable and extendable so that you
can spend minimal time on boilerplate code and more time building your application. Startup is also intended to be a
demonstrative tool for Silverstripe beginners to get a feel for how the framework operates.
[![Silverstripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)

In-depth documentation on Silverstripe themes can be [found here](https://docs.silverstripe.org/en/5/developer_guides/templates/themes/).
The default theme for Silverstripe CMS.

--------

## Templates

Silverstripe templates are held in .ss files which are similar to .html files, with the difference that .ss files
contain Silverstripe template variables for rendering content from the database.

Full template documentation can be [found here](https://docs.silverstripe.org/en/5/developer_guides/templates/). A
particularly useful article is the one detailing [template syntax](https://docs.silverstripe.org/en/5/developer_guides/templates/syntax/) -
this contains everything you need to know to quickly become a template adept!

### A quick walkthrough of the template files in this theme
Startup has been designed to be quickly customisable and extendable so that you
can spend minimal time on boilerplate code and more time building your application. Startup is also intended to be a
demonstrative tool for Silverstripe CMS beginners to get a feel for how the framework operates.

Startup comes with the necessary templates out of the box to render pages with a header and a footer, as well as a menu
for desktop and mobile view ports. A list of the template files and their paths and functions:

* templates/Page.ss - This is the top level page template, with all other templates being rendered within this one. It
serves as the root HTML for all pages of your site, and therefore is where you place the `<head>` and `<body>` tags.
* templates/Layout/Page.ss - When a template is nested within a `Layout` folder, this template will be rendered by the
`$Layout` variable in the classes' primary template. An example in this theme: templates/Page.ss calls `$Layout`. This
is particularly useful when creating custom page types which subclass Page.php. A common pattern is to subclass Page
(e.g. new page class is App\Pages\MyCustomPage) then add a Layout template (e.g. nest the page template in
templates/App/Pages/MyCustomPage/Layout/MyCustomPage.ss). As this class is a subclass of Page, it will inherit the top
level Page.ss template and this will render the class specific `$Layout` - thus ensuring your site has a global header
and footer and other markup which is needed for every page. Silverstripe template inheritance is deep and powerful, and
is explained in much greater detail in [this lesson](https://www.silverstripe.org/learn/lessons/v4/working-with-multiple-templates-1).
* templates/Includes - Template files included in this folder can be easily included in any other template by using
`<% include TemplateName %>`. In this theme we include the Header and Footer, as well as the suite of Favicons for the
purposes of tidier markup.

## Styles and JS

All of the CSS in this theme is *Native CSS*. This means there are no cumbersome build tasks or transpiling SASS. Just
add to and edit the files, and you can modify the theme as needed. The file css/startup.css handles the importing of all
other files so be sure to add any extra css files you may need here. The top level Page.ss includes this file by way of
the [Silverstripe Requirements API](https://docs.silverstripe.org/en/5/developer_guides/templates/requirements/).

The theme Javascript is included in much the same way. js/startup.js imports modularised functionality, and this is then
included in the top level Page.ss template.
![screenshot of the startup theme](screenshot.png)

--------

## startup-theme-components
## Relevant documentation

If you're new to Silverstripe CMS, the following documentation should help you understand how this theme is constructed and what the different parts (e.g. templates) do.

This theme is extended upon by the [startup-theme-components module](https://github.com/silverstripeltd/startup-theme-components).
The module adds some commonly used modules to the CMS, and extends and expands upon the CSS in this module. It is highly
recommended to install the module with this theme!
- [themes](https://docs.silverstripe.org/en/developer_guides/templates/themes/)
- [templates](https://docs.silverstripe.org/en/developer_guides/templates/)
- [template syntax](https://docs.silverstripe.org/en/developer_guides/templates/syntax/)
- [Requirements API](https://docs.silverstripe.org/en/developer_guides/templates/requirements/)
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"silverstripe/recipe-cms": ">=5.2"
"silverstripe/framework": ">=5.2"
},
"extra": {
"expose": [
Expand Down
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion templates/Includes/Footer.ss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ul>
</nav>
<a href="https://www.silverstripe.org/" class="footer__logo" target="_blank" rel="noopener noreferrer" aria-label="Silverstripe CMS">
<img src="$resourceURL('themes/startup/images/logo--silverstripe-cms.svg')" width="176" height="21" alt="">
<img src="$resourceURL('themes/startup-theme/images/logo--silverstripe-cms.svg')" width="176" height="21" alt="">
</a>
</div>
</footer>