-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Выносит функцию в отдельный модуль (#1281)
* Выносит функцию в отдельный модуль * Решает с подключением модуля * Поднимает версию web-features до 1.0.0 (#1279) Исправляет импорт из модуля `web-features`. FYI: Начиная с версии 0.10 требуется использовать именованый импорт. см: https://www.npmjs.com/package/web-features/v/0.10.0 https://github.com/web-platform-dx/web-features/releases/tag/v0.10.0 * Подстраивается под особенность слонёнка Дампо не собираться с мыслями в 11ty --------- Co-authored-by: Vitya <[email protected]>
- Loading branch information
Showing
4 changed files
with
26 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = function transformArticleData(article) { | ||
const section = article.filePathStem.split('/')[1] | ||
|
||
return { | ||
title: article.data.title, | ||
cover: article.data.cover ?? {}, | ||
get imageLink() { | ||
return `${this.cover.mobile}` | ||
}, | ||
description: article.data.description, | ||
link: `/${section}/${article.fileSlug}/`, | ||
linkTitle: article.data.title.replace(/`/g, ''), | ||
section, | ||
} | ||
} |
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