migrate form gatsby to astro
This commit is contained in:
parent
09ce5d8009
commit
a7a623f425
BIN
src/assets/12561.png
Normal file
BIN
src/assets/12561.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 684 KiB |
BIN
src/assets/image1.png
Normal file
BIN
src/assets/image1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
BIN
src/assets/image2.png
Normal file
BIN
src/assets/image2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 267 KiB |
BIN
src/assets/mm_food_DOOM.png
Normal file
BIN
src/assets/mm_food_DOOM.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
0
src/components/Base.astro
Normal file
0
src/components/Base.astro
Normal file
90
src/components/CodeBlock.astro
Normal file
90
src/components/CodeBlock.astro
Normal file
@ -0,0 +1,90 @@
|
||||
---
|
||||
interface Props {
|
||||
class?: string;
|
||||
style?: string;
|
||||
tabindex?: string;
|
||||
'data-language'?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
const props = Astro.props;
|
||||
const uniqueId = `code-${Math.random().toString(36).substr(2, 9)}`;
|
||||
---
|
||||
|
||||
<div class="code-block-wrapper" data-code-id={uniqueId}>
|
||||
<button class="copy-button" data-copy-btn={uniqueId}>
|
||||
Copy
|
||||
</button>
|
||||
<pre {...props}><slot /></pre>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.code-block-wrapper {
|
||||
position: relative;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.copy-button {
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
right: 0.5rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 4px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
font-size: 0.875rem;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s, background-color 0.2s;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.code-block-wrapper:hover .copy-button {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.copy-button:hover {
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.copy-button.copied {
|
||||
background-color: rgba(34, 197, 94, 0.3);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function setupCopyButtons() {
|
||||
const buttons = document.querySelectorAll('[data-copy-btn]');
|
||||
|
||||
buttons.forEach((button) => {
|
||||
if (button.hasAttribute('data-initialized')) return;
|
||||
button.setAttribute('data-initialized', 'true');
|
||||
|
||||
button.addEventListener('click', async () => {
|
||||
const wrapper = button.closest('.code-block-wrapper');
|
||||
const pre = wrapper?.querySelector('pre');
|
||||
const code = pre?.textContent || '';
|
||||
|
||||
try {
|
||||
await navigator.clipboard.writeText(code);
|
||||
button.textContent = 'Copied!';
|
||||
button.classList.add('copied');
|
||||
|
||||
setTimeout(() => {
|
||||
button.textContent = 'Copy';
|
||||
button.classList.remove('copied');
|
||||
}, 2000);
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err);
|
||||
button.textContent = 'Failed';
|
||||
setTimeout(() => {
|
||||
button.textContent = 'Copy';
|
||||
}, 2000);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
setupCopyButtons();
|
||||
document.addEventListener('astro:page-load', setupCopyButtons);
|
||||
</script>
|
||||
@ -5,81 +5,109 @@ import HeaderLink from './HeaderLink.astro';
|
||||
|
||||
<header>
|
||||
<nav>
|
||||
<h2><a href="/">{SITE_TITLE}</a></h2>
|
||||
<div class="internal-links">
|
||||
<HeaderLink href="/">Home</HeaderLink>
|
||||
<HeaderLink href="/blog">Blog</HeaderLink>
|
||||
<HeaderLink href="/about">About</HeaderLink>
|
||||
</div>
|
||||
<div class="social-links">
|
||||
<a href="https://m.webtoo.ls/@astro" target="_blank">
|
||||
<span class="sr-only">Follow Astro on Mastodon</span>
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32"
|
||||
><path
|
||||
fill="currentColor"
|
||||
d="M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765c0 0-2.285 1.017-2.285 4.488l-.002.662c-.004.64-.007 1.35.011 2.091.083 3.394.626 6.74 3.78 7.57 1.454.383 2.703.463 3.709.408 1.823-.1 2.847-.647 2.847-.647l-.06-1.317s-1.303.41-2.767.36c-1.45-.05-2.98-.156-3.215-1.928a3.614 3.614 0 0 1-.033-.496s1.424.346 3.228.428c1.103.05 2.137-.064 3.188-.189zm1.613-2.47H11.13v-4.08c0-.859-.364-1.295-1.091-1.295-.804 0-1.207.517-1.207 1.541v2.233H7.168V5.89c0-1.024-.403-1.541-1.207-1.541-.727 0-1.091.436-1.091 1.296v4.079H3.197V5.522c0-.859.22-1.541.66-2.046.456-.505 1.052-.764 1.793-.764.856 0 1.504.328 1.933.983L8 4.39l.417-.695c.429-.655 1.077-.983 1.934-.983.74 0 1.336.259 1.791.764.442.505.661 1.187.661 2.046v4.203z"
|
||||
></path></svg
|
||||
>
|
||||
</a>
|
||||
<a href="https://twitter.com/astrodotbuild" target="_blank">
|
||||
<span class="sr-only">Follow Astro on Twitter</span>
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32"
|
||||
><path
|
||||
fill="currentColor"
|
||||
d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z"
|
||||
></path></svg
|
||||
>
|
||||
</a>
|
||||
<a href="https://github.com/withastro/astro" target="_blank">
|
||||
<span class="sr-only">Go to Astro's GitHub repo</span>
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32"
|
||||
><path
|
||||
fill="currentColor"
|
||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
|
||||
></path></svg
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-container nav-container-md">
|
||||
<div class="nav-container nav-item nav-item-10">
|
||||
<h4>
|
||||
<HeaderLink
|
||||
href="/"
|
||||
class="LinkText"
|
||||
>
|
||||
Home
|
||||
</Link>
|
||||
</h4>
|
||||
{/* <h4 class="divider">/</h4>
|
||||
<h4>
|
||||
<Link
|
||||
to="/about"
|
||||
class="LinkText"
|
||||
>
|
||||
Games
|
||||
</Link>
|
||||
</h4>
|
||||
<h4 class="divider">/</h4>
|
||||
<h4>
|
||||
<Link
|
||||
to="/about"
|
||||
class="LinkText"
|
||||
>
|
||||
Gallery
|
||||
</Link>
|
||||
</h4> */}
|
||||
<h4>
|
||||
<HeaderLink
|
||||
href="/about"
|
||||
class="LinkText"
|
||||
>
|
||||
About
|
||||
</Link>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<style>
|
||||
header {
|
||||
margin: 0;
|
||||
padding: 0 1em;
|
||||
background: white;
|
||||
box-shadow: 0 2px 8px rgba(var(--black), 5%);
|
||||
}
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 1em;
|
||||
}
|
||||
.HeaderBlock {
|
||||
padding-top: 15%;
|
||||
margin-bottom: 4%;
|
||||
}
|
||||
|
||||
h2 a,
|
||||
h2 a.active {
|
||||
text-decoration: none;
|
||||
}
|
||||
nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
nav a {
|
||||
padding: 1em 0.5em;
|
||||
color: var(--black);
|
||||
border-bottom: 4px solid transparent;
|
||||
text-decoration: none;
|
||||
}
|
||||
nav a.active {
|
||||
text-decoration: none;
|
||||
border-bottom-color: var(--accent);
|
||||
}
|
||||
.social-links,
|
||||
.social-links a {
|
||||
display: flex;
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
.social-links {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.LinkText {
|
||||
color: #eeeeee;
|
||||
text-decoration: none;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.LinkText:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.nav-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.nav-container .nav-item-10 {
|
||||
flex-grow: 0;
|
||||
max-width: 83.333333%;
|
||||
flex-basis: 83.333333%;
|
||||
}
|
||||
|
||||
.nav-container .nav-item-10 .divider {
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
color: #eeeeee;
|
||||
}
|
||||
|
||||
.nav-container .nav-item {
|
||||
margin: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 48em) {
|
||||
.HeaderBlock {
|
||||
padding-top: 4em;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media (min-width: 960px) {
|
||||
.nav-container-md {
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
flex-basis: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 500px) {
|
||||
.LinkText {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.divider {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -16,6 +16,7 @@ const isActive = href === pathname || href === '/' + (subpath?.[0] || '');
|
||||
a {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
a.active {
|
||||
font-weight: bolder;
|
||||
|
||||
22
src/components/IssoComment.astro
Normal file
22
src/components/IssoComment.astro
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
interface Props {
|
||||
postId: string;
|
||||
}
|
||||
|
||||
const { postId } = Astro.props;
|
||||
---
|
||||
|
||||
<section id="isso-thread" data-post-id={postId}>
|
||||
<noscript>Javascript needs to be activated to view comments.</noscript>
|
||||
</section>
|
||||
|
||||
<script
|
||||
is:inline
|
||||
data-isso="//comments.nochill.in/"
|
||||
src="//comments.nochill.in/js/embed.min.js"
|
||||
data-isso-css="false"
|
||||
></script>
|
||||
|
||||
<style is:global>
|
||||
@import '../styles/isso.css';
|
||||
</style>
|
||||
@ -1,5 +1,5 @@
|
||||
// Place any global data in this file.
|
||||
// You can import this data from anywhere in your site by using the `import` keyword.
|
||||
|
||||
export const SITE_TITLE = 'Astro Blog';
|
||||
export const SITE_DESCRIPTION = 'Welcome to my website!';
|
||||
export const SITE_TITLE = 'My-konos';
|
||||
export const SITE_DESCRIPTION = 'WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME WELCOME';
|
||||
|
||||
@ -13,6 +13,7 @@ const blog = defineCollection({
|
||||
pubDate: z.coerce.date(),
|
||||
updatedDate: z.coerce.date().optional(),
|
||||
heroImage: image().optional(),
|
||||
archived: z.boolean().default(false)
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
52
src/content/blog/2021-01-20-Supervillain.mdx
Normal file
52
src/content/blog/2021-01-20-Supervillain.mdx
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
title: "Supervillain"
|
||||
description: "My Favorite Supervillain Music"
|
||||
pubDate: "2020.01.20"
|
||||
tags: ["Music"]
|
||||
archived: true
|
||||
---
|
||||
|
||||
---
|
||||
title: "Snail Sort"
|
||||
description: "Snail Sort Algorithm in Rust"
|
||||
pubDate: "July 13, 2022"
|
||||
tags: ["Rust", "Algorithms"]
|
||||
archive: false
|
||||
---
|
||||
|
||||
|
||||
I got hooked into hip-hop after i watched Straight Outta Compton movie.
|
||||
because of that movie i started to listen pac biggie snoop dre eminem rakim, slick, yada yada
|
||||
but i heavily listened to kendrick and j cole at that time, it was mostly songs from To pimp and butterfly and 4 your eyez only, since it came out in 2015.7:52
|
||||
at first i only listened to the sound of the instrument.
|
||||
|
||||
<br/>
|
||||
|
||||
Daniel Dumile also known as MF DOOM,King Ghidrah, Zev Love, DOOM, Viktor Vaughn is one of the most legendary MC in the world.
|
||||
i've been DOOM fan since i was a teenager.Hes one of my favorite MCs who brought me to hip hop music when my friends are listening to pop-punk, rock, pop, EDM and metal.
|
||||
|
||||
|
||||
my first DOOM song was Accordion
|
||||
|
||||
<p style={{ textAlign: 'center' }}>
|
||||
<iframe src="https://open.spotify.com/embed/track/5jAvbp8kEnRPToi4Bzcvzt?si=9f4dbnThS22Avmvn7O3lhg"
|
||||
width="400" height="80" frameborder="0" allowtrasparency="true" allow="encrypted-media"
|
||||
></iframe>
|
||||
</p>
|
||||
|
||||
i discovered this song by accident
|
||||
i was looking for an new hip hop songs that i want to listen
|
||||
i was watching to Rage Against the Machine - Killing In The Name Live Of on youtube
|
||||
there was no autoplay back then, i belive it was mid 2015.
|
||||
so after the song stopped i had to scroll the "other video" section to start another videos.
|
||||
so, i scrolled the section and it was there "Madvillain Accordion".i was intrigued with the thumbnail of the videos
|
||||
i was like "What's this dude with a mask on , and it has like 4-5m views...well lets try to listened to it i guess"
|
||||
after i listened to it, i cant stop it
|
||||
its so goddamn good
|
||||
the melody, bass, kick, and it has an accordion sound too
|
||||
i was like "goddamn ive never heard this kind of music"
|
||||
my first impression of this song is mainly because of the sounds of the instrument not the vocals
|
||||
|
||||
after i listened this song 3 times i want to know the lyrics cause i wasnt good at english(well right now my engilsh havent get better either)
|
||||
so i played the music and then i read the lyrics at same time, and when i read the lyrics at the beginning till the end of the song i was like
|
||||
"wtf is this rhyme, this wordplay is crazy"
|
||||
37
src/content/blog/2021-03-04-Rust-DataType.mdx
Normal file
37
src/content/blog/2021-03-04-Rust-DataType.mdx
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "Rust I"
|
||||
pubDate: "2020.03.04"
|
||||
description: "Data Types in Rust"
|
||||
archived: true
|
||||
tags: ["Rust", "Algorithms"]
|
||||
---
|
||||
|
||||
so i tried to implement insertion sort using rust, why ? im bored but i find something interesting stuff
|
||||
|
||||
```rs
|
||||
let mut arr = [5,3,2,4,1,6];
|
||||
for n in 1..arr.len() {
|
||||
let key = arr[n];
|
||||
let mut i = n - 1;
|
||||
while i >= 0 && arr[i] > key {
|
||||
arr[(i+1)] = arr[i];
|
||||
i -= 1;
|
||||
}
|
||||
arr[(i+1)] = key;
|
||||
}
|
||||
println!('{:?}', arr);
|
||||
```
|
||||
|
||||
it's basic stuff no sugarcoated , buuuut it failed of course it and the compiler said
|
||||
```
|
||||
warning: comparison is useless due to type limits
|
||||
--> insertion_sort.rs:26:11
|
||||
|
|
||||
26 | while i >= 0 && arr2[i] > key {
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `#[warn(unused_comparisons)]` on by default
|
||||
```
|
||||
|
||||
well my lil snailass brain thought "unused comparison??!! what ?
|
||||
|
||||
13
src/content/blog/2021-09-30-Daily-Website.mdx
Normal file
13
src/content/blog/2021-09-30-Daily-Website.mdx
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "Web Surfing"
|
||||
description: "My Daily Website"
|
||||
pubDate: "2021.09.30"
|
||||
tags: ["Web", "Productivity"]
|
||||
archived: true
|
||||
---
|
||||
|
||||

|
||||
|
||||
I start to log all website that i surfed, might be useful who knows [here](https://pear-vase-c18.notion.site/Daily-Website-25acb3b7241648218c051e4eb503e72a "DEEZ")
|
||||
|
||||
and some intresting sites that i [bookmarked](https://pear-vase-c18.notion.site/Interesting-sites-3c8e0b02644d49569c27d8895987e34b "NUTS")
|
||||
118
src/content/blog/2022-05-13-Snail_sort.mdx
Normal file
118
src/content/blog/2022-05-13-Snail_sort.mdx
Normal file
@ -0,0 +1,118 @@
|
||||
---
|
||||
title: "Snail Sort"
|
||||
description: "Snail Sort Algorithm in Rust"
|
||||
pubDate: "July 13, 2022"
|
||||
tags: ["Rust", "Algorithms"]
|
||||
archive: false
|
||||
---
|
||||
|
||||
I was looking for some file/s on my computer, but instead i found this:
|
||||
```rs
|
||||
//main.rs
|
||||
fn main () {
|
||||
let mut res: Vec<i32> = Vec::new();
|
||||
let mut pos = "right";
|
||||
let mut vec_index = 0;
|
||||
let mut a = vec!(
|
||||
vec![ 1, 2, 3, 4, 5, 6],
|
||||
vec![20, 21, 22, 23, 24, 7],
|
||||
vec![19, 32, 33, 34, 25, 8],
|
||||
vec![18, 31, 100, 35, 26, 9],
|
||||
vec![17, 30, 29, 28, 27, 10],
|
||||
vec![16, 15, 14, 13, 12, 11],
|
||||
);
|
||||
|
||||
while a.len() != 0 {
|
||||
if pos == "right" {
|
||||
let mut temp_vec = a.clone();
|
||||
for j in 0..a[vec_index].len() {
|
||||
res.push(a[vec_index][j]);
|
||||
temp_vec[vec_index]
|
||||
.retain(|&x| x == a[vec_index][j]);
|
||||
}
|
||||
temp_vec.retain(|x| x.len() != 0 );
|
||||
a = temp_vec;
|
||||
pos = "down";
|
||||
} else if pos == "down" {
|
||||
let mut temp_vec = a.clone();
|
||||
res.push(a[vec_index][a[vec_index].len() - 1]);
|
||||
temp_vec[vec_index]
|
||||
.retain(|&x| x != a[vec_index][a[vec_index].len() - 1]);
|
||||
a = temp_vec;
|
||||
if vec_index + 1 == a.len() {
|
||||
pos = "left";
|
||||
continue;
|
||||
}
|
||||
vec_index += 1;
|
||||
} else if pos == "left" {
|
||||
let rev_temp: Vec<i32> = a[vec_index]
|
||||
.to_vec()
|
||||
.into_iter()
|
||||
.rev()
|
||||
.collect();
|
||||
for j in 0..rev_temp.len() {
|
||||
res.push(rev_temp[j]);
|
||||
}
|
||||
a.pop();
|
||||
pos = "up";
|
||||
} else if pos == "up" {
|
||||
vec_index -= 1;
|
||||
let mut temp_vec = a.clone();
|
||||
if vec_index == 0 {
|
||||
pos = "right";
|
||||
continue;
|
||||
} else {
|
||||
res.push(a[vec_index][0]);
|
||||
temp_vec[vec_index]
|
||||
.retain(|&x| x != a[vec_index][0]);
|
||||
a = temp_vec;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
println!("{:?}", res);
|
||||
}
|
||||
```
|
||||
|
||||
So...I got distracted instead of looking the file/s that I supposed to find,
|
||||
I try to refactor this code 👍.
|
||||
|
||||
Anyway this algorithm is called snailsort algorithm
|
||||
|
||||
```
|
||||
SnailSort is an algorithm that takes an array of equal-length sub-arrays and then merges them into a
|
||||
single array in a clockwise spiral, starting from the upper-left hand corner[1].
|
||||
|
||||
ex:
|
||||
[
|
||||
[1,2,3],
|
||||
[8,9,4],
|
||||
[7,6,5],
|
||||
]
|
||||
|
||||
return [1,2,3.4.5.6,7,8,9]
|
||||
```
|
||||
|
||||
|
||||
<div style={{ display: "flex", justifyContent: "center" }}>
|
||||
<img src="https://files.nochill.in/media/images.png"/>
|
||||
</div>
|
||||
|
||||
Yeah it's funny.Idk why i worked on snailsort, but i was having fun.
|
||||
<br/>
|
||||
|
||||
anyway here's the refactor [result](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f02de1004ba64cde17255802614fed82).Using Match for the routes and Enum to declare the routes avoiding hard coded way
|
||||
like ``pos="left"`` to make it looks cleaner, and i change about those clones fest
|
||||
man, damn look at those clones on my first attempt man we naruto now.Using [VecDeque](https://doc.rust-lang.org/std/collections/struct.VecDeque.html) `VecDeque<slice::Iter<i32>>`
|
||||
i can easily pop, append/extend, and other manipulation that i want.
|
||||
|
||||
<br/>
|
||||
|
||||
aaand i forgor about file/s that i supposed to looking for 💀.
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
References:
|
||||
1. [https://medium.com/@spencerwhitehead7/snail-sort-the-gimmick-sort-goat-310510814eab](https://medium.com/@spencerwhitehead7/snail-sort-the-gimmick-sort-goat-310510814eab)
|
||||
170
src/content/blog/2023-02-11-Scuffed_server.mdx
Normal file
170
src/content/blog/2023-02-11-Scuffed_server.mdx
Normal file
@ -0,0 +1,170 @@
|
||||
---
|
||||
title: "Scuffed Home Server I"
|
||||
description: "Setting up a Home Server"
|
||||
pubDate: "18 Feb 2023"
|
||||
archive: false
|
||||
tags: ["Infrastructure", "Scuffed"]
|
||||
---
|
||||
|
||||
so after new year i went back to my home, then i found an old laptop that my old brother used
|
||||
when he was a college student, so rather being dusted and forgotten like promises, imma make it to be a home server.
|
||||
|
||||
<br />
|
||||

|
||||
this bad boy have up to 12gb RAM good processor and i only need to replace the hard drive cause i expect the drive already fried
|
||||
and repaste the machine.It's [Asus X540LJ](https://icecat.biz/p/asus/x540lj-xx044t/notebooks-x540lj-xx044t-30687259.html)
|
||||
|
||||
|
||||
<br />
|
||||
my plan is to use this machine to host my website and other stuff like books, media storage, ffmpeg , etcetera etcetera
|
||||
|
||||
so i tried to turn it on, as expected the drive is dead, then i bought a new 320gb drive from facebook marketplace, i got it cheap 170.000 IDR, of course it's second hand but hey.Then i change the drive, surprise surprise there are 2 slots of 4gigs RAM, nice....i hope it's still working.
|
||||
|
||||
<br />
|
||||
## Setup
|
||||
i'm install the machine with [Debian](https://www.debian.org/download), well because it's just werkz.Then i straight checked the drive using [smartmontools](https://help.ubuntu.com/community/Smartmontools) just in case
|
||||

|
||||
Thank god, i thought i got cooked.Looks promising no errors log or whatsoever, if you want to know whats the attributes do and how to read smartmontools result you can check [S.M.A.R.T Wiki](https://en.wikipedia.org/wiki/Self-Monitoring,_Analysis_and_Reporting_Technology).
|
||||
Oh and also just in case,if you want to change wikipedia layout to old layout i found a [Tweet](https://twitter.com/Nerdwiththehat/status/1615852490355777536) that explain how to do it
|
||||
|
||||
<br />
|
||||
Okay seems pretty fine so far, then i called my [ISP](https://myrepublic.co.id/en/) for public ip and the cost for public ip is 25.000 IDR/month and 2 weeks of setup from their server, well i expect it's gonna be like 8-10 days to setup but straight 2 weeks...okay sure i guess. 2 weeks later they emailed me and the setup is done so i checked from the admin dashboard
|
||||
<br />
|
||||

|
||||
|
||||
Seems good.
|
||||
|
||||
then i'm install necessary tools like [OpenSSH](https://ubuntu.com/server/docs/service-openssh), [Docker](https://docs.docker.com/engine/), [Nginx](https://nginx.org/en/download.html), [PM2](https://pm2.io/docs/plus/overview/), [Jenkins](https://www.jenkins.io/), [nvm](https://github.com/nvm-sh/nvm), [gitea](https://gitea.io/)
|
||||
|
||||
<br/>
|
||||
i'm installed it manually, my plan is to put all the tools in container and each container connect
|
||||
each other like this [hazardous thing](https://cdn.seedno.de/txt/docker-compose.yml.html).
|
||||
i'm not gonna put it all on containers, some tools gonna build manually,
|
||||
i don't want my machine getting [cooked](https://files.nochill.in/media/DockerCompose.mp4) while building it.Well it's gonna take a lot time to make that but hey, if the warehouse somehow got exploded, it's gonna be easy to build it up again
|
||||
|
||||
<br />
|
||||
## Migrate the website
|
||||
It's time to move my [website](https://git.nochill.in/nochill/not-your-blog) from [netlify](https://www.netlify.com/) to here.
|
||||
|
||||
so i set up the nginx conf
|
||||
```
|
||||
server_name nochill.in www.nochill.in;
|
||||
|
||||
location /
|
||||
{
|
||||
proxy_pass http://localhost:3333;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
```
|
||||
|
||||
simple reverse proxy then enable https with [certbot](https://certbot.eff.org/pages/about)
|
||||
|
||||
```bash
|
||||
sudo certbot --nginx -d nochill.in -d www.nochill.in
|
||||
```
|
||||
|
||||
clone the code, build and run it with pm2 :
|
||||
```bash
|
||||
pm2 start ./node_modules/gatsby-cli/cli.js --name gatsby_blog -- serve -p 3333
|
||||
pm2 save
|
||||
```
|
||||
|
||||
## Integrate with Isso
|
||||
since i have my own server, well why not adding some stuff just to make this website load longer,
|
||||
and that's why i added a comment section with isso.[Isso](https://isso-comments.de/) is commenting server similar to [disqus](https://disqus.com/) but it allows anonymous comments and simple to use.
|
||||
if you want to install isso too, you can follow the official instruction [here](https://isso-comments.de/docs/reference/installation)
|
||||
|
||||
then create the isso configuration.Here's my configuration(just in case you want [copy paste it](https://thejh.net/misc/website-terminal-copy-paste)), for more about the [configuration](https://isso-comments.de/docs/reference/server-config/):
|
||||
```
|
||||
// isso.cfg
|
||||
[general]
|
||||
dbpath = /home/lo/App/isso/comments.db
|
||||
host = https://nochill.in/
|
||||
|
||||
[moderation]
|
||||
enabled = true
|
||||
|
||||
[admin]
|
||||
enabled=true
|
||||
password =
|
||||
|
||||
[server]
|
||||
listen = http://localhost:1234
|
||||
```
|
||||
|
||||
also i use [uWSGI](https://uwsgi-docs.readthedocs.io/en/latest/) instead of isso default webserver.Well, because uWSGI more safe and reliable
|
||||
|
||||
setup uWSGI server for isso:
|
||||
```
|
||||
// isso.ini
|
||||
[uwsgi]
|
||||
http = :1234
|
||||
master = true
|
||||
; set to `nproc`
|
||||
processes = 4
|
||||
cache2 = name=hash,items=1024,blocksize=32
|
||||
module = isso.run
|
||||
virtualenv = ~/isso
|
||||
env = ISSO_SETTINGS= ~/isso/isso.cfg
|
||||
```
|
||||
run it:
|
||||
```
|
||||
uwsgi /path/to/uwsgi.ini
|
||||
```
|
||||
|
||||
|
||||
then i added the isso script to my gatsby component
|
||||
```javascript
|
||||
import { Script } from "gatsby";
|
||||
// ...
|
||||
|
||||
const Comment = ({post_id}) => {
|
||||
return (
|
||||
<>
|
||||
<Script data-isso="//comments.nochill.in/"
|
||||
src="//comments.nochill.in/js/embed.min.js"
|
||||
data-isso-css="false"
|
||||
id={post_id}
|
||||
/>
|
||||
|
||||
<section id="isso-thread">
|
||||
<noscript>Javascript needs to be activated to view comments.</noscript>
|
||||
</section>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
// ...
|
||||
<Base>
|
||||
<div className="post template">
|
||||
<div className="post page">
|
||||
<div className="article figure">
|
||||
<div className="header-container">
|
||||
<small className="sub">
|
||||
{post.date}
|
||||
</small>
|
||||
<h1 className="title">
|
||||
{post.title}
|
||||
</h1>
|
||||
</div>
|
||||
<MDXProvider>
|
||||
{children}
|
||||
</MDXProvider>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Comment post_id={${Math.random()}/>
|
||||
</Base>
|
||||
```
|
||||
|
||||
i put ```Math.random()``` as post_id to make gatsby load the script again
|
||||
everytime you visit the page
|
||||
|
||||
<br />
|
||||
well that's it for now, later i will add about jenkins and prometheus setup
|
||||
on my scuffed server.
|
||||
I just want to post this shit man i haven't post anything for 3 decades man,
|
||||
it's hard to be [consistent](https://typesense.org/blog/the-unreasonable-effectiveness-of-just-showing-up-everyday/) man
|
||||
@ -1,16 +0,0 @@
|
||||
---
|
||||
title: 'First post'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
pubDate: 'Jul 08 2022'
|
||||
heroImage: '../../assets/blog-placeholder-3.jpg'
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||
|
||||
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
|
||||
|
||||
Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
|
||||
|
||||
Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.
|
||||
|
||||
Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
|
||||
139
src/content/blog/first-post.mdx
Normal file
139
src/content/blog/first-post.mdx
Normal file
@ -0,0 +1,139 @@
|
||||
---
|
||||
title: 'Halo'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
pubDate: 'Aug 08 2020'
|
||||
heroImage: '../../assets/blog-placeholder-3.jpg'
|
||||
archived: false
|
||||
---
|
||||
|
||||
|
||||
New blog
|
||||
|
||||
The old one looked sussy and it was difficult to read the content
|
||||
|
||||
This one look simple, 👍👍👍👍👍👍👍👍👍👍👍👍👍👍
|
||||
|
||||
the challenge is, how to make a good content
|
||||
|
||||
|
||||
```rs
|
||||
bubble_sort<T: Ord>(arr: &mut [T]) {
|
||||
for i in 0..arr.len() {
|
||||
for j in 0..arr.len() - 1 - i {
|
||||
if arr[j] > arr [j + 1] {
|
||||
arr.swap(j, j + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`mdx test`
|
||||
```
|
||||
|
||||
<iframe src="https://open.spotify.com/embed/track/1b6jcx91c0DCGwrMKX5taA?utm_source=generator" width="50%" height="102" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>
|
||||
|
||||
[Interlude: DOOM]
|
||||
|
||||
Ba-di-yahhhh
|
||||
|
||||
Alright, steady
|
||||
|
||||
Ba-di-yah, ba-di-yah
|
||||
|
||||
Absolute power corrupts absolutely
|
||||
|
||||
If they get the Villain surrounded then- (Ahem)
|
||||
|
||||
<br />
|
||||
[Verse: MF DOOM]
|
||||
|
||||
Good to the last drop niglets
|
||||
|
||||
Hood 'til the blast pop them bigot-ass piglets
|
||||
|
||||
Go for the bosses' dicks or higher
|
||||
|
||||
Beatwalkers still get caught up in the crossfire
|
||||
|
||||
Get at the sarge, he give the orders
|
||||
|
||||
The rest of them punks'll quit the force or get slaughtered
|
||||
|
||||
Use stealth, play alleys, jet
|
||||
|
||||
We'd rather not alert them nosy Federales, yet
|
||||
|
||||
Keep the local random cases in each state
|
||||
|
||||
Escape to the beaches for the season and be straight
|
||||
|
||||
You on call, keep your Nikes on tight, no white
|
||||
|
||||
Anybody tell get lighted on sight
|
||||
|
||||
The ringer's on a need-to-know basis
|
||||
|
||||
No persons, places, things and no faces
|
||||
|
||||
Get bagged, you're on your own, acted alone
|
||||
|
||||
Back home, your fam'll be provided for while you're gone
|
||||
|
||||
It's a price on all snitches
|
||||
|
||||
If you nice, bring back eyes, fingers, toes and pictures
|
||||
|
||||
Send copies to those who singin' the blues
|
||||
|
||||
Mothers and fathers who's unjustly accused
|
||||
|
||||
Our species is in danger
|
||||
|
||||
Wear gloves and strike in a city where you a stranger
|
||||
|
||||
That'll let them fools know
|
||||
|
||||
And send them a message, let them P.O.W.'s go
|
||||
|
||||
Absolute power corrupts absolutely
|
||||
|
||||
Now you have your orders, do your duty
|
||||
|
||||
A new way to let the shots spray
|
||||
|
||||
A few drops a day, double espresso, D.A. latte
|
||||
|
||||
No smell nor taste, hardly traceable
|
||||
|
||||
Wait to waste a prosecutor paid to get the case pulled
|
||||
|
||||
Learn 'em a lesson for givin' bros mad stresses
|
||||
|
||||
A long list of C.O.'s names and addresses
|
||||
|
||||
A fake judge with many years on the bench
|
||||
|
||||
That sent some good cats to the chair, was aired in a trench
|
||||
|
||||
They say her tongue was teared out, smeared and drenched
|
||||
|
||||
The whole system scared in doubt with a fear stench
|
||||
|
||||
And she was tortured, some say post-mortem
|
||||
|
||||
The suspect took his own life before they caught him
|
||||
|
||||
It's real spooky like a real trife movie
|
||||
|
||||
Remember the part when Terminator killed Tookie
|
||||
|
||||
Absolute power corrupts absolutely
|
||||
|
||||
If they get the Villain surrounded, son, then shit
|
||||
|
||||
Shed blood, some'll be shooken
|
||||
|
||||
Just look with they head in the mud, red flood (Villain!)
|
||||
|
||||
|
||||
|
||||

|
||||
@ -1,214 +0,0 @@
|
||||
---
|
||||
title: 'Markdown Style Guide'
|
||||
description: 'Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.'
|
||||
pubDate: 'Jun 19 2024'
|
||||
heroImage: '../../assets/blog-placeholder-1.jpg'
|
||||
---
|
||||
|
||||
Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.
|
||||
|
||||
## Headings
|
||||
|
||||
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
|
||||
|
||||
# H1
|
||||
|
||||
## H2
|
||||
|
||||
### H3
|
||||
|
||||
#### H4
|
||||
|
||||
##### H5
|
||||
|
||||
###### H6
|
||||
|
||||
## Paragraph
|
||||
|
||||
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
|
||||
|
||||
Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
|
||||
|
||||
## Images
|
||||
|
||||
### Syntax
|
||||
|
||||
```markdown
|
||||

|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||

|
||||
|
||||
## Blockquotes
|
||||
|
||||
The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.
|
||||
|
||||
### Blockquote without attribution
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||
> **Note** that you can use _Markdown syntax_ within a blockquote.
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||
> **Note** that you can use _Markdown syntax_ within a blockquote.
|
||||
|
||||
### Blockquote with attribution
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
|
||||
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
||||
|
||||
## Tables
|
||||
|
||||
### Syntax
|
||||
|
||||
```markdown
|
||||
| Italics | Bold | Code |
|
||||
| --------- | -------- | ------ |
|
||||
| _italics_ | **bold** | `code` |
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
| Italics | Bold | Code |
|
||||
| --------- | -------- | ------ |
|
||||
| _italics_ | **bold** | `code` |
|
||||
|
||||
## Code Blocks
|
||||
|
||||
### Syntax
|
||||
|
||||
we can use 3 backticks ``` in new line and write snippet and close with 3 backticks on new line and to highlight language specific syntax, write one word of language name after first 3 backticks, for eg. html, javascript, css, markdown, typescript, txt, bash
|
||||
|
||||
````markdown
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
````
|
||||
|
||||
### Output
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## List Types
|
||||
|
||||
### Ordered List
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
1. First item
|
||||
2. Second item
|
||||
3. Third item
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
1. First item
|
||||
2. Second item
|
||||
3. Third item
|
||||
|
||||
### Unordered List
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
- List item
|
||||
- Another item
|
||||
- And another item
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
- List item
|
||||
- Another item
|
||||
- And another item
|
||||
|
||||
### Nested list
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
- Fruit
|
||||
- Apple
|
||||
- Orange
|
||||
- Banana
|
||||
- Dairy
|
||||
- Milk
|
||||
- Cheese
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
- Fruit
|
||||
- Apple
|
||||
- Orange
|
||||
- Banana
|
||||
- Dairy
|
||||
- Milk
|
||||
- Cheese
|
||||
|
||||
## Other Elements — abbr, sub, sup, kbd, mark
|
||||
|
||||
### Syntax
|
||||
|
||||
```markdown
|
||||
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
|
||||
|
||||
H<sub>2</sub>O
|
||||
|
||||
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
|
||||
|
||||
Press <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>Delete</kbd> to end the session.
|
||||
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
|
||||
|
||||
H<sub>2</sub>O
|
||||
|
||||
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
|
||||
|
||||
Press <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>Delete</kbd> to end the session.
|
||||
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
||||
@ -1,16 +0,0 @@
|
||||
---
|
||||
title: 'Second post'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
pubDate: 'Jul 15 2022'
|
||||
heroImage: '../../assets/blog-placeholder-4.jpg'
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||
|
||||
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
|
||||
|
||||
Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
|
||||
|
||||
Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.
|
||||
|
||||
Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
|
||||
@ -1,16 +0,0 @@
|
||||
---
|
||||
title: 'Third post'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
pubDate: 'Jul 22 2022'
|
||||
heroImage: '../../assets/blog-placeholder-2.jpg'
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||
|
||||
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
|
||||
|
||||
Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
|
||||
|
||||
Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.
|
||||
|
||||
Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
|
||||
@ -1,31 +0,0 @@
|
||||
---
|
||||
title: 'Using MDX'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
pubDate: 'Jun 01 2024'
|
||||
heroImage: '../../assets/blog-placeholder-5.jpg'
|
||||
---
|
||||
|
||||
This theme comes with the [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/) integration installed and configured in your `astro.config.mjs` config file. If you prefer not to use MDX, you can disable support by removing the integration from your config file.
|
||||
|
||||
## Why MDX?
|
||||
|
||||
MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/markdown-content/#mdx-features) for things like interactive charts or alerts.
|
||||
|
||||
If you have existing content authored in MDX, this integration will hopefully make migrating to Astro a breeze.
|
||||
|
||||
## Example
|
||||
|
||||
Here is how you import and use a UI component inside of MDX.
|
||||
When you open this page in the browser, you should see the clickable button below.
|
||||
|
||||
import HeaderLink from '../../components/HeaderLink.astro';
|
||||
|
||||
<HeaderLink href="#" onclick="alert('clicked!')">
|
||||
Embedded component in MDX
|
||||
</HeaderLink>
|
||||
|
||||
## More Links
|
||||
|
||||
- [MDX Syntax Documentation](https://mdxjs.com/docs/what-is-mdx)
|
||||
- [Astro Usage Documentation](https://docs.astro.build/en/guides/markdown-content/#markdown-and-mdx-pages)
|
||||
- **Note:** [Client Directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) are still required to create interactive components. Otherwise, all components in your MDX will render as static HTML (no JavaScript) by default.
|
||||
@ -1,12 +1,12 @@
|
||||
---
|
||||
import { Image } from 'astro:assets';
|
||||
import type { CollectionEntry } from 'astro:content';
|
||||
import BaseHead from '../components/BaseHead.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import FormattedDate from '../components/FormattedDate.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import { Image } from "astro:assets";
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
import BaseHead from "../components/BaseHead.astro";
|
||||
import Footer from "../components/Footer.astro";
|
||||
import FormattedDate from "../components/FormattedDate.astro";
|
||||
import Header from "../components/Header.astro";
|
||||
|
||||
type Props = CollectionEntry<'blog'>['data'];
|
||||
type Props = CollectionEntry<"blog">["data"];
|
||||
|
||||
const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
|
||||
---
|
||||
@ -14,73 +14,54 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
|
||||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead title={title} description={description} />
|
||||
<style>
|
||||
main {
|
||||
width: calc(100% - 2em);
|
||||
max-width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
.hero-image {
|
||||
width: 100%;
|
||||
}
|
||||
.hero-image img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
border-radius: 12px;
|
||||
box-shadow: var(--box-shadow);
|
||||
}
|
||||
.prose {
|
||||
width: 720px;
|
||||
max-width: calc(100% - 2em);
|
||||
margin: auto;
|
||||
padding: 1em;
|
||||
color: rgb(var(--gray-dark));
|
||||
}
|
||||
.title {
|
||||
margin-bottom: 1em;
|
||||
padding: 1em 0;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
.title h1 {
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
.date {
|
||||
margin-bottom: 0.5em;
|
||||
color: rgb(var(--gray));
|
||||
}
|
||||
.last-updated-on {
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<Header />
|
||||
<article>
|
||||
<div class="hero-image">
|
||||
{heroImage && <Image width={1020} height={510} src={heroImage} alt="" />}
|
||||
</div>
|
||||
<div class="prose">
|
||||
<div class="title">
|
||||
<div class="date">
|
||||
<FormattedDate date={pubDate} />
|
||||
{
|
||||
updatedDate && (
|
||||
<div class="last-updated-on">
|
||||
Last updated on <FormattedDate date={updatedDate} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
{updatedDate && <FormattedDate date={updatedDate} />}
|
||||
<h1>{title}</h1>
|
||||
<hr />
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<style>
|
||||
.hero-image {
|
||||
width: 100%;
|
||||
}
|
||||
.hero-image img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
border-radius: 12px;
|
||||
box-shadow: var(--box-shadow);
|
||||
}
|
||||
.title {
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
color: #eeeeee;
|
||||
|
||||
time {
|
||||
font-size: 1rem;
|
||||
}
|
||||
h1 {
|
||||
color: #eeeeee;
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
}
|
||||
.title h1 {
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
.date {
|
||||
margin-bottom: 0.5em;
|
||||
color: rgb(var(--gray));
|
||||
}
|
||||
.last-updated-on {
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
||||
|
||||
20
src/layouts/DefaultLayout.astro
Normal file
20
src/layouts/DefaultLayout.astro
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
import BaseHead from "../components/BaseHead.astro";
|
||||
import Header from "../components/Header.astro";
|
||||
import { SITE_DESCRIPTION, SITE_TITLE } from "../consts";
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<main>
|
||||
<Header />
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,63 +1,87 @@
|
||||
---
|
||||
import AboutHeroImage from '../assets/blog-placeholder-about.jpg';
|
||||
import Layout from '../layouts/BlogPost.astro';
|
||||
import { getCollection } from "astro:content";
|
||||
import FormattedDate from "../components/FormattedDate.astro";
|
||||
import DefaultLayout from "../layouts/DefaultLayout.astro";
|
||||
import { Image } from "astro:assets";
|
||||
import myImage from "../assets/12561.png"
|
||||
|
||||
// Get all posts and filter out archived ones if needed
|
||||
const allPosts = await getCollection("blog");
|
||||
|
||||
const posts = allPosts
|
||||
.filter((post) => !post.data.archived)
|
||||
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
|
||||
---
|
||||
|
||||
<Layout
|
||||
title="About Me"
|
||||
description="Lorem ipsum dolor sit amet"
|
||||
pubDate={new Date('August 08 2021')}
|
||||
heroImage={AboutHeroImage}
|
||||
>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
|
||||
labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo
|
||||
viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam
|
||||
adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus
|
||||
et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus
|
||||
vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque
|
||||
sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||
</p>
|
||||
<DefaultLayout>
|
||||
<section>
|
||||
<div style="color: #eeeeee;">
|
||||
<h4>Who are you ?</h4>
|
||||
<p>nc</p>
|
||||
<p>
|
||||
<a href="https://twitter.com/ncggro" target="_">Twitter </a>
|
||||
<a href="https://github.com/NCanggoro" target="_">GitHub </a>
|
||||
<a href="https://gitlab.com/cloudcorezip" target="_">GitLab </a>
|
||||
<a href="https://git.nochill.in/nochill" target="_">Gitea </a>
|
||||
<a href="mailto:ncanggoro@tutanota.com" target="_">Email </a>
|
||||
</p>
|
||||
<h4 class="faq-title">Why so many <a href="https://en.wikipedia.org/wiki/Comparison_of_source-code-hosting_facilities" target="_">forge</a> ?</h4>
|
||||
<p>Consumer do be consuming</p>
|
||||
<h4 class="faq-title">What do you do ?</h4>
|
||||
<p>Professional Typer</p>
|
||||
<h4 class="faq-title">What are your hobbies ?</h4>
|
||||
<p>Yes</p>
|
||||
<h4 class="faq-title">Don't care didn't ask</h4>
|
||||
<div>
|
||||
<Image src={myImage} alt={"image"} width="240" height="240"/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</DefaultLayout>
|
||||
<style>
|
||||
h4 {
|
||||
color: #eeee;
|
||||
font-size: 1.15rem;
|
||||
margin: 0;
|
||||
}
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
a {
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
color: #4ecca3;
|
||||
}
|
||||
|
||||
<p>
|
||||
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non
|
||||
tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non
|
||||
blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna
|
||||
porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis
|
||||
massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc.
|
||||
Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis
|
||||
bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra
|
||||
massa massa ultricies mi.
|
||||
</p>
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
color: #fff;
|
||||
}
|
||||
.post-item {
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
<p>
|
||||
Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl
|
||||
suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet
|
||||
nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae
|
||||
turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem
|
||||
dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat
|
||||
semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus
|
||||
vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum
|
||||
facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam
|
||||
vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla
|
||||
urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
|
||||
</p>
|
||||
p {
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
<p>
|
||||
Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper
|
||||
viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc
|
||||
scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur
|
||||
gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus
|
||||
pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim
|
||||
blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id
|
||||
cursus metus aliquam eleifend mi.
|
||||
</p>
|
||||
.date {
|
||||
margin: 0;
|
||||
color: #767D92;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
<p>
|
||||
Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta
|
||||
nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam
|
||||
tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci
|
||||
ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar
|
||||
proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
|
||||
</p>
|
||||
</Layout>
|
||||
.faq-title {
|
||||
margin-top: 1em;
|
||||
}
|
||||
.title {
|
||||
line-height: 1;
|
||||
color: #eeeeee;
|
||||
}
|
||||
.title h1 {
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
---
|
||||
import { type CollectionEntry, getCollection, render } from 'astro:content';
|
||||
import BlogPost from '../../layouts/BlogPost.astro';
|
||||
import CodeBlock from '../../components/CodeBlock.astro';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog');
|
||||
@ -16,5 +17,69 @@ const { Content } = await render(post);
|
||||
---
|
||||
|
||||
<BlogPost {...post.data}>
|
||||
<Content />
|
||||
<Content components={{ pre: CodeBlock }} />
|
||||
</BlogPost>
|
||||
|
||||
<style is:global>
|
||||
|
||||
ol {
|
||||
margin: 0;
|
||||
}
|
||||
li {
|
||||
color: #eeee;
|
||||
font-size: 1rem;
|
||||
}
|
||||
ol li a {
|
||||
text-decoration: none;
|
||||
color: #4ecca3;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
|
||||
color: #eeeeee;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.prose h2 {
|
||||
font-size: 2.25rem;
|
||||
}
|
||||
|
||||
.prose p {
|
||||
font-size: 1rem;
|
||||
color: white;
|
||||
margin: 0;
|
||||
text-align: ;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: var(--gruvbox-soft) !important;
|
||||
border-radius: 6px;
|
||||
font-family: 'Fira Code', monospace;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
pre code {
|
||||
background-color: var(--gruvbox-soft) !important;
|
||||
border-radius: 6px;
|
||||
font-family: 'Fira Code', monospace;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
color: #4ecca3;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.astro-code {
|
||||
background-color: var(--gruvbox-soft) !important;
|
||||
padding: 0.5em 1em;
|
||||
border-radius: 6px;
|
||||
font-family: 'Fira Code', monospace;
|
||||
font-size: 1rem;
|
||||
}
|
||||
</style>
|
||||
@ -1,49 +1,63 @@
|
||||
---
|
||||
import BaseHead from '../components/BaseHead.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import { SITE_DESCRIPTION, SITE_TITLE } from '../consts';
|
||||
import { getCollection } from "astro:content";
|
||||
import FormattedDate from "../components/FormattedDate.astro";
|
||||
import DefaultLayout from "../layouts/DefaultLayout.astro";
|
||||
|
||||
// Get all posts and filter out archived ones if needed
|
||||
const allPosts = await getCollection("blog");
|
||||
|
||||
const posts = allPosts
|
||||
.filter((post) => !post.data.archived)
|
||||
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
</head>
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<h1>🧑🚀 Hello, Astronaut!</h1>
|
||||
<p>
|
||||
Welcome to the official <a href="https://astro.build/">Astro</a> blog starter template. This template
|
||||
serves as a lightweight, minimally-styled starting point for anyone looking to build a personal
|
||||
website, blog, or portfolio with Astro.
|
||||
</p>
|
||||
<p>
|
||||
This template comes with a few integrations already configured in your
|
||||
<code>astro.config.mjs</code> file. You can customize your setup with
|
||||
<a href="https://astro.build/integrations">Astro Integrations</a> to add tools like Tailwind,
|
||||
React, or Vue to your project.
|
||||
</p>
|
||||
<p>Here are a few ideas on how to get started with the template:</p>
|
||||
<ul>
|
||||
<li>Edit this page in <code>src/pages/index.astro</code></li>
|
||||
<li>Edit the site header items in <code>src/components/Header.astro</code></li>
|
||||
<li>Add your name to the footer in <code>src/components/Footer.astro</code></li>
|
||||
<li>Check out the included blog posts in <code>src/content/blog/</code></li>
|
||||
<li>Customize the blog post page layout in <code>src/layouts/BlogPost.astro</code></li>
|
||||
</ul>
|
||||
<p>
|
||||
Have fun! If you get stuck, remember to
|
||||
<a href="https://docs.astro.build/">read the docs</a>
|
||||
or <a href="https://astro.build/chat">join us on Discord</a> to ask questions.
|
||||
</p>
|
||||
<p>
|
||||
Looking for a blog template with a bit more personality? Check out
|
||||
<a href="https://github.com/Charca/astro-blog-template">astro-blog-template</a>
|
||||
by <a href="https://twitter.com/Charca">Maxi Ferreira</a>.
|
||||
</p>
|
||||
</main>
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
<DefaultLayout>
|
||||
<section>
|
||||
<ul>
|
||||
{
|
||||
posts.map((post) => (
|
||||
<li class="post-item">
|
||||
<p class="date">
|
||||
<FormattedDate date={post.data.pubDate} />
|
||||
</p>
|
||||
<a href={`/blog/${post.id}/`}>
|
||||
<h5 class="title">{post.data.title}</h4>
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</section>
|
||||
</DefaultLayout>
|
||||
<style>
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
a {
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
color: #fff;
|
||||
}
|
||||
.post-item {
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
.date {
|
||||
margin: 0;
|
||||
color: #767D92;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.title {
|
||||
line-height: 1;
|
||||
color: #eeeeee;
|
||||
}
|
||||
.title h1 {
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -12,11 +12,13 @@
|
||||
--gray-light: 229, 233, 240;
|
||||
--gray-dark: 34, 41, 57;
|
||||
--gray-gradient: rgba(var(--gray-light), 50%), #fff;
|
||||
--background-color-main: #232931;
|
||||
--gruvbox-soft: oklch(23% 0.01 60);
|
||||
--box-shadow:
|
||||
0 2px 6px rgba(var(--gray), 25%), 0 8px 24px rgba(var(--gray), 33%), 0 16px 32px
|
||||
rgba(var(--gray), 33%);
|
||||
}
|
||||
@font-face {
|
||||
/* @font-face {
|
||||
font-family: "Atkinson";
|
||||
src: url("/fonts/atkinson-regular.woff") format("woff");
|
||||
font-weight: 400;
|
||||
@ -29,19 +31,25 @@
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
} */
|
||||
body {
|
||||
font-family: "Atkinson", sans-serif;
|
||||
font: 112.5%/1.45em "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
background: linear-gradient(var(--gray-gradient)) no-repeat;
|
||||
background: var(--background-color-main) no-repeat;
|
||||
background-size: 100% 600px;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
color: rgb(var(--gray-dark));
|
||||
font-size: 20px;
|
||||
line-height: 1.7;
|
||||
font-kerning: normal;
|
||||
font-feature-settings: "kern", "liga", "clig", "calt";
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-moz-font-feature-settings: "kern", "liga", "clig", "calt";
|
||||
-ms-font-feature-settings: "kern", "liga", "clig", "calt";
|
||||
-webkit-font-feature-settings: "kern", "liga", "clig", "calt";
|
||||
}
|
||||
main {
|
||||
width: 720px;
|
||||
@ -86,6 +94,7 @@ a:hover {
|
||||
}
|
||||
p {
|
||||
margin-bottom: 1em;
|
||||
font-family: "Open Sans",Helvetica, Arial, sans-serif;
|
||||
}
|
||||
.prose p {
|
||||
margin-bottom: 2em;
|
||||
@ -108,6 +117,8 @@ img {
|
||||
code {
|
||||
padding: 2px 5px;
|
||||
background-color: rgb(var(--gray-light));
|
||||
font-family: "SFMono-Regular", Consolas, "Roboto Mono", "Droid Sans Mono",
|
||||
"Liberation Mono", Menlo, Courier, monospace;
|
||||
border-radius: 2px;
|
||||
}
|
||||
pre {
|
||||
@ -152,4 +163,4 @@ hr {
|
||||
clip-path: inset(50%);
|
||||
/* added line to stop words getting smushed together (as they go onto separate lines and some screen readers do not understand line feeds as a space */
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
340
src/styles/isso.css
Normal file
340
src/styles/isso.css
Normal file
@ -0,0 +1,340 @@
|
||||
/* ========================================================================== */
|
||||
/* Generic styling */
|
||||
/* ========================================================================== */
|
||||
#isso-thread * {
|
||||
/* Reset */
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Thread heading area */
|
||||
/* ========================================================================== */
|
||||
#isso-thread {
|
||||
padding: 0 0 50px 0;
|
||||
margin: 40px 0 0 0;
|
||||
}
|
||||
h4.isso-thread-heading {
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
.isso-feedlink {
|
||||
float: right;
|
||||
padding-left: 1em;
|
||||
}
|
||||
.isso-feedlink a {
|
||||
font-size: 0.8em;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Comments */
|
||||
/* ========================================================================== */
|
||||
|
||||
.isso-comment {
|
||||
max-width: 68em;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.isso-preview .isso-comment {
|
||||
padding-top: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.isso-comment:not(:first-of-type),
|
||||
.isso-follow-up .isso-comment {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
.isso-avatar {
|
||||
display: block;
|
||||
float: left;
|
||||
margin: 0.95em 0.95em 0;
|
||||
}
|
||||
.isso-avatar svg {
|
||||
max-width: 48px;
|
||||
max-height: 48px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.isso-text-wrapper {
|
||||
display: block;
|
||||
padding: 0.95em;
|
||||
}
|
||||
.isso-follow-up {
|
||||
padding-left: calc(7% + 20px);
|
||||
}
|
||||
.isso-comment-footer {
|
||||
font-size: 0.95em;
|
||||
}
|
||||
.isso-comment-header {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
.isso-comment-header a {
|
||||
text-decoration: none;
|
||||
}
|
||||
/* Only for comment header, spacer between up-/downvote should have no padding */
|
||||
.isso-comment-header .isso-spacer {
|
||||
padding: 0 6px;
|
||||
}
|
||||
.isso-spacer,
|
||||
.isso-permalink,
|
||||
.isso-note,
|
||||
.isso-parent {
|
||||
color: gray;
|
||||
font-weight: normal;
|
||||
text-shadow: none;
|
||||
}
|
||||
.isso-spacer:hover,
|
||||
.isso-permalink:hover,
|
||||
.isso-note:hover,
|
||||
.isso-parent:hover {
|
||||
color: #606060;
|
||||
}
|
||||
.isso-note {
|
||||
float: right;
|
||||
}
|
||||
.isso-author {
|
||||
font-weight: bold;
|
||||
color: #cbcbcb;
|
||||
}
|
||||
.isso-page-author-suffix {
|
||||
font-weight: bold;
|
||||
color: #2c2c2c;
|
||||
}
|
||||
.isso-textarea,
|
||||
.isso-preview {
|
||||
margin-top: 0.2em;
|
||||
width: 100%;
|
||||
border: 1px solid #f0f0f0;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 2px #888;
|
||||
}
|
||||
.isso-text {
|
||||
color: #fff;
|
||||
word-break: break-word;
|
||||
}
|
||||
.isso-text p {
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
.isso-text p:last-child {
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
.isso-text h1,
|
||||
.isso-text h2,
|
||||
.isso-text h3,
|
||||
.isso-text h4,
|
||||
.isso-text h5,
|
||||
.isso-text h6 {
|
||||
font-size: 130%;
|
||||
font-weight: bold;
|
||||
}
|
||||
.isso-text pre {
|
||||
background: #eee;
|
||||
border: 1px solid #ddd;
|
||||
padding: 10px 15px;
|
||||
color: #4d4d4c;
|
||||
overflow: auto;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
.isso-text :not(pre) > code {
|
||||
padding: .2em .4em;
|
||||
margin: 0;
|
||||
font-size: 85%;
|
||||
background-color: #eeeeee;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.isso-comment-footer {
|
||||
font-size: 0.80em;
|
||||
color: gray;
|
||||
clear: left;
|
||||
}
|
||||
.isso-feedlink,
|
||||
.isso-comment-footer a {
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
}
|
||||
.isso-feedlink:hover,
|
||||
.isso-comment-footer a:hover {
|
||||
color: #fff;
|
||||
text-shadow: #aaaaaa 0 0 1px;
|
||||
}
|
||||
.isso-comment-footer > a {
|
||||
position: relative;
|
||||
top: .2em;
|
||||
}
|
||||
.isso-comment-footer > a + a {
|
||||
padding-left: 1em;
|
||||
}
|
||||
.isso-comment-footer .isso-votes {
|
||||
color: gray;
|
||||
}
|
||||
.isso-upvote svg,
|
||||
.isso-downvote svg {
|
||||
position: relative;
|
||||
top: .2em;
|
||||
}
|
||||
/* Reply postbox under existing comment */
|
||||
.isso-comment .isso-postbox {
|
||||
margin-top: 0.8em;
|
||||
}
|
||||
.isso-comment.isso-no-votes > * > .isso-comment-footer .isso-votes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Postbox */
|
||||
/* ========================================================================== */
|
||||
.isso-postbox {
|
||||
max-width: 68em;
|
||||
margin: 0 auto 2em;
|
||||
clear: right;
|
||||
}
|
||||
.isso-form-wrapper {
|
||||
display: block;
|
||||
padding: 0;
|
||||
}
|
||||
.isso-textarea,
|
||||
.isso-preview {
|
||||
margin: 0 0 .3em;
|
||||
padding: .4em .8em;
|
||||
border-radius: 3px;
|
||||
background-color: #282828;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.isso-textarea {
|
||||
color: #fff;
|
||||
outline: 0;
|
||||
width: 100%;
|
||||
resize: none;
|
||||
}
|
||||
.isso-form-wrapper input[type=checkbox] {
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
bottom: 1px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.isso-notification-section {
|
||||
font-size: 0.90em;
|
||||
padding-top: .3em;
|
||||
display: none;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.isso-auth-section {
|
||||
display: block;
|
||||
}
|
||||
.isso-textarea:focus,
|
||||
.isso-input-wrapper input:focus,
|
||||
.isso-auth-section input:focus {
|
||||
outline: 2px solid #3584e4;
|
||||
}
|
||||
.isso-input-wrapper {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
margin: 0 1% 0 0;
|
||||
color: #282828;
|
||||
}
|
||||
.isso-input-wrapper input {
|
||||
display: block;
|
||||
padding: .3em 10px;
|
||||
max-width: 100%;
|
||||
border-radius: 3px;
|
||||
background-color: #282828;
|
||||
line-height: 1.4em;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
color: #fff;
|
||||
}
|
||||
.isso-input-wrapper label {
|
||||
display: block;
|
||||
line-height: 1.4em;
|
||||
height: 1.4em;
|
||||
color: #fff !important;
|
||||
}
|
||||
label {
|
||||
color: #fff;
|
||||
}
|
||||
.isso-post-action {
|
||||
display: block;
|
||||
float: right;
|
||||
margin: 1.4em 0 0 5px;
|
||||
}
|
||||
.isso-post-action > input {
|
||||
padding: calc(.3em - 1px);
|
||||
border-radius: 2px;
|
||||
border: 1px solid #ccc;
|
||||
background-color: #ddd;
|
||||
cursor: pointer;
|
||||
outline: 0;
|
||||
line-height: 1.4em;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.isso-post-action > input:hover {
|
||||
background-color: #ccc;
|
||||
}
|
||||
.isso-post-action > input:active {
|
||||
background-color: #bbb;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Postbox (preview mode) */
|
||||
/* ========================================================================== */
|
||||
.isso-preview,
|
||||
.isso-post-action input[name="edit"],
|
||||
.isso-postbox.isso-preview-mode > .isso-form-wrapper input[name="preview"],
|
||||
.isso-postbox.isso-preview-mode > .isso-form-wrapper .isso-textarea {
|
||||
display: none;
|
||||
}
|
||||
.isso-postbox.isso-preview-mode > .isso-form-wrapper .isso-preview {
|
||||
display: block;
|
||||
}
|
||||
.isso-postbox.isso-preview-mode > .isso-form-wrapper input[name="edit"] {
|
||||
display: inline;
|
||||
}
|
||||
.isso-preview {
|
||||
background-color: #f8f8f8;
|
||||
background: repeating-linear-gradient(
|
||||
-45deg,
|
||||
#f8f8f8,
|
||||
#f8f8f8 10px,
|
||||
#fff 10px,
|
||||
#fff 20px
|
||||
);
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Animations */
|
||||
/* ========================================================================== */
|
||||
|
||||
/* "target" means the comment that's being linked to, for example:
|
||||
* https://example.com/blog/example/#isso-15
|
||||
*/
|
||||
.isso-target {
|
||||
animation: isso-target-fade 5s ease-out;
|
||||
}
|
||||
@keyframes isso-target-fade {
|
||||
0% { background-color: #eee5a1; }
|
||||
/* This color should be changed when used on a dark background,
|
||||
* maybe #3f3c1c for example
|
||||
*/
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Media queries */
|
||||
/* ========================================================================== */
|
||||
@media screen and (max-width:600px) {
|
||||
.isso-input-wrapper {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
margin: 0 0 .3em;
|
||||
}
|
||||
.isso-input-wrapper input {
|
||||
width: 100%;
|
||||
}
|
||||
.isso-post-action {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": true
|
||||
"strictNullChecks": true,
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user