Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Blog #2208

Merged
80 commits merged into from
Oct 25, 2021
Merged

Blog #2208

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d812fe3
Revert "Sean/add all articles page (#1839)"
seanho96 Jul 1, 2021
1f1ede1
Revert "Sean/all-videos-page (#1832)"
seanho96 Jul 1, 2021
c3702dd
Merge branch 'master' of github.com:binary-com/deriv-com
seanho96 Jul 1, 2021
8abb476
Revert "Sean/revert blog pages (#1869)" (#1870)
Jul 5, 2021
3bc22b3
suthesh/blog-market-news (#1863)
suthesank Jul 5, 2021
48a23c8
Nuri/feat:Blog homepage video banner (#1829)
njazuli-deriv Jul 5, 2021
175f6ef
Habib/34905/blog homepage (#1844)
ShuvoHabib Jul 8, 2021
edacc41
suthesh/social-sharing-blog (#1868)
suthesank Jul 8, 2021
3251c02
Nuri/Feat : Deriv blog article bottom cta (#1858)
njazuli-deriv Jul 8, 2021
4b773db
nikolai.berestevich/feat/update links to blog page (#1918)
nikolaiberestevich-deriv Jul 14, 2021
8f54f6b
Nuri/update: Consolidate video banner comp into homepage (#1913)
njazuli-deriv Jul 16, 2021
5797216
Kevin/Deriv blog - Side CTA Banner (#1912)
virtualpowwa Jul 26, 2021
7593a5b
Kevin/deriv-blog add recent-featured component (#1871)
virtualpowwa Jul 28, 2021
c61434f
feat: install directus (#1882)
mustofa-binary Jul 30, 2021
0753287
Habib/blog subscription customerio form (#1925)
ShuvoHabib Aug 3, 2021
33c471a
Sara / Added Single blog post template (#1944)
sara-fs Aug 5, 2021
6522d5b
combine recent feat post to home (#1988)
virtualpowwa Aug 9, 2021
122bf8a
update cms endpoint (#2001)
Aug 12, 2021
22d83e6
temporarily disable old queries
seanho96 Aug 13, 2021
ab16874
update blog branch with latest master branch
seanho96 Aug 13, 2021
4112f2b
update node req to node >14
seanho96 Aug 13, 2021
34e3fa7
Revert "update node req to node >14"
seanho96 Aug 13, 2021
6d28883
Update blog branch with latest master branch (#2007)
Aug 13, 2021
a01c0b2
Merge branch 'blog' of github.com:binary-com/deriv-com into blog
seanho96 Aug 17, 2021
8742267
Sean/update cms endpoint 3 (#2025)
Aug 17, 2021
b7a6333
Habib/banner data cms graphql (#2028)
ShuvoHabib Aug 24, 2021
df76209
update CMS endpoint (#2040)
Aug 24, 2021
910b265
nikolai.berestevich: Blog : articles from cms now (#2026)
nikolaiberestevich-deriv Aug 24, 2021
a59148d
Suthesh/market-news-data (#2016)
suthesank Aug 24, 2021
9fc8ab4
fix: merge conflict
seanho96 Aug 24, 2021
9c1c936
Habib/update footer navbar no language (#2042)
ShuvoHabib Aug 26, 2021
32617c1
nikolai.berestevich/feat/blog - new text on subscription banner (#2032)
nikolaiberestevich-deriv Aug 26, 2021
ec078c0
Nuri/feat : feature - new article template (#2011)
njazuli-deriv Aug 26, 2021
9bc7282
added sidebanner email subscription (#2050)
njazuli-deriv Aug 27, 2021
94ecd8b
Sean/change preview to rest api (#2052)
Aug 27, 2021
9839d3e
Nikolai.berestevich/feat/blog : all videos from cms (#2044)
nikolaiberestevich-deriv Aug 27, 2021
f2624c5
yashim/feat: updated blog carousel (#2043)
yashim-deriv Aug 27, 2021
f0ccc40
Carousel height fix mobile (#2055)
ShuvoHabib Aug 30, 2021
3129e9d
Kevin/recent featured - cms (#2048)
virtualpowwa Sep 2, 2021
f0428c7
nikolai.berestevich/feat/add subscribe-banner on single article page …
nikolaiberestevich-deriv Sep 2, 2021
c182b3f
Suthesh/limit-text-length (#2063)
suthesank Sep 2, 2021
21cdc41
Nuri/feat: Added breadcrumbs for article and preview page (#2059)
njazuli-deriv Sep 2, 2021
521d764
Sean/refactor(routes): refactor blog routes into academy + delete unu…
Sep 2, 2021
3923252
Nuri/refactor : Code cleanup for Preview, Side Subscription Banner, …
njazuli-deriv Sep 3, 2021
25e7534
nikolai.berestevich/fix/side sibscribe banner focus (#2071)
nikolaiberestevich-deriv Sep 3, 2021
50b381a
Kevin/refactor recent featured (#2073)
virtualpowwa Sep 6, 2021
32c7834
feat: add italic styling in blog content (#2078)
Sep 7, 2021
02c7efb
Suthesh/fix-dots-nextline (#2077)
suthesank Sep 8, 2021
cf821b9
nikolai.berestevich/fix/blog-subscribe-touched (#2080)
nikolaiberestevich-deriv Sep 8, 2021
4c2a9b5
Kevin/blog-hide-eu-feature (#2079)
virtualpowwa Sep 9, 2021
d6b5255
add spacing below subscribe banner (#2083)
Sep 10, 2021
c1788e0
Suthesh/academy-footer (#2081)
suthesank Sep 10, 2021
c1fad75
Sean/update-single-post-template-styles (#2099)
Sep 15, 2021
ff538c1
Kevin/fix style on safari (#2085)
virtualpowwa Sep 15, 2021
0af367e
change blog to academy (#2103)
virtualpowwa Sep 15, 2021
2db963f
fix: expanded height of tags when title is one line long (#2113)
Sep 20, 2021
2c35df8
sorting order of homepage banner data (#2118)
suthesank Sep 20, 2021
b5b51b6
fix: default tab query (#2120)
mustofa-binary Sep 21, 2021
fb5f59b
Nuri/fix :Change tags from market news to market report (#2124)
njazuli-deriv Sep 21, 2021
5a5821e
fix: internal link warning on console (#2116)
Sep 21, 2021
84a2878
fix: update layout type for blog pages (#2128)
Sep 21, 2021
2c63c43
Kevin/all-article-safari-fix (#2126)
virtualpowwa Sep 22, 2021
879b84e
fix: text issues on deriv blog (#2129)
fiona-deriv Sep 22, 2021
8e60b1d
Nuri/fix : Side subscription banner field validation (#2123)
njazuli-deriv Sep 24, 2021
b9191e9
fix: restrict author image size (#2152)
Sep 28, 2021
f1f0b26
NJ/Fix: New image dimension (#2150)
njazuli-deriv Sep 29, 2021
3e65989
feat: replace vertical carousel with overflow scroll (#2155)
Sep 29, 2021
2705baf
chore: merge latest master into blog & resolve conflicts
seanho96 Oct 1, 2021
479cb1c
fix: missing margin on market news section on mobile (#2159)
Oct 1, 2021
8f065d9
style: update scrollbar style (#2168)
Oct 2, 2021
640fa5f
feat: add auth token to preview link (#2174)
Oct 4, 2021
35bd592
chore: add public token for preview page (#2176)
Oct 4, 2021
df8b7df
NJ/fix: Fixed blog carousel (#2164)
njazuli-deriv Oct 4, 2021
0868582
chore: replace http with https
seanho96 Oct 5, 2021
41d7f65
style: update inactive carousel dot colour (#2179)
Oct 6, 2021
bc8ed9a
nikolai.berestevich/fix/academy-video-bug after pressing space (#2183)
nikolaiberestevich-deriv Oct 18, 2021
9898aa9
Merge branch 'master' into blog
habib-deriv Oct 19, 2021
b3fc208
fix: eslint errors
seanho96 Oct 20, 2021
c4a8030
chore: remove blog from excluded pages
seanho96 Oct 21, 2021
7eac458
feat: add staging environment
seanho96 Oct 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
- name: Cache dependencies
id: cache
uses: actions/cache@v2
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Setup Node
uses: actions/[email protected]
with:
node-version: '12.x'
node-version: '14.x'

- name: Set version env variable
run: echo "GATSBY_DERIV_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
environment: staging

steps:
- name: Checkout 🛎️
Expand All @@ -25,7 +26,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
- name: Cache dependencies
id: cache
uses: actions/cache@v2
Expand All @@ -43,14 +44,15 @@ jobs:
needs: lint
timeout-minutes: 30
runs-on: ubuntu-latest
environment: staging
steps:
- name: Checkout 🛎️
uses: actions/[email protected]

- name: Setup Node
uses: actions/[email protected]
with:
node-version: '12.x'
node-version: '14.x'

- name: Cache dependencies
uses: actions/cache@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ typings/

# dotenv environment variables file
.env
.env.development
.env.production

# gatsby files
.cache/
Expand Down
4 changes: 4 additions & 0 deletions deriv.com.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ server {
return 301 https://$http_host/careers/;
}

location ~* "^/([\w]{2}|zh-tw|zh-cn)/academy" {
return 301 https://$http_host/academy/;
}

location = /sw.js {
add_header Cache-Control "public, max-age=0, must-revalidate";
}
Expand Down
17 changes: 16 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const language_config = require(`./i18n-config.js`)
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
})

module.exports = {
// pathPrefix: process.env.PATH_PREFIX || '/deriv-com/', // For non CNAME GH-pages deployment
Expand Down Expand Up @@ -73,7 +76,7 @@ module.exports = {
],
serialize: ({ site, allSitePage }) =>
allSitePage.edges.map((edge) => {
const ignore_localized_regex = /careers|besquare|livechat/
const ignore_localized_regex = /careers|besquare|livechat|academy/
const path = edge.node.path
let priority = 0.7
const languages = Object.keys(language_config)
Expand Down Expand Up @@ -218,5 +221,17 @@ module.exports = {
offset: -100,
},
},
{
resolve: '@directus/gatsby-source-directus',
options: {
url: 'https://cms.deriv.cloud',
auth: {
token: process.env.DIRECTUS_AUTH_TOKEN,
},
dev: {
refresh: '5s',
},
},
},
],
}
36 changes: 35 additions & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ exports.onCreatePage = ({ page, actions }) => {
const localized_path = is_default ? page.path : `${path}${page.path}`
const is_production = process.env.GATSBY_ENV === 'production'
const excluded_pages_regex =
/^[a-z-]+\/(careers|endpoint|offline-plugin-app-shell-fallback|besquare|livechat)\//g
/^[a-z-]+\/(careers|endpoint|offline-plugin-app-shell-fallback|besquare|livechat|academy)\//g

if (is_production) {
if (path === 'ach') return
Expand Down Expand Up @@ -281,3 +281,37 @@ exports.onCreateWebpackConfig = ({ actions, getConfig }, { ...options }) => {
},
})
}

// TODO: To be updated to the new shape of the API of the new endpoint
exports.createPages = async ({ reporter, actions, graphql }) => {
const { createPage } = actions
const articleTemplate = path.resolve(__dirname, 'src/templates/article.js')

// Query our published articles
const result = await graphql(`
query MyQuery {
directus {
blog(filter: { status: { _eq: "published" } }) {
id
slug
}
}
}
`)

if (result.errors) {
reporter.panic(result.errors)
}
const blog = result.data.directus.blog
blog.forEach((blog_post) => {
createPage({
path: `/academy/blog/posts/${blog_post.slug}`,
component: articleTemplate,
context: {
locale: 'en',
pathname: `/academy/blog/posts/${blog_post.slug}`,
slug: blog_post.slug,
},
})
})
}
Loading