Skip to content

Commit

Permalink
Merge branch 'master' into generate-files
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonkearns committed Jan 24, 2020
2 parents 2c903b9 + 5b12ab4 commit cae3344
Show file tree
Hide file tree
Showing 21 changed files with 551 additions and 127 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG-ELM.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.1.2] - 2020-01-20

### Fixed
- "Missing content" message no longer flashes between pre-rendered HTML and the Elm app hydrating and taking over the page. See [#48](https://github.com/dillonkearns/elm-pages/pull/48).

## [1.1.1] - 2020-01-04

### Fixed
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG-NPM.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed
- Fix missing content flash (that was partially fixed with [#48](https://github.com/dillonkearns/elm-pages/pull/48)) for
some cases where paths weren't normalized correctly.

## [1.1.8] - 2020-01-20

### Fixed
- "Missing content" message no longer flashes between pre-rendered HTML and the Elm app hydrating and taking over the page. See [#48](https://github.com/dillonkearns/elm-pages/pull/48).

## [1.1.7] - 2020-01-12

### Fixed
- Newlines and escaped double quotes (`"`s) are handled properly in content frontmatter now. See [#41](https://github.com/dillonkearns/elm-pages/pull/41). Thank you [Luke](https://github.com/lukewestby)! 🎉🙏

## [1.1.6] - 2020-01-04

### Added
Expand Down
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "dillonkearns/elm-pages",
"summary": "A statically typed site generator.",
"license": "BSD-3-Clause",
"version": "1.1.1",
"version": "1.1.2",
"exposed-modules": [
"Head",
"Head.Seo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Here are some links:

And here's the output:

<ellie-output id="6RCVwj43wQfa1" />
<ellie-output id="7PLvgQ2kSzja1" />

This is a nice way to abstract the presentation logic for team members' bios on an `about-us` page. We want richer presentation logic than plain markdown provides (for example, showing icons with the right dimensions, and displaying them in a row not column view, etc.) Also, since we're using Elm, we get pretty spoiled by explicit and precise error messages. So we'd like to get an error message if we don't provide a required attribute!

Expand Down Expand Up @@ -148,7 +148,7 @@ Exposing the AST allows for a number of powerful use cases as well. And it does

Here are some use cases that this feature enables:

- Extract metadata before rendering, like building a table of contents data structure with proper links ([here's an Ellie demo of that!](https://ellie-app.com/6QtYW8pcCDna1))
- Extract metadata before rendering, like building a table of contents data structure with proper links ([here's an Ellie demo of that!](https://ellie-app.com/7LDzS6r48n8a1))
- Run a validation and turn it into an `Err`, for example, if there are multiple level 1 headings (having multiple `h1`s on a page causes accessibility problems)
- Transform the blocks by applying formatting rules, for example use a title casing function on all headings
- Transform the AST before rendering it, for example dropping each heading down one level (H1s become H2s, etc.)
Expand Down
4 changes: 4 additions & 0 deletions examples/docs/content/showcase/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: elm-pages sites showcase
type: showcase
---
13 changes: 2 additions & 11 deletions examples/docs/src/DocSidebar.elm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Element exposing (Element)
import Element.Border as Border
import Element.Font
import Metadata exposing (Metadata)
import Pages.PagePath as PagePath exposing (PagePath)
import Pages
import Pages.PagePath as PagePath exposing (PagePath)
import Palette


Expand All @@ -25,19 +25,10 @@ view currentPage posts =
|> List.filterMap
(\( path, metadata ) ->
case metadata of
Metadata.Page meta ->
Nothing

Metadata.Article meta ->
Nothing

Metadata.Author _ ->
Nothing

Metadata.Doc meta ->
Just ( currentPage == path, path, meta )

Metadata.BlogIndex ->
_ ->
Nothing
)
|> List.map postSummary
Expand Down
18 changes: 18 additions & 0 deletions examples/docs/src/FontAwesome.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module FontAwesome exposing (icon, styledIcon)

import Element exposing (Element)
import Html
import Html.Attributes


styledIcon : String -> List (Element.Attribute msg) -> Element msg
styledIcon classString styles =
Html.i [ Html.Attributes.class classString ] []
|> Element.html
|> Element.el styles


icon : String -> Element msg
icon classString =
Html.i [ Html.Attributes.class classString ] []
|> Element.html
11 changes: 1 addition & 10 deletions examples/docs/src/Index.elm
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,14 @@ view posts =
|> List.filterMap
(\( path, metadata ) ->
case metadata of
Metadata.Page meta ->
Nothing

Metadata.Doc meta ->
Nothing

Metadata.Author _ ->
Nothing

Metadata.Article meta ->
if meta.draft then
Nothing

else
Just ( path, meta )

Metadata.BlogIndex ->
_ ->
Nothing
)
|> List.sortBy
Expand Down
Loading

0 comments on commit cae3344

Please sign in to comment.