diff --git a/README.md b/README.md
index 5249fc1..2a57b27 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
Blog is a minimal, multi-user Twitter OAuth blogging platform that can create living, powerful pages
-[](http://blog.web-app.io)
+[](http://blog.web-app.io)
## Install
@@ -15,13 +15,13 @@ Run as a Desktop App (Windows only):
Run as a .NET Core Web App (Windows, macOS, Linux):
- $ dotnet tool install -g web
+ $ dotnet tool install -g x
- $ web install blog
- $ cd blog && web
+ $ x install blog
+ $ cd blog && x
-> Requires [.NET Core 2.1](https://www.microsoft.com/net/download/dotnet-core/2.1).
+> Requires [.NET Core 3.1](https://www.microsoft.com/net/download/dotnet-core/3.1).
## Learn
-See [templates.servicestack.net/docs/web-apps](http://templates.servicestack.net/docs/web-apps) to learn about ServiceStack .NET Core 2.1 Web Apps.
+See [sharpscript.net/docs/sharp-apps](http://sharpscript.net/docs/sharp-apps) to learn about ServiceStack .NET Core 3.1 Sharp Apps.
diff --git a/_assert-post-partial.html b/_assert-post-partial.html
index 392d75f..2849f03 100644
--- a/_assert-post-partial.html
+++ b/_assert-post-partial.html
@@ -1,8 +1,9 @@
+```code
+#if post == null
+ var error = `Post ${slug} does not exist`
+else if post.CreatedBy != userName
+ var error = `You do not have permission to edit this post`
+/if
-{{#if post == null }}
- {{ `Post ${slug} does not exist` | assignTo: error }}
-{{else if post.CreatedBy != userName }}
- {{ `You do not have permission to edit this post` | assignTo: error }}
-{{/if}}
-
-{{ 'error' | showIfExists(error) | partial({ error }) }}
+'error' |> if(error) |> partial({ error })
+```
diff --git a/_editor-partial.html b/_editor-partial.html
index d3d1e3a..22fb47d 100644
--- a/_editor-partial.html
+++ b/_editor-partial.html
@@ -1,5 +1,5 @@
-{{ it | withoutKeys(['it','error']) | assignTo: attrs }}
+{{ var attrs = it.ownProps() }}
{{/if}}
diff --git a/_init.html b/_init.html
index 10fd2b8..e0a5057 100644
--- a/_init.html
+++ b/_init.html
@@ -28,10 +28,10 @@
"Modified" VARCHAR(8000) NOT NULL
);`
- | dbExec
+ |> dbExec
}}
-{{ dbScalar(`SELECT COUNT(*) FROM Post`) | assignTo: postsCount }}
+{{ var postsCount = dbScalarSync(`SELECT COUNT(*) FROM Post`) }}
{{#if postsCount == 0 }}
@@ -39,8 +39,8 @@
Seed with initial UserInfo and Post data
========================================
- {{ `datetime(CURRENT_TIMESTAMP,'localtime')` | assignTo: sqlNow }}
- {{ `ServiceStack` | assignTo: user }}
+ {{ var sqlNow = `datetime(CURRENT_TIMESTAMP,'localtime')` }}
+ {{ var user = `ServiceStack` }}
========================
Create ServiceStack User - Contains same info as if was @ServiceStack authenticated via Twitter
@@ -48,7 +48,7 @@
{{ `INSERT INTO UserInfo (UserName, DisplayName, AvatarUrl, AvatarUrlLarge, Created, Modified)
VALUES (@user, @user, @avatarUrl, @avatarUrlLarge, ${sqlNow}, ${sqlNow})`
- | dbExec({
+ |> dbExec({
user: 'ServiceStack',
avatarUrl: 'https://pbs.twimg.com/profile_images/876249730078056448/JuTVEkWX_normal.jpg',
avatarUrlLarge: 'https://pbs.twimg.com/profile_images/876249730078056448/JuTVEkWX.jpg'
@@ -56,54 +56,58 @@
}}
===============================================
- {{ 'Live Document Example' | assignTo: title }}
+ {{ var title = 'Live Document Example' }}
===============================================
{{#raw content}}{{#markdown}}
-All Blog posts have access to [ServiceStack Templates](http://templates.servicestack.net) features which enables they to use a highly-productive,
-easy to use [sandboxed](http://templates.servicestack.net/docs/sandbox) dynamic templating language which lets you easily create live documents
+All Blog posts have access to [ServiceStack Templates](https://sharpscript.net/) features which enables they to use a highly-productive,
+easy to use [sandboxed](https://sharpscript.net/docs/sandbox) dynamic templating language which lets you easily create live documents
[like this one](/posts/live-document-example):
{{/markdown}}
{{/raw}}
- {{ { title, content } | addTo: initialPosts }}
+ {{ { title, content } |> addTo => initialPosts }}
==========================================
- {{ 'Markdown Example' | assignTo: title }}
+ {{ var title = 'Markdown Example' }}
==========================================
{{#raw content}}{{#markdown}}
@@ -133,13 +137,13 @@
$ cd /Users/Guest
-Follow [link to markdown block docs](http://templates.servicestack.net/docs/blocks#markdown) for more info.
+Follow [link to markdown block docs](https://sharpscript.net/docs/blocks#markdown) for more info.
{{/markdown}}{{/raw}}
- {{ { title, content } | addTo: initialPosts }}
+ {{ { title, content } |> addTo: initialPosts }}
================================================
- {{ 'Web App Customizations' | assignTo: title }}
+ {{ var title = 'Web App Customizations' }}
================================================
{{#raw content}}{{#markdown}}
@@ -149,7 +153,7 @@
Just like `Global.asax.cs` can be used to run Startup logic in ASP.NET Web Applications and `Startup.cs` in .NET Core Apps,
you can add a `_init.html` to run logic once on Startup.
-This is used in this Blog's [_init.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/_init.html) where it will create a new
+This is used in this Blog's [_init.html](https://github.com/sharp-apps/blog/blob/master/app/_init.html) where it will create a new
`blog.sqlite` database if it doesn't exist seeded with the UserInfo and Posts Tables and initial data, e.g:
```
@@ -162,10 +166,10 @@
"Created" VARCHAR(8000) NOT NULL,
"Modified" VARCHAR(8000) NOT NULL
);`
- | dbExec
+ |> dbExec
}}
-{{ dbScalar(`SELECT COUNT(*) FROM Post`) | assignTo: postsCount }}
+{{ var postsCount = dbScalarSync(`SELECT COUNT(*) FROM Post`) }}
{{#if postsCount == 0 }}
@@ -181,13 +185,13 @@
```
The output of the `_init` page is captured in the `initout` argument which can be inspected as a template argument as done in
-[log.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/log.html):
+[log.html](https://github.com/sharp-apps/blog/blob/master/app/log.html):
```
Output from init.html:
-
{{initout | raw}}
+
{{initout |> raw}}
```
@@ -197,7 +201,7 @@
## Customizable Auth Providers
Auth Providers can be configured in the same way
-[Web App Plugins can be registered](http://templates.servicestack.net/docs/web-apps#registering-servicestack-plugins) by first specifying
+[Web App Plugins can be registered](https://sharpscript.net/docs/sharp-apps#registering-servicestack-plugins) by first specifying
you want to register the `AuthFeature` plugin with:
```
@@ -261,10 +265,10 @@
{{/markdown}}{{/raw}}
-{{ { title, content } | addTo: initialPosts }}
+{{ { title, content } |> addTo => initialPosts }}
============================================
- {{ 'Dynamic API Pages' | assignTo: title }}
+ {{ var title = 'Dynamic API Pages' }}
============================================
{{#raw content}}{{#markdown}}
@@ -299,11 +303,11 @@
> Usage: /hello/\{name}
An API which returns the same wire response as above can be implemented in API Pages by creating a page at
-[/hello/_name/index.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/hello/_name/index.html)
+[/hello/_name/index.html](https://github.com/sharp-apps/blog/blob/master/app/hello/_name/index.html)
with the contents:
```
-{{ { result: `Hello, ${name}!` } | return }}
+{{ { result: `Hello, ${name}!` } |> return }}
```
Which supports the same content negotiation as a ServiceStack Service where calling it in a browser will generate a
@@ -319,23 +323,23 @@
Alternatively you can force a JSON Response by specifying it with:
```
-{{ { result: `Hello, ${name}!` } | return({ format: 'json' }) }}
+{{ { result: `Hello, ${name}!` } |> return({ format: 'json' }) }}
// Equivalent to:
-{{ { result: `Hello, ${name}!` } | return({ contentType: 'application/json' }) }}
+{{ { result: `Hello, ${name}!` } |> return({ contentType: 'application/json' }) }}
```
### /preview API Page
> Usage: /preview?content=\{templates}
-The [/preview.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/preview.html) page uses this to force a plain-text response with:
+The [/preview.html](https://github.com/sharp-apps/blog/blob/master/app/preview.html) page uses this to force a plain-text response with:
```
-{{ content | evalTemplate({use:{plugins:'MarkdownScriptPlugin'}}) | assignTo:response }}
-{{ response | return({ contentType:'text/plain' }) }}
+{{ var response = content.evalTemplate({use:{plugins:'MarkdownScriptPlugin'}}) }}
+{{ response |> return({ contentType:'text/plain' }) }}
```
-The preview API above is what provides this Blog's Live Preview feature where it will render any ServiceStack Templates provided in the
+The preview API above is what provides this Blog's Live Preview feature where it will render any #Script provided in the
**content** Query String or HTTP Post Form Data, e.g:
- [/preview?content={{10|times|select:{pow(index,2)},}}](/preview?content={{10|times|select:{pow(index,2)},}})
@@ -348,7 +352,7 @@
> Usage: /\{user}/api
-The [/_user/api.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/_user/api.html) API page shows an example of how easy it is to
+The [/_user/api.html](https://github.com/sharp-apps/blog/blob/master/app/_user/api.html) API page shows an example of how easy it is to
create data-driven APIs where you can literally return the response of an SQL query by calling the `dbSelect` filter and returning the results with:
```
@@ -356,8 +360,8 @@
FROM Post p INNER JOIN UserInfo u on p.CreatedBy = u.UserName
WHERE UserName = @user
ORDER BY p.Created DESC`
- | dbSelect({ user })
- | return }}
+ |> dbSelect({ user })
+ |> return }}
```
The **user** argument is populated as a result of dynamic route from the `_user` directory name which will let you view all
@@ -374,13 +378,13 @@
Which thanks to the live development workflow provides the most productive development experience to rapidly develop Web APIs or perform common
tasks like viewing adhoc SQL queries in Excel which can be further manipulated using the
-[LINQ-like expressiveness](http://templates.servicestack.net/linq/restriction-operators) and wrist-friendly filters available in Templates.
+[LINQ-like expressiveness](https://sharpscript.net/linq/restriction-operators) and wrist-friendly filters available in #Script.
### /posts/_slug/api Page
> Usage: /posts/\{slug}/api
-The [/posts/_slug/api.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/posts/_slug/api.html) page shows an example of using the
+The [/posts/_slug/api.html](https://github.com/sharp-apps/blog/blob/master/app/posts/_slug/api.html) page shows an example of using the
`httpResult` filter to return a custom HTTP Response where if the post with the specified slug does not exist it will return a
`404 Post was not found` HTTP Response:
@@ -389,11 +393,11 @@
FROM Post p INNER JOIN UserInfo u on p.CreatedBy = u.UserName
WHERE Slug = @slug
ORDER BY p.Created DESC`
- | dbSingle({ slug })
- | assignTo: post
+ |> dbSingle({ slug })
+ |> to => post
}}
{{ post ?? httpResult({ status:404, statusDescription:'Post was not found' })
- | return }}
+ |> return }}
```
The **httpResult** filter returns a ServiceStack `HttpResult` which allows for the following customization's:
@@ -415,29 +419,29 @@
This behaves similarly to customizing a response with return arguments:
```
-{{ post | return({ format:'json', 'X-Powered-By':'ServiceStack Templates' }) }}
+{{ post |> return({ format:'json', 'X-Powered-By':'ServiceStack #Script' }) }}
```
Using the explicit httpResult filter is useful for returning a custom HTTP Response that doesn't have a Response Body, e.g. the **New Post** page
uses `httpFilter` to
-[redirect back to the Users posts page](https://github.com/NetCoreWebApps/Blog/blob/e8bb7249192c5797348ced091ad5fd434db9a619/app/posts/new.html#L33)
+[redirect back to the Users posts page](https://github.com/sharp-apps/blog/blob/e8bb7249192c5797348ced091ad5fd434db9a619/app/posts/new.html#L33)
after they've successfully created a new Post:
```
{{#if success}}
- {{ httpResult({ status:301, Location:`/${userName}` }) | return }}
+ {{ httpResult({ status:301, Location:`/${userName}` }) |> return }}
{{/if}}
```
-For more examples and info on API Pages checkout to the [API Pages docs](http://templates.servicestack.net/docs/api-pages).
+For more examples and info on API Pages checkout to the [API Pages docs](https://sharpscript.net/docs/api-pages).
{{/markdown}}{{/raw}}
- {{ { title, content } | addTo: initialPosts }}
+ {{ { title, content } |> addTo => initialPosts }}
============================================
- {{ 'Page based routing' | assignTo: title }}
+ {{ var title = 'Page based routing' }}
============================================
{{#raw content}}{{#markdown}}
@@ -446,24 +450,24 @@
| path | page |
------ | ---- |
[/db](/db) | |
-[/db.html](/db.html) | [/db.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/db.html) |
+[/db.html](/db.html) | [/db.html](https://github.com/sharp-apps/blog/blob/master/app/db.html) |
[/posts/new](/posts/new) | |
-[/posts/new.html](/posts/new.html) | [/posts/new.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/posts/new.html)
+[/posts/new.html](/posts/new.html) | [/posts/new.html](https://github.com/sharp-apps/blog/blob/master/app/posts/new.html)
and the default route **/** maps to the `index.html` in each directory if it exists, e.g:
| path | page |
------ | ---- |
-[/](/) | [/index.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/index.html) |
+[/](/) | [/index.html](https://github.com/sharp-apps/blog/blob/master/app/index.html) |
Nuxt-like [Dynamic Routes](https://nuxtjs.org/guide/routing#dynamic-routes) can also be used where any **file** or **directory** names
prefixed with an _ **underscore** allows for dynamic wildcard paths with the matching path component also assigned to the arguments name:
| path | page | arguments |
------ | ---- | --------- |
-[/ServiceStack](/) | [/_user/index.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/_user/index.html) | user=ServiceStack |
-[/posts/markdown-example](/posts/markdown-example) | [/posts/_slug/index.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/posts/_slug/index.html) | slug=markdown-example |
-[/posts/markdown-example/edit](/posts/markdown-example/edit) | [/posts/_slug/edit.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/posts/_slug/edit.html) | slug=markdown-example |
+[/ServiceStack](/) | [/_user/index.html](https://github.com/sharp-apps/blog/blob/master/app/_user/index.html) | user=ServiceStack |
+[/posts/markdown-example](/posts/markdown-example) | [/posts/_slug/index.html](https://github.com/sharp-apps/blog/blob/master/app/posts/_slug/index.html) | slug=markdown-example |
+[/posts/markdown-example/edit](/posts/markdown-example/edit) | [/posts/_slug/edit.html](https://github.com/sharp-apps/blog/blob/master/app/posts/_slug/edit.html) | slug=markdown-example |
### Layout and partial recommended naming conventions
@@ -479,31 +483,31 @@
If you follow the recommended `_{name}-partial.html` naming convention you will also be able to reference partials using just their name, i.e:
```
-{{ 'menu' | partial }} // Equivalent to:
-{{ '_menu-partial' | partial }}
+{{ 'menu' |> partial }} // Equivalent to:
+{{ '_menu-partial' |> partial }}
```
{{/markdown}}{{/raw}}
- {{ { title, content } | addTo: initialPosts }}
+ {{ { title, content } |> addTo => initialPosts }}
===============================
- {{ 'About' | assignTo: title }}
+ {{ var title = 'About' }}
===============================
{{#raw content}}{{#markdown}}
-This Blog App demonstrates some of the capabilities in [ServiceStack Web Apps](http://templates.servicestack.net/docs/web-apps) - an exciting real-time
+This Blog App demonstrates some of the capabilities in [ServiceStack Web Apps](https://sharpscript.net/docs/sharp-apps) - an exciting real-time
development model for developing .NET Core Apps where entire Web Apps can be developed within a live hot-reload experience without any compilation,
build tools, dependencies, IDEs or any C# source code necessary by using the powerful and user-friendly
-[ServiceStack Templates language](http://templates.servicestack.net/) and its comprehensive built-in functionality.
+[ServiceStack #Script language](https://sharpscript.net/) and its comprehensive built-in functionality.
### Ultimate Simplicity
This eliminates much of the complexity inherent in developing .NET Web Applications which by their nature results in highly customizable Web Apps
where their entire functionality can be modified in real-time whilst the App is running, which is simple enough to be enhanced by non-developers
-like Designers and Content Creators courtesy of its approachable [Handlebars-like](http://templates.servicestack.net/docs/blocks) and familiar
-[JavaScript syntax](http://templates.servicestack.net/docs/expression-viewer#expression=map(range(1%2Ccount)%2C%20x%20%3D%3E%20x%20*%20x)&count=5).
+like Designers and Content Creators courtesy of its approachable [Handlebars-like](https://sharpscript.net/docs/blocks) and familiar
+[JavaScript syntax](https://sharpscript.net/docs/expression-viewer#expression=map(range(1%2Ccount)%2C%20x%20%3D%3E%20x%20*%20x)&count=5).
Compiled Apps can have a prohibitively large barrier to entry where any modification often requires downloading source code separately, setting
up a matching development environment with appropriate extensions and correct versions and non cursory level of experience with their chosen
@@ -516,7 +520,7 @@
## Blog App Features
-This [/Blog](https://github.com/NetCoreWebApps/Blog/tree/master/app) Web App is another example of encapsulating useful functionality in a
+This [/Blog](https://github.com/sharp-apps/blog/tree/master/app) Web App is another example of encapsulating useful functionality in a
highly customizable .NET Core Web App which to maximize approachability has no C# source code, plugins and uses no JavaScript or CSS frameworks.
The development of which ended up being one of the most enjoyable experiences we've had in recent memory where all the usual complexities of
developing a C# Server and modern JS App has been dispensed and you can just focus on the App you want to create,
@@ -524,7 +528,7 @@
Any infrastructure dependencies have also been avoided by using SQLite by default which is
[automatically created an populated on first run](/posts/web-app-customizations) if no database exists, or if preferred can be
-[changed to use any other popular RDBMS](http://templates.servicestack.net/docs/web-apps#multi-platform-configurations) using just config.
+[changed to use any other popular RDBMS](https://sharpscript.net/docs/sharp-apps#multi-platform-configurations) using just config.
### Multi User Blogging Platform
@@ -536,9 +540,9 @@
### Rich Content
Whilst most blogging platforms just edit static text, each Post content has access to the powerful and
-[Sandboxed](http://templates.servicestack.net/docs/sandbox) features in http://templates.servicestack.net which can be used to create
+[Sandboxed](https://sharpscript.net/docs/sandbox) features in https://sharpscript.net/ which can be used to create
[Live Documents](/posts/live-document-example) or [Render Markdown](/posts/markdown-example) which is itself just
-[one of the available blocks](http://templates.servicestack.net/docs/blocks#markdown) where it will render to HTML any content between the `markdown` blocks:
+[one of the available blocks](https://sharpscript.net/docs/blocks#markdown) where it will render to HTML any content between the `markdown` blocks:
{{/markdown}}
{{#markdown}}
@@ -572,22 +576,22 @@
### Server Validation
-The [new.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/posts/new.html) and [edit.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/posts/_slug/edit.html) pages shows examples of performing server validation with ServiceStack Templates:
+The [new.html](https://github.com/sharp-apps/blog/blob/master/app/posts/new.html) and [edit.html](https://github.com/sharp-apps/blog/blob/master/app/posts/_slug/edit.html) pages shows examples of performing server validation with ServiceStack #Script:
```
{{ assignErrorAndContinueExecuting: ex }}
{{ 'Title must be between 5 and 200 characters'
- | onlyIf(length(postTitle) < 5 || length(postTitle) > 200) | assignTo: titleError }}
+ |> onlyIf(length(postTitle) < 5 || length(postTitle) > 200) |> to => titleError }}
{{ 'Content must be between 25 and 64000 characters'
- | onlyIf(length(content) < 25 || length(content) > 64000) | assignTo: contentError }}
+ |> onlyIf(length(content) < 25 || length(content) > 64000) |> to => contentError }}
{{ 'Potentially malicious characters detected'
- | ifNotExists(contentError) | onlyIf(containsXss(content)) | assignTo: contentError }}
+ |> ifNotExists(contentError) | onlyIf(containsXss(content)) |> to => contentError }}
```

-For more info see the docs on [Error Handling](http://templates.servicestack.net/docs/error-handling).
+For more info see the docs on [Error Handling](https://sharpscript.net/docs/error-handling).
### Live Previews
@@ -600,7 +604,7 @@
The implementation of which is surprisingly simple where the JavaScript snippet in
-[default.js](https://github.com/NetCoreWebApps/Blog/blob/master/app/default.js) below is used to send their content on each change:
+[default.js](https://github.com/sharp-apps/blog/blob/master/app/default.js) below is used to send their content on each change:
```
// Enable Live Preview of new Content
@@ -630,21 +634,21 @@
}
```
-To the [/preview.html](https://github.com/NetCoreWebApps/Blog/blob/master/app/preview.html) API Page which just renders and captures any
+To the [/preview.html](https://github.com/sharp-apps/blog/blob/master/app/preview.html) API Page which just renders and captures any
Template Content its sent and returns the output:
```
-{{ content | evalTemplate({use:{plugins:'MarkdownScriptPlugin'}}) | assignTo:response }}
+{{ content | evalTemplate({use:{plugins:'MarkdownScriptPlugin'}}) |> to =>response }}
{{ response | return({ contentType:'text/plain' }) }}
```
-By default the `evalTemplate` filter renders Templates in a new `TemplateContext` which can be customized to utilize any additional
+By default the `evalTemplate` filter renders ` in a new `ScriptContext` which can be customized to utilize any additional
`plugins`, `filters` and `blocks` available in the configured [SharpPagesFeature](https://sharpscript.net/docs/sharp-pages),
or for full access you can use `{use:{context:true}}` to evaluate any Template content under the same context that `evalTemplate` is run on.
{{/markdown}}{{/raw}}
- {{ { title, content } | addTo: initialPosts }}
+ {{ { title, content } |> addTo => initialPosts }}
======================
diff --git a/_layout.html b/_layout.html
index d29c67b..2aef1a7 100644
--- a/_layout.html
+++ b/_layout.html
@@ -9,23 +9,23 @@
- {{ '/js/hot-fileloader.js' | ifDebugIncludeScript }}
+ {{ '/js/hot-fileloader.js' |> ifDebugIncludeScript }}