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

dev #65

Merged
merged 5 commits into from
Aug 2, 2024
Merged

dev #65

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
2 changes: 2 additions & 0 deletions src/_flightdeck/shortcodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const codepen = require("./shortcodes/codepen");
const copyright = require("./shortcodes/copyright");
const image = require("./shortcodes/image");
const version = require("./shortcodes/flightdeck-version");
const email = require("./shortcodes/email");

module.exports = (config) => {
config.addShortcode("blockquote", blockquote);
Expand All @@ -22,4 +23,5 @@ module.exports = (config) => {
config.addShortcode("copyright", copyright);
config.addShortcode("image", image);
config.addShortcode("version", version);
config.addShortcode("email", email);
};
2 changes: 2 additions & 0 deletions src/_flightdeck/shortcodes/buttons.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Button Component – FlightDeck Autopilot
* @description Makes a button component
* @param {Object} [params] - The parameters for the button (all optional)
* @param {string} [params.type='button'] - The type of button (submit/reset/button)
* @param {string} [params.text='Button'] - The text to display in the button
Expand All @@ -13,6 +14,7 @@ const button = (params = {}) => {

/**
* Button Component for Links – FlightDeck Autopilot
* @description Makes a link look like a button
* @param {Object} [params] - The parameters for the link button (all optional)
* @param {string} [params.url='/'] - The link to a page or external URL
* @param {string} [params.text='Button'] - The text to display in the link
Expand Down
20 changes: 20 additions & 0 deletions src/_flightdeck/shortcodes/email.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Email obfuscation shortcode with CSS
* @param {Object} [params={}] - The parameters for email obfuscation
* @param {string} [params.address] - The email address to obfuscate
* @param {string} [params.honeypot='honeypot'] - The honeypot text to insert (will be hidden with CSS)
* @returns {string} HTML string with obfuscated email
* @example
* // Basic usage
* {% email address="your-email@example.com" %}
* // With custom honeypot
* {% email address="your-email@example.com", honeypot="nospam" %}
* @typedef {Object} EmailParams
* @property {string} [address] - The email address to obfuscate
* @property {string} [honeypot] - The honeypot text to insert
* @type {(params?: EmailParams) => string}
*/
module.exports = (params = {}) => {
const { address, honeypot = 'honeypot' } = params;
return `<span class="email">${address}<b>${honeypot}.com</b></span>`;
};
2 changes: 1 addition & 1 deletion src/_flightdeck/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
module.exports = (config, options) => {
config.setQuietMode(true); // reduce console
config.setServerOptions({
port: 4000, // old habits die hard - 4000 is the default port for Jekyll
port: 4321, // like Astro
showVersion: true, // show the server version number on the command line
showAllHosts: false, // show local network IP address for device testing
});
Expand Down
2 changes: 2 additions & 0 deletions src/_includes/data/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const site = {
profile: "edheltzel",
},
],
gtag: '0000000000',
env: process.env.ENV,
};

module.exports = site;
1 change: 1 addition & 0 deletions src/_includes/partials/footer.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
{{ site.title }}&nbsp;•&nbsp;<a
href="https://github.com//edheltzel/flightdeck/"
title="{{ site.title }} version" >{% version %}</a>
• {% email address="email@example.com", honeypot="nospam" %}
</small>
</footer>
3 changes: 3 additions & 0 deletions src/_includes/partials/meta.njk
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
<meta rel="canonical" href="{{ page.url | baseUrl }}"/>
<link rel="stylesheet" href="/assets/styles/app.css"/>
<script type="module" src="/assets/js/app.js" defer></script>
{% if site.env === "production" %}
{% include "utilities/analytics.njk" %}
{% endif %}
5 changes: 2 additions & 3 deletions src/_includes/utilities/analytics.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- macro gtagId(gtag) -%}

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ gtag }}"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.gtag }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
Expand All @@ -10,4 +10,3 @@

gtag('config', '{{ gtag }}');
</script>
{%- endmacro -%}
4 changes: 4 additions & 0 deletions src/assets/styles/_autopilot/_utilities/text.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ font: transform text display properties
font-size: var(--text-poster-l);
}
}

.email b{
display: none;
}