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