Skip to content

Commit

Permalink
✅ stable version
Browse files Browse the repository at this point in the history
  • Loading branch information
jamerrq committed Jan 23, 2024
1 parent 7bb2917 commit 09b74b5
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 62 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"astro": "astro",
"lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,astro}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\"",
"check-tsx": "tsc --noEmit --skipLibCheck --project tsconfig.json",
"local-build-and-preview": "bun lint && bun run build && bun run preview"
"local-build-and-preview": "bun lint && bun check-tsx && bun run build && bun run preview"
},
"type": "module",
"devDependencies": {
Expand Down
23 changes: 14 additions & 9 deletions src/components/blog/last-entries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,20 @@ export default function LastEntries({ lang = 'en' }: { lang?: string }) {
<li class='font-merriweather text-sm xl:text-base text-center'>
{entry.date}
</li>
<li class='font-merriweather text-sm xl:text-base dark:bg-emerald-900 bg-emerald-300 py-1 px-2 rounded-sm cursor-pointer hover:scale-[1.02] transition-all ease-in-out flex flex-col gap-2'>
<a href={`${lang === 'en' ? entry.href : entry.hrefEs}`}>
{lang === 'en' ? entry.title : entry.titleEs}
</a>
<div>
<ReadTimeBadge readTime={entry.readTimeMins} lang={lang} />
</div>
<Badges badges={entry.tags} />
</li>
<a href={`${lang === 'en' ? entry.href : entry.hrefEs}`}>
<li class='font-merriweather text-sm xl:text-base dark:bg-emerald-900 bg-emerald-300 py-1 px-2 rounded-sm cursor-pointer hover:scale-[1.02] transition-all ease-in-out flex flex-col gap-2 border'>
<div class='flex flex-col xl:flex-row gap-1'>
<span>{lang === 'en' ? entry.title : entry.titleEs}</span>
<div class='xl:ml-auto'>
<ReadTimeBadge
readTime={entry.readTimeMins}
lang={lang}
/>
</div>
</div>
<Badges badges={entry.tags} />
</li>
</a>
</Fragment>
)
})}
Expand Down
3 changes: 2 additions & 1 deletion src/components/main/buttons.astro
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ import Translator from '@components/icons/translator.astro'
import Shuffle from '@components/icons/shuffle.astro'
import GoBack from '@components/icons/go-back.astro'
console.log(process.env.NODE_ENV)
const BOARD_BUTTON_STYLE =
process.env.NODE_ENV === 'development' ? '' : 'hidden'
process.env.NODE_ENV === 'development' ? 'hidden' : 'hidden'
// {SVGS_STYLES}
const SVGS_STYLES = [
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/working-on.astro
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const { lang = 'en' }: Props = Astro.props
</span>
<span>
<!-- 5+ months -->
{lang === 'en' ? '5+ months' : '5+ meses'}
{lang === 'en' ? '6+ months' : '6+ meses'}
</span>
<span>
<!-- Repository -->
Expand Down
14 changes: 11 additions & 3 deletions src/data/blog.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"titleEs": "El proceso de crear este sitio web con Astro y Tailwind CSS",
"href": "blog/building-this-website",
"hrefEs": "blog/acerca-de-esta-web",
"readTimeMins": "5",
"readTimeMins": "15",
"tags": [
"astro",
"tailwindcss",
Expand All @@ -15,11 +15,19 @@
]
},
{
"title": "5+ years using Linux: My experience and setup",
"title": "5+ years using Linux: My experience and current setup",
"date": "2024-Jan-16",
"titleEs": "5+ años usando Linux: Mi experiencia y configuración actual",
"href": "5-years-using-linux",
"hrefEs": "60-meses-con-linux"
"hrefEs": "60-meses-con-linux",
"readTimeMins": "10",
"tags": [
"linux",
"ubuntu",
"zsh",
"i3wm",
"vim"
]
},
{
"title": "Projects to develop in 2024",
Expand Down
13 changes: 13 additions & 0 deletions src/data/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@
{
"title": "Color Palettes",
"website": "https://colorhunt.co/"
},
{
"title": "Awesome Lists",
"repository": "https://github.com/sindresorhus/awesome"
},
{
"title": "Oh My Zsh",
"website": "https://ohmyz.sh/",
"repository": "https://github.com/ohmyzsh/ohmyzsh"
},
{
"title": "Multithreading Tutorials",
"repository": "https://github.com/thanhit95/multi-threading"
}
]
}
11 changes: 11 additions & 0 deletions src/layouts/layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ const BODY_CLASS = import.meta.env.MODE === 'development' ? 'debug-screens' : ''
lightIcon.classList.remove('hidden')
// en caso que se haya configurado previamente
document.documentElement.classList.add('dark')
// remover la clase light si está presente
document.documentElement.classList.remove('light')
} else {
darkIcon.classList.remove('hidden')
// en caso que se haya configurado previamente
document.documentElement.classList.add('light')
// remover la clase dark si está presente
document.documentElement.classList.remove('dark')
}

const themeToggleBtn = document.getElementById('theme-toggle')
Expand All @@ -102,18 +108,23 @@ const BODY_CLASS = import.meta.env.MODE === 'development' ? 'debug-screens' : ''
if (localStorage.getItem('color-theme')) {
if (localStorage.getItem('color-theme') === 'light') {
document.documentElement.classList.add('dark')
// remover la clase light si está presente
document.documentElement.classList.remove('light')
localStorage.setItem('color-theme', 'dark')
} else {
document.documentElement.classList.remove('dark')
// remover la clase dark si está presente
localStorage.setItem('color-theme', 'light')
}

// se comprueba si el sistema operativo tiene configurado el tema oscuro
} else if (document.documentElement.classList.contains('dark')) {
document.documentElement.classList.remove('dark')
document.documentElement.classList.add('light')
localStorage.setItem('color-theme', 'light')
} else {
document.documentElement.classList.add('dark')
document.documentElement.classList.remove('light')
localStorage.setItem('color-theme', 'dark')
}
})
Expand Down
Loading

0 comments on commit 09b74b5

Please sign in to comment.