You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
7
+
## Unreleased
8
+
### Changed
9
+
- User-defined templates for the message that appears on Sabbath and the banner message no longer use the HTML `<template>` tag. They need to use any other element now, preferably a `<div>` but any element with the right `id` will work. This change was needed because of a conflict with using `<template>` in React apps as React expects it to be a JSX template and not the HTML `<template>` tag.
10
+
11
+
## 1.0.6 - 2022-09-12
12
+
### Changed
13
+
- Luxon is now included in the build.
14
+
- Updated dependencies.
15
+
7
16
## 1.0.5 - 2021-10-15
8
17
### Changed
9
18
- Updated the test file settings to show a more syntax-safe JSON object.
Copy file name to clipboardExpand all lines: README.md
+72-47Lines changed: 72 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,16 @@ This script was developed to help with closing down of a website from sunset on
5
5
- Automatically show a banner on the top of your site notifying visitors when your site will close.
6
6
- Show a message during the Sabbath hours letting visitors know why you are closed and when your site will be back online.
7
7
8
-
## Dependencies
9
-
The Sunset to Sunset script is dependent on a date time library called [Luxon](https://moment.github.io/luxon/#/) to calculate closing and opening times based off of the sunset times at the location that is entered. A goal is to eventually include this in the Sunset to Sunset script to avoid the need to load two separate scripts.
10
-
11
8
## Installation
12
9
Whichever method you choose, either **Download** or **CDN**, it’s best to include all these files in the head so that they load right away. It’s not ideal to have render-blocking scripts in the head but the reason we recommend putting them in the head is to avoid the flash of the rendered page before the Sabbath message gets rendered. Feel free to submit a PR for improved installation methods.
Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will load `<script nomodule>` anyway. If you need to support Safari 10.1 on your website you may use this snippet below:
Sunset to sunset needs some initial configuration needed for it to work correctly for your location. It will work out of the box without configuration but it won't be for your location.
92
104
93
105
## Custom Templates
94
-
Sunset to sunset has some built-in banner and message templates that will be shown at the appropriate times but sometimes you need to define your own wording. You can do that with the html `template` elements.
106
+
Sunset to sunset has some built-in banner and message templates that will be shown at the appropriate times but sometimes you need to define your own wording. You can do that with `<div>`s with the appropriate `id`s added to to them.
95
107
96
108
### Special Template Tags
97
109
You can add the following two tags to your custom templates to render the closing time and the opening times.
@@ -148,35 +160,48 @@ Include the [special closing and opening time tags](#special-template-tags) with
148
160
### Banner Template
149
161
To define your custom banner template add the following snippet to your page, preferrably in the `<head>` tag.
150
162
163
+
151
164
```html
152
-
<templateid="sts-banner-template">
165
+
<divid="sts-banner-template">
153
166
<divclass="sts-banner YOUR-CUSTOM-CLASSES-HERE">
154
167
Our store will be closing at
155
168
<spanclass="sts-closing-time"></span>
156
169
<span>and will re-open on</span>
157
170
<spanclass="sts-opening-time"></span>
158
171
</div>
159
-
</template>
172
+
</div>
160
173
```
174
+
The `sts-banner` class provides some default styling for the banner that you could use as a starting point. Or you can remove it altogether and use your own custom styles. If you keep the `sts-banner` class it will output something like what you see below:
175
+
176
+

161
177
162
178
### Simple Message Template
163
179
If you want to just set a paragraph or two of text to appear during Sabbath then this is the template you'll want to use.
164
180
165
181
To define your custom message template add the following snippet to your page, preferrably in the `<head>` tag:
If you want to have full control over the appearance and layout of the message then you'll want to use the full message template. Everything inside of this template will be output into the `<div class="sts-full-message__container">`. You will need to supply your own custom styling to add padding and centering of your message.
200
+
If you want to have full control over the appearance and layout of the message then you'll want to use the full message template. You will need to supply your own custom styling to add padding and centering of your message.
176
201
177
202
To define your custom message template add the following snippet to your page, preferrably in the `<head>` tag:
178
203
```html
179
-
<templateid="sts-full-message-template">
204
+
<divid="sts-full-message-template">
180
205
<divclass="your-custom-layout-class">
181
206
<divclass="your-message-area">
182
207
<h1class="your-message__heading">Sabbath</h1>
@@ -188,7 +213,7 @@ To define your custom message template add the following snippet to your page, p
0 commit comments