-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Parse blog contents * update pnpm action setup * add blog header and `highlight.js` * update pnpm lock * update blog post * Update some blog CSS, make markdown code `fontSize 0.75em`
- Loading branch information
1 parent
0078617
commit 5575867
Showing
13 changed files
with
919 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
module Route.Blog exposing (Model, Msg, route, Data, ActionData) | ||
|
||
{-| | ||
@docs Model, Msg, RouteParams, route, Data, ActionData | ||
-} | ||
|
||
import Article | ||
import BackendTask exposing (BackendTask) | ||
import Css exposing (..) | ||
import Effect | ||
import ErrorPage | ||
import FatalError exposing (FatalError) | ||
import Head | ||
import Head.Seo as Seo | ||
import Html.Styled as Html exposing (Attribute, Html, styled) | ||
import Html.Styled.Attributes exposing (css) | ||
import Pages.Url | ||
import PagesMsg | ||
import Route exposing (Route) | ||
import RouteBuilder exposing (App, StatelessRoute) | ||
import Server.Request | ||
import Server.Response | ||
import Shared | ||
import UrlPath | ||
import View exposing (View) | ||
|
||
|
||
type alias Msg = | ||
() | ||
|
||
|
||
type alias RouteParams = | ||
{} | ||
|
||
|
||
type alias Model = | ||
{} | ||
|
||
|
||
route : StatelessRoute RouteParams Data ActionData | ||
route = | ||
RouteBuilder.single | ||
{ head = head | ||
, data = data | ||
} | ||
|> RouteBuilder.buildNoState | ||
{ view = view | ||
} | ||
|
||
|
||
type alias Data = | ||
List ( Route, Article.ArticleMetadata ) | ||
|
||
|
||
type alias ActionData = | ||
{} | ||
|
||
|
||
data : BackendTask FatalError Data | ||
data = | ||
Article.allMetadata | ||
|> BackendTask.allowFatal | ||
|
||
|
||
head : App Data ActionData RouteParams -> List Head.Tag | ||
head app = | ||
Seo.summary | ||
{ canonicalUrlOverride = Nothing | ||
, siteName = "joshuas-blog" | ||
, image = | ||
{ url = [ "images", "icon-png.png" ] |> UrlPath.join |> Pages.Url.fromPath | ||
, alt = "elm-pages logo" | ||
, dimensions = Nothing | ||
, mimeType = Nothing | ||
} | ||
, description = "Articles by Joshua Ji" | ||
, locale = Nothing | ||
, title = "Joshua's Blog" | ||
} | ||
|> Seo.website | ||
|
||
|
||
view : | ||
App Data ActionData {} | ||
-> Shared.Model | ||
-> View msg | ||
view app shared = | ||
{ title = "Blog | Joshua Ji" | ||
, body = [ content ] | ||
} | ||
|
||
|
||
content : Html msg | ||
content = | ||
Html.div | ||
[ css | ||
[ maxWidth (px 900) | ||
, margin2 zero auto | ||
, displayFlex | ||
, flexDirection column | ||
, property "gap" "4em" | ||
] | ||
] | ||
[ Html.h1 | ||
[ css | ||
[ fontSize (px 48) | ||
, fontFamilies [ qt "Playfair Display SC" ] | ||
, margin2 (em 1) zero | ||
] | ||
] | ||
[ Html.text "Blog" ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
author: Joshua Ji | ||
title: Hello World! | ||
description: Testing my blog | ||
draft: false | ||
published: "2024-03-29" | ||
--- | ||
|
||
Hello world! This is my first blog post. | ||
|
||
```python | ||
print("Hello World!") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.