mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-30 23:06:10 +03:00
Hide draft posts from rss feed and sitemap.
This commit is contained in:
parent
920694a024
commit
5522ca068d
@ -58,6 +58,10 @@ metadataToRssItem :
|
|||||||
metadataToRssItem page =
|
metadataToRssItem page =
|
||||||
case page.frontmatter of
|
case page.frontmatter of
|
||||||
Article article ->
|
Article article ->
|
||||||
|
if article.draft then
|
||||||
|
Nothing
|
||||||
|
|
||||||
|
else
|
||||||
Just
|
Just
|
||||||
{ title = article.title
|
{ title = article.title
|
||||||
, description = article.description
|
, description = article.description
|
||||||
|
@ -24,6 +24,15 @@ build config siteMetadata =
|
|||||||
, content =
|
, content =
|
||||||
Sitemap.build config
|
Sitemap.build config
|
||||||
(siteMetadata
|
(siteMetadata
|
||||||
|
|> List.filter
|
||||||
|
(\page ->
|
||||||
|
case page.frontmatter of
|
||||||
|
Article articleData ->
|
||||||
|
not articleData.draft
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
True
|
||||||
|
)
|
||||||
|> List.map
|
|> List.map
|
||||||
(\page ->
|
(\page ->
|
||||||
{ path = PagePath.toString page.path, lastMod = Nothing }
|
{ path = PagePath.toString page.path, lastMod = Nothing }
|
||||||
|
Loading…
Reference in New Issue
Block a user