Skip to content

Commit

Permalink
feat: new blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
GonzaloHirsch committed Mar 29, 2024
1 parent e92ca32 commit 30b1d7d
Show file tree
Hide file tree
Showing 9 changed files with 799 additions and 6 deletions.
12 changes: 6 additions & 6 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,20 @@ body {

/* Blog Links */

.blog-content :not(h1):not(h2):not(h3):not(h4):not(h5) a {
.blog-content :not(h1):not(h2):not(h3):not(h4):not(h5) > a {
@apply underline font-bold;
}

.blog-content :not(h1):not(h2):not(h3):not(h4):not(h5) a:hover {
.blog-content :not(h1):not(h2):not(h3):not(h4):not(h5) > a:hover {
@apply text-brand_primary_light dark:text-brand_primary_dark;
}

/* Blog Headings */

.blog-content h2:hover ::after,
.blog-content h3:hover ::after,
.blog-content h4:hover ::after,
.blog-content h5:hover ::after {
.blog-content *:not(.no-anchor) > h2:hover ::after,
.blog-content *:not(.no-anchor) > h3:hover ::after,
.blog-content *:not(.no-anchor) > h4:hover ::after,
.blog-content *:not(.no-anchor) > h5:hover ::after {
@apply ml-2 opacity-40 text-brand_secondary_light dark:text-brand_secondary_dark absolute;
content: '#';
}
Expand Down
8 changes: 8 additions & 0 deletions components/content/BackToBasics.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- components/content/Card.vue -->
<template>
<div
class="pb-4 pt-4 mt-6 border-t-2 border-b-2 border-typography_primary_light dark:border-typography_primary_dark blog-content blog-post-text"
>
<slot />
</div>
</template>
77 changes: 77 additions & 0 deletions components/content/BasicExpand.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!-- components/content/Card.vue -->
<template>
<div
class="overflow-hidden border-t border-b mt-4 border-typography_primary_light dark:border-typography_primary_dark"
>
<div
class="py-1 cursor-pointer select-none font-bold basic-expand-header flex no-anchor"
@click="() => (open = !open)"
>
<span
:class="[
'flex flex-shrink px-1 transition-transform duration-200 w-6 justify-center font-highlight text-lg',
open ? 'rotate-180 mb-[2px]' : 'rotate-0',
]"
>
{{ open ? '-' : '+' }}
</span>
<component
:is="componentType"
:id="id"
class="flex flex-grow flex-shrink"
>
{{ heading }}
</component>
</div>

<Transition name="expand">
<div class="basic-expand-content pb-2" ref="expanded" v-show="open">
<slot name="description" />
</div>
</Transition>
</div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
const open = ref(false);

const props = withDefaults(
defineProps<{
heading?: string;
componentType?: string;
}>(),
{ heading: '', componentType: 'h3' }
);

const id = props.heading
.toLowerCase()
.replace(/\s+/g, ' ')
.replace(/[^\s\w\d]/g, '')
.replace(/[^\w\d]/g, '-');
</script>

<style>
.expand-enter-active {
animation: expand reverse 200ms ease;
}
.expand-leave-active {
animation: expand 200ms ease;
}
@keyframes expand {
from {
max-height: 600px;
}
to {
max-height: 0px;
}
}

.basic-expand-header > h1,
.basic-expand-header > h2,
.basic-expand-header > h3,
.basic-expand-header > h4,
.basic-expand-header > h5 {
@apply mt-0 mb-0 text-lg;
}
</style>
6 changes: 6 additions & 0 deletions components/content/ProseCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ const languageMap: Record<string, { text: string }> = {
hcl: {
text: 'Terraform',
},
docker: {
text: 'Docker',
},
yaml: {
text: 'YAML',
},
};
const languageText = computed(() =>
Expand Down
697 changes: 697 additions & 0 deletions content/blog/nuxt-3-free-ssr-configuration.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ export default defineNuxtConfig({
'bash',
'python',
'html',
'yaml',
'hcl',
'docker',
],
},
markdown: {
Expand Down
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ module.exports = {
maxWidth: {
'8xl': '88rem',
'9xl': '96rem'
},
transitionProperty: {
'max-height': 'max-height'
}
},
},
Expand Down

0 comments on commit 30b1d7d

Please sign in to comment.