Skip to content

Template filter #451

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

Merged
merged 53 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
249f363
Add new recipe
BoDonkey Apr 11, 2025
725f86f
Doc frontmatter and filter changes
BoDonkey Apr 14, 2025
0066fe1
add series page numbers
BoDonkey Apr 24, 2025
b5bfe44
Filter refinement
BoDonkey Apr 25, 2025
18613d4
styles
stuartromanek May 7, 2025
46783b8
remove arrow
stuartromanek May 7, 2025
161121a
Merge branch 'main' into template-filter
BoDonkey May 8, 2025
5bd2480
Stop tracking version.json
BoDonkey May 8, 2025
0a0cd77
Fixes CTA button prop value
BoDonkey May 8, 2025
98891f3
sidebar refinement and landing pages
agilbert May 14, 2025
cbce843
examples for refined tutorials landing page and pro landing page
agilbert May 14, 2025
cc9809f
Merge pull request #456 from apostrophecms/template-filter-nav-updates
BoDonkey May 15, 2025
ef260b3
Add doc on integrating a support desk button.
BoDonkey May 19, 2025
4effe83
Adds frontmatter
BoDonkey May 19, 2025
6db2bdf
Further itteration
BoDonkey May 20, 2025
9e873ef
Fix width
BoDonkey May 21, 2025
a45466b
Update notes and correct formatting
BoDonkey May 21, 2025
271a634
Update tutorial with working example
BoDonkey May 22, 2025
71a1412
Merge branch 'main' into template-filter
BoDonkey May 22, 2025
82c3071
Add responses to second comments
BoDonkey May 23, 2025
ddc5a6f
Merge pull request #460 from apostrophecms/PRO-7659-support-desk
BoDonkey May 23, 2025
0c3be48
Adds doc to correct branch
BoDonkey May 27, 2025
961bad8
Add to sidebar
BoDonkey May 27, 2025
f4caef0
Merge pull request #463 from apostrophecms/template-filters-updates
BoDonkey May 27, 2025
e2979e1
Adds fallback note
BoDonkey May 28, 2025
a7837ea
Add notes
BoDonkey May 28, 2025
922684c
Merge pull request #464 from apostrophecms/pro-7509-brand-colors
BoDonkey May 30, 2025
b913e6b
Slight text changes
BoDonkey Jun 3, 2025
c2c2d4e
initial frontmatter
BoDonkey Jun 6, 2025
b1523d5
Add more messaging on CSS variables
BoDonkey Jun 9, 2025
6e4c9c8
Initial addition of content
BoDonkey Jun 9, 2025
ef46475
Update sections
BoDonkey Jun 10, 2025
c4ee820
Merge pull request #470 from apostrophecms/pro-7705-assembly
BoDonkey Jun 11, 2025
bcc615b
Template section update
BoDonkey Jun 12, 2025
ba98886
Add note link
BoDonkey Jun 12, 2025
8a1d1c2
Correct comment format
BoDonkey Jun 12, 2025
a3e24f8
Add note about disabling fields
BoDonkey Jun 12, 2025
58cbdd3
Merge pull request #466 from apostrophecms/pro-7509-update-with-video
BoDonkey Jun 12, 2025
7087370
Merge branch 'feature/snippets' into template-filter
BoDonkey Jun 20, 2025
c8c0b15
Adds brand colors video
BoDonkey Jun 20, 2025
7a38cc4
Remove dead link
BoDonkey Jun 20, 2025
923d5bd
Add support desk tut to sidebar
BoDonkey Jun 20, 2025
24839dc
Minimal SEO changes
BoDonkey Jun 23, 2025
68be1bf
Correct video language and info box
BoDonkey Jun 23, 2025
ccc4d58
Merge pull request #474 from apostrophecms/improve-head-seo
BoDonkey Jun 23, 2025
6d43a48
Update TOC and file pointer
BoDonkey Jun 23, 2025
051059a
Adds frontmatter and refactor
BoDonkey Jun 23, 2025
776b9d5
Response to first comments
BoDonkey Jun 24, 2025
ee0b7b0
Merge pull request #475 from apostrophecms/pro-7450-linking-modules
BoDonkey Jun 24, 2025
3e5f737
Initial content
BoDonkey Jun 25, 2025
7943e88
Content massage
BoDonkey Jun 25, 2025
409bc7c
Response to first comments
BoDonkey Jun 25, 2025
154d1aa
Merge pull request #477 from apostrophecms/pro-7502-responsive-design
BoDonkey Jun 25, 2025
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.DS_Store
docs/.vitepress/cache
docs/.vitepress/dist
version.json

docs/public/version.json
Empty file.
268 changes: 204 additions & 64 deletions docs/.vitepress/components/AposCtaButton.vue
Original file line number Diff line number Diff line change
@@ -1,93 +1,233 @@
<template>
<div
class="cta-button tip custom-block"
@click="navigate"
@keydown.enter.prevent="handleEnter"
@keydown.space.prevent="handleSpace"
:class="{ 'clickable': url }"
role="button"
tabindex=0
>
<p class="cta-button__detail-heading">{{ detailHeading }}</p>
<p class="cta-button__title">{{ title }}</p>
<p>{{ content }}<span v-if="url"> &#8594</span> </p>
</div>
</template>

<script>
export default {
props: {
detailHeading: String,
title: String,
content: String,
url: {
type: String,
default: null,
}
<div class="cta-button tip custom-block" @click="navigate" @keydown.enter.prevent="handleEnter"
@keydown.space.prevent="handleSpace" :class="{ 'clickable': url }" :role="url ? 'button' : undefined" :tabindex="url ? 0 : undefined">
<!-- Tags at the top -->
<div class="tags-container">
<span class="tag tag--type" v-if="cardType">
{{ cardType }}
</span>
<span class="tag tag--topic" v-if="cardTopic">
{{ cardTopic }}
</span>
</div>

<p class="cta-button__title">{{ title }}</p>
<p class="cta-button__content">{{ content }}</p>

<div class="details">
<!-- Series indicator -->
<span class="tag tag--series" v-if="isSeries">
<InlineSvg src="/images/icons/stack.svg" class="icon" />
{{ seriesCount }} Part Series
</span>
<!-- Experience level with dots - only show if cardEffort has a valid value -->
<div class="tag tag--effort effort-indicator" v-if="shouldShowEffort">
<span class="effort-badge">
<span class="effort-dots">
<span v-for="n in 3" :key="n" class="effort-dot" :class="{
'effort-dot--filled': n <= getLevelDots(cardEffort),
'effort-dot--empty': n > getLevelDots(cardEffort)
}"></span>
</span>
{{ cardEffort }}
</span>
</div>
</div>
</div>
</template>

<script setup>
import InlineSvg from 'vue-inline-svg';
import { computed } from 'vue';
const props = defineProps({
cardType: String,
cardTopic: String,
cardEffort: String,
title: String,
content: String,
url: {
type: String,
default: null,
},
methods: {
navigate() {
if (this.url) {
window.location.href = this.url;
}
},
handleEnter() {
this.navigate();
},
handleSpace(event) {
if (event.target === event.currentTarget) {
this.navigate();
}
},
isSeries: {
type: Boolean,
default: false
},
seriesCount: {
type: Number,
default: 1
},
hideEffort: {
type: Boolean,
default: false
}
}
</script>

<style scoped>
.cta-button {
height: 100%;
transition: background-color 0.2s, color 0.2s, border-color 0.2s;
border: 1px solid var(--vp-c-divider);
background-color: transparent;
color: var(--vp-c-text-1);
font-size: 14px;
}
});

const navigate = () => {
if (props.url) {
window.location.href = props.url;
}
};
const handleEnter = () => {
navigate();
};
const handleSpace = (event) => {
if (event.target === event.currentTarget) {
navigate();
}
};
const getLevelDots = (cardEffort) => {
switch (cardEffort?.toLowerCase()) {
case 'beginner':
case 'easy':
return 1;
case 'medium':
case 'intermediate':
return 2;
case 'advanced':
return 3;
default:
return 0;
}
};

// Computed property to determine if effort badge should be shown
const shouldShowEffort = computed(() => {
if (props.hideEffort) return false;
if (!props.cardEffort) return false;
return getLevelDots(props.cardEffort) > 0;
});
</script>

.cta-button__detail-heading {
<style lang="scss" scoped>
.cta-button {
height: 100%;
display: flex;
flex-direction: column;
transition: background-color 0.2s, color 0.2s, border-color 0.2s;
border: 1px solid var(--vp-c-divider);
background-color: transparent;
color: var(--vp-c-text-1);
font-size: 14px;
position: relative;

&__detail-heading {
color: var(--vp-c-text-2);
font-size: 14px;
font-weight: 600;
margin-bottom: 12px;
}

.cta-button__title {
color: var(--vp-c-text-1);
&__title {
color: var(--vp-c-text-1);
font-size: 18px;
font-weight: 600;
margin-bottom: 16px;
}

.clickable {
&__content {
margin: 0;
flex: 1;
}

&__arrow {
display: inline-block;
}

&.clickable {
cursor: pointer;
}
.cta-button:not(.clickable) {

&:not(.clickable) {
cursor: default;
}

@media (min-width: 960px) {
.cta-button.clickable:hover {
&.clickable:hover {
border: 1px solid var(--vp-custom-block-tip-border);
background-color: var(--vp-custom-block-tip-bg);
}
}

@media (max-width: 959px) {
.cta-button {
margin-bottom: 0;
margin-top: 0;
}
margin-bottom: 0;
margin-top: 0;
}
}

// Tags container
.tags-container,
.details {
display: flex;
gap: 8px;
margin-bottom: 0.5rem;
}

// Tag styles
.tag {
display: flex;
gap: 5px;
border-radius: 5px;
padding: 0 0.5rem; // px-2 py-1
height: 24px;
font-size: 0.6rem;
font-weight: 600; // font-semibold
text-transform: uppercase;
letter-spacing: 0.5px;
background-color: rgb(238, 238, 238);
border-width: 1px;
border-style: solid;
border-color: oklch(87% 0 0); // bg-neutral-300

/* DARK */
</style>
.icon {
width: 12px;
}

&--type {
background-color: rgba(219, 234, 254, 1); // bg-blue-100
color: rgba(30, 58, 138, 1); // text-blue-900
border-color: oklch(88.2% 0.059 254.128); // bg-blue-200
}

&--topic {
background-color: rgba(254, 243, 199, 1); // bg-yellow-100
color: rgba(146, 64, 14, 1); // text-yellow-800
border-color: oklch(94.5% 0.129 101.54); // bg-yellow-200
}
}

// Effort indicator
.effort-indicator {
color: rgba(17, 24, 39, 1); // text-gray-900
display: flex;
align-items: center;
gap: 0.5rem; // gap-2

.effort-badge {
display: flex;
align-items: center;

.effort-dots {
margin-right: 0.5rem; // mr-2
display: flex;
align-items: center;
gap: 0.25rem; // gap-1

.effort-dot {
width: 0.5rem; // w-2
height: 0.5rem; // h-2
border-radius: 9999px; // rounded-full

&--filled {
background-color: rgba(16, 185, 129, 1); // bg-green-500
background-color: oklch(69.6% 0.17 162.48); // bg-emerald-600
}

&--empty {
background-color: oklch(70.7% 0.022 261.325); // bg-gray-400
}
}
}
}
}
</style>
Loading