Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@parameter1/base-cms-marko-web-theme-monorail
Advanced tools
Readme
To install and use this feature, you must:
// site/routes/content.js
+const contentMetering = require('@parameter1/base-cms-marko-web-theme-monorail/middleware/content-metering');
+const config = require('../config/content-meter');
module.exports (app) => {
- app.get('/*?:id(\\d{8})*', withContent({
+ app.get('/*?:id(\\d{8})*', contentMetering(config), withContent({
template: content,
queryFragment,
}));
contentMeter
site config object. See below table for defined options/default values.# site/config/site.js
+const contentMeter = require('./content-meter');
module.exports = {
// ...
+ contentMeter,
// ...
}
// site/config/content-meter.js
module.exports = {
enabled: process.env.ENABLE_CONTENT_METER || false,
viewLimit: 5,
}
Key | Default value | Description |
---|---|---|
enabled | false | If the feature should be enabled. |
viewLimit | 3 | The number of content items a viewer can see in timeframe without logging in. |
timeframe | 30 * 24 * 60 * 60 * 1000 (30 days in ms) | The timeframe to consider |
excludeLabels | [] | Content labels that should be excluded from metering. |
excludeContentTypes | [] | Content types that should be excluded from metering. |
excludePrimarySectionIds | [] | Sections whose primary content should be excluded from metering. |
excludePrimarySectionAlias | [] | Sections whose primary content should be excluded from metering. |
displayOverlay | None | ??? @B77Mills what is this |
promoCode | None | If present, the Omeda promo code to use with content metering events. |
document
component (ideally in above-container):<!-- site/server/components/document.marko -->
$ const { contentMeterState } = out.global;
<if(contentMeterState && !contentMeterState.isLoggedIn)>
<theme-content-meter-block
views=contentMeterState.views
view-limit=contentMeterState.viewLimit
display-overlay=contentMeterState.displayOverlay
display-gate=contentMeterState.displayGate
/>
</if>
<!-- site/components/layouts/content.marko -->
import cm from "@parameter1/base-cms-marko-web-theme-monorail/utils/content-meter-helpers";
$ const { content, blockName } = input;
$ const { contentGatingHandler, contentMeterState, req } = out.global;
$ const showOverlay = cm.shouldOverlay(contentMeterState);
$ const requiresReg = cm.restrictContentByReg(contentMeterState, contentGatingHandler, content);
$ let body = content.body;
<if(cm.shouldTruncate(contentMeterState))>
$ if (showOverlay) body = getContentPreview({ body: content.body, selector: "p:lt(7)" });
<marko-web-content-body block-name=blockName obj={ body } />
<div class="content-page-preview-overlay" />
<if(!showOverlay)>
<theme-content-page-gate
can-access=context.canAccess
is-logged-in=context.isLoggedIn
$ // ...
/>
</if>
</if>
<else-if(!context.canAccess || context.requiresUserInput)>
$ // ...
FAQs
Monorail website theme ===
The npm package @parameter1/base-cms-marko-web-theme-monorail receives a total of 975 weekly downloads. As such, @parameter1/base-cms-marko-web-theme-monorail popularity was classified as not popular.
We found that @parameter1/base-cms-marko-web-theme-monorail demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.