Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Add v3.33.0
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickRe committed Sep 14, 2020
1 parent 3c64953 commit 226c7eb
Show file tree
Hide file tree
Showing 36 changed files with 503 additions and 197 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ I documented my installation process, with additional steps to add Sendgrid, SSL
In any case I suggest forking my repository into your own, this to avoid changes I make to my repository to negatively impact your installation.

### One-click deploy
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FYannickRe%2FGhost-Azure%2Fmaster%2Fazuredeploy.json)
[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/)
[![Visualize](http://armviz.io/visualizebutton.png)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FYannickRe%2FGhost-Azure%2Fazure%2Fazuredeploy.json)

### Azure App Service Deployment Center
More info on [Microsoft Docs](https://docs.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment#deploy-continuously-from-github)
17 changes: 9 additions & 8 deletions azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"hostingPlanName": {
"type": "string"
},
"siteLocation": {
"type": "string"
},
"sku": {
"type": "string",
"allowedValues": [
Expand Down Expand Up @@ -53,12 +56,10 @@
"defaultValue": ""
},
"repoUrl": {
"type": "string",
"defaultValue": "https://github.com/<<PutYourGitHubUserHere>>/Ghost-Azure"
"type": "string"
},
"branch": {
"type": "string",
"defaultValue": "master"
"type": "string"
}
},
"variables": {
Expand All @@ -70,7 +71,7 @@
{
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[resourceGroup().location]",
"location": "[parameters('siteLocation')]",
"apiVersion": "2018-02-01",
"sku": {
"name": "[variables('sku')]"
Expand All @@ -84,7 +85,7 @@
{
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"location": "[parameters('siteLocation')]",
"apiVersion": "2018-11-01",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
Expand Down Expand Up @@ -151,7 +152,7 @@
{
"name": "[variables('appInsightsName')]",
"type": "Microsoft.Insights/components",
"location": "[resourceGroup().location]",
"location": "[parameters('siteLocation')]",
"apiVersion": "2014-04-01",
"condition": "[parameters('Deploy App Insights')]",
"dependsOn": [
Expand All @@ -166,4 +167,4 @@
}
}
]
}
}

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/built/assets/icons/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion core/frontend/helpers/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,28 @@
// escape it or tell handlebars to leave it alone with a triple-brace.
//
// Enables tag-safe truncation of content by characters or words.
//
// Dev flag feature: In case of restricted content access for member-only posts, shows CTA box

const {SafeString} = require('../services/proxy');
const {templates, hbs, config, SafeString} = require('../services/proxy');
const downsize = require('downsize');
const _ = require('lodash');
const createFrame = hbs.handlebars.createFrame;

function restrictedCta(options) {
options = options || {};
options.data = options.data || {};
_.merge(this, {
accentColor: (options.data.site && options.data.site.accent_color) || '#3db0ef'
});
const data = createFrame(options.data);
return templates.execute('content', this, {data});
}

module.exports = function content(options = {}) {
let self = this;
let args = arguments;

const hash = options.hash || {};
const truncateOptions = {};
let runTruncate = false;
Expand All @@ -25,6 +42,10 @@ module.exports = function content(options = {}) {
this.html = '';
}

if (!this.access && !!config.get('enableDeveloperExperiments')) {
return restrictedCta.apply(self, args);
}

if (runTruncate) {
return new SafeString(
downsize(this.html, truncateOptions)
Expand Down
2 changes: 2 additions & 0 deletions core/frontend/helpers/ghost_head.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
const {metaData, escapeExpression, SafeString, logging, settingsCache, config, blogIcon, labs, urlUtils} = require('../services/proxy');
const _ = require('lodash');
const debug = require('ghost-ignition').debug('ghost_head');
const templateStyles = require('./tpl/styles');

const getMetaData = metaData.get;
const getAssetUrl = metaData.getAssetUrl;
Expand Down Expand Up @@ -44,6 +45,7 @@ function getMembersHelper() {
let membersHelper = `<script defer src="${getAssetUrl('public/members.js', true)}"></script>`;
if (config.get('enableDeveloperExperiments')) {
membersHelper = `<script defer src="https://unpkg.com/@tryghost/members-js@latest/umd/members.min.js" data-ghost="${urlUtils.getSiteUrl()}"></script>`;
membersHelper += (`<style type='text/css'> ${templateStyles}</style>`);
}
if ((!!stripeDirectSecretKey && !!stripeDirectPublishableKey) || !!stripeConnectAccountId) {
membersHelper += '<script async src="https://js.stripe.com/v3/"></script>';
Expand Down
16 changes: 16 additions & 0 deletions core/frontend/helpers/tpl/content.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<aside class="gh-post-upgrade-cta">
<div class="gh-post-upgrade-cta-content" style="background-color: {{accentColor}}">
{{#has visibility="paid"}}
<h2>This post is for paying subscribers only</h2>
{{/has}}
{{#has visibility="members"}}
<h2>This post is for subscribers only</h2>
{{/has}}
{{#if @member}}
<a class="gh-btn" data-portal="account/plans" style="color:{{accentColor}}">Subscribe now</a>
{{else}}
<a class="gh-btn" data-portal="signup" style="color:{{accentColor}}">Subscribe now</a>
<p><small>Already have an account? <a data-portal="signin">Sign in</a></small></p>
{{/if}}
</div>
</aside>
69 changes: 69 additions & 0 deletions core/frontend/helpers/tpl/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* Default CSS Styles for helpers which are appended in theme via ghost_head */
const contentHelper = `.gh-post-upgrade-cta-content,
.gh-post-upgrade-cta {
display: flex;
flex-direction: column;
align-items: center;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
text-align: center;
width: 100%;
color: #ffffff;
font-size: 16px;
}
.gh-post-upgrade-cta-content {
border-radius: 8px;
padding: 40px 4vw;
}
.gh-post-upgrade-cta h2 {
color: #ffffff;
font-size: 28px;
letter-spacing: -0.2px;
margin: 0;
padding: 0;
}
.gh-post-upgrade-cta p {
margin: 20px 0 0;
padding: 0;
}
.gh-post-upgrade-cta small {
font-size: 16px;
letter-spacing: -0.2px;
}
.gh-post-upgrade-cta a {
color: #ffffff;
cursor: pointer;
font-weight: 500;
box-shadow: none;
text-decoration: underline;
}
.gh-post-upgrade-cta a:hover {
color: #ffffff;
opacity: 0.8;
box-shadow: none;
text-decoration: underline;
}
.gh-post-upgrade-cta a.gh-btn {
display: block;
background: #ffffff;
text-decoration: none;
margin: 28px 0 0;
padding: 8px 18px;
border-radius: 4px;
font-size: 16px;
font-weight: 600;
}
.gh-post-upgrade-cta a.gh-btn:hover {
opacity: 0.92;
}`;

const styles = contentHelper;

module.exports = styles;
Loading

0 comments on commit 226c7eb

Please sign in to comment.