Skip to content

Commit

Permalink
add posts index as home page
Browse files Browse the repository at this point in the history
  • Loading branch information
fagnerpereira committed Oct 10, 2024
1 parent 1b17d1b commit bef807f
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 40 deletions.
161 changes: 158 additions & 3 deletions frontend/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,40 @@ video {
display: none;
}

.container {
width: 100%;
}

@media (min-width: 640px) {
.container {
max-width: 640px;
}
}

@media (min-width: 768px) {
.container {
max-width: 768px;
}
}

@media (min-width: 1024px) {
.container {
max-width: 1024px;
}
}

@media (min-width: 1280px) {
.container {
max-width: 1280px;
}
}

@media (min-width: 1536px) {
.container {
max-width: 1536px;
}
}

.prose {
color: var(--tw-prose-body);
max-width: 65ch;
Expand Down Expand Up @@ -1080,6 +1114,10 @@ video {
--tw-prose-td-borders: var(--tw-prose-invert-td-borders);
}

.relative {
position: relative;
}

.mx-auto {
margin-left: auto;
margin-right: auto;
Expand All @@ -1097,10 +1135,34 @@ video {
display: flex;
}

.hidden {
display: none;
}

.h-16 {
height: 4rem;
}

.h-5 {
height: 1.25rem;
}

.h-6 {
height: 1.5rem;
}

.w-24 {
width: 6rem;
}

.w-5 {
width: 1.25rem;
}

.w-6 {
width: 1.5rem;
}

.max-w-3xl {
max-width: 48rem;
}
Expand All @@ -1117,14 +1179,18 @@ video {
justify-content: center;
}

.justify-between {
justify-content: space-between;
}

.gap-4 {
gap: 1rem;
}

.space-x-6 > :not([hidden]) ~ :not([hidden]) {
.space-x-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(1.5rem * var(--tw-space-x-reverse));
margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
margin-right: calc(1rem * var(--tw-space-x-reverse));
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}

.space-y-4 > :not([hidden]) ~ :not([hidden]) {
Expand All @@ -1133,6 +1199,16 @@ video {
margin-bottom: calc(1rem * var(--tw-space-y-reverse));
}

.space-x-6 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(1.5rem * var(--tw-space-x-reverse));
margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
}

.rounded-md {
border-radius: 0.375rem;
}

.border {
border-width: 1px;
}
Expand All @@ -1151,6 +1227,25 @@ video {
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
}

.bg-gradient-to-r {
background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-gray-900 {
--tw-gradient-from: #111827 var(--tw-gradient-from-position);
--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.to-gray-800 {
--tw-gradient-to: #1f2937 var(--tw-gradient-to-position);
}

.px-3 {
padding-left: 0.75rem;
padding-right: 0.75rem;
}

.px-4 {
padding-left: 1rem;
padding-right: 1rem;
Expand All @@ -1175,15 +1270,29 @@ video {
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

.text-2xl {
font-size: 1.5rem;
line-height: 2rem;
}

.text-sm {
font-size: 0.875rem;
line-height: 1.25rem;
}

.font-bold {
font-weight: 700;
}

.font-medium {
font-weight: 500;
}

.text-gray-300 {
--tw-text-opacity: 1;
color: rgb(209 213 219 / var(--tw-text-opacity));
}

.text-neutral-200 {
--tw-text-opacity: 1;
color: rgb(229 229 229 / var(--tw-text-opacity));
Expand All @@ -1194,11 +1303,32 @@ video {
color: rgb(163 163 163 / var(--tw-text-opacity));
}

.text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}

.antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.shadow-md {
--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

.transition-colors {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}

.duration-300 {
transition-duration: 300ms;
}

body {
font-family: 'Cascadia Code', sans-serif;
}
Expand All @@ -1208,18 +1338,43 @@ body {
background-color: rgb(38 38 38 / var(--tw-bg-opacity));
}

.hover\:text-gray-300:hover {
--tw-text-opacity: 1;
color: rgb(209 213 219 / var(--tw-text-opacity));
}

.hover\:text-white:hover {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}

.focus\:text-white:focus {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}

.focus\:outline-none:focus {
outline: 2px solid transparent;
outline-offset: 2px;
}

@media (min-width: 640px) {
.sm\:px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
}

@media (min-width: 768px) {
.md\:flex {
display: flex;
}

.md\:hidden {
display: none;
}
}

@media (min-width: 1024px) {
.lg\:px-8 {
padding-left: 2rem;
Expand Down
8 changes: 4 additions & 4 deletions src/_partials/_footer.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
footer
|> Contact me at
a href="mailto:#{metadata.email}"
= metadata.email
/ footer
/ |> Contact me at
/ a href="mailto:#{metadata.email}"
/ = metadata.email
16 changes: 8 additions & 8 deletions src/_partials/_navbar.slim
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
nav class="py-4 border-b border-neutral-700"
ul class="flex space-x-6"
/ li
/ a href=relative_url('/') class="text-neutral-200 hover:text-white" Home
/ li
/ a href=relative_url('/about') class="text-neutral-200 hover:text-white" About
li
a href=relative_url('/posts') class="text-neutral-200 hover:text-white" Posts
/ nav class="py-4 border-b border-neutral-700"
/ ul class="flex space-x-6"
/ li
/ a href=relative_url('/') class="text-neutral-200 hover:text-white" Home
/ li
/ a href=relative_url('/about') class="text-neutral-200 hover:text-white" About
/ li
/ a href=relative_url('/posts') class="text-neutral-200 hover:text-white" Posts
4 changes: 1 addition & 3 deletions src/_posts/2024-10-06-rails-updating-attributes-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ date: 2024-10-05 02:47:16 -0300
categories: updates
---

## Guide to update attributes in rails
## Update ActiveRecord Objects Guide

Everytime I have to implement some specific attribute update I search on google about how to use `update`, `update_attribute`, `update_attributes`, or `update_columns`. I know it seens silly, but if you dont really understand how to use each one you are going to face some bad surprises as me.

## Setting Up Our Example

Let's start by creating a `User` model that we'll use as a base to explain each update method:

```ruby
Expand Down
22 changes: 0 additions & 22 deletions src/index.md

This file was deleted.

File renamed without changes.

0 comments on commit bef807f

Please sign in to comment.