Skip to content

Commit 95fd2de

Browse files
committed
Update infrastructure
1 parent 7a1799b commit 95fd2de

File tree

6 files changed

+35
-22
lines changed

6 files changed

+35
-22
lines changed

.gitignore

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ _algolia_api_key
2424
# Docs from different repositories #
2525
###################################
2626

27-
/mbi/
28-
/page-builder/
29-
/page-builder-migration/
30-
/guides/m1x/
31-
/mftf/
27+
/src/mbi/
28+
/src/page-builder/
29+
/src/page-builder-migration/
30+
/src/guides/m1x/
31+
/src/mftf/

Docfile.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
content_map:
22
-
3-
directory: guides/m1x
3+
directory: src/guides/m1x
44
repository: magento/devdocs-m1
55
branch: master
66
filter: false
77
-
8-
directory: mbi
8+
directory: src/mbi
99
repository: magento/devdocs-mbi
1010
branch: master
1111
filter: true
1212
-
13-
directory: mftf
13+
directory: src/mftf
1414
repository: magento/magento2-functional-testing-framework
1515
branch: master
1616
filter: true
1717
-
18-
directory: page-builder
18+
directory: src/page-builder
1919
repository: magento/magento2-page-builder
2020
branch: 1.1-develop
2121
filter: true
2222
-
23-
directory: page-builder-migration
23+
directory: src/page-builder-migration
2424
repository: magento/magento2-page-builder-data-migration
2525
branch: 1.0.0-release
2626
filter: true

_config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ theme: devdocs
1515
# Base url that forms
1616
baseurl: ""
1717

18+
source: src
19+
20+
plugins_dir: ./_plugins
21+
1822
# Parameters for the version switcher. Numeric values must be wrapped in quotes.
1923
#
2024
version: "2.3"

_plugins/page-params/github-path.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515
# Skip redirects
1616
next if page.name == 'redirect.html'
1717

18-
dir = File.dirname page.path
18+
dir = File.join(
19+
page.site.source,
20+
File.dirname(page.path)
21+
)
22+
1923
filename = File.basename page.path
2024

2125
# Change to the parent directory of the page and read full file path
2226
# from git index.
23-
page.data['github_path'] =
24-
`cd #{dir} && git ls-files --full-name #{filename}`.strip
27+
Dir.chdir(dir) do
28+
page.data['github_path'] = `git ls-files --full-name #{filename}`.strip
29+
end
2530
end

_plugins/page-params/last-modified-at.rb

+8-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@
2424
# Skip pages created by custom generators like 'mrg_pages'
2525
next if page.kind_of? Jekyll::PageWithoutAFile
2626

27-
# Read real path of the page. If this is a symlink read it to get path of the real file with content.
28-
real_filepath = File.realpath page.path
29-
30-
dir = File.dirname real_filepath
27+
# Add site.source to the page path
28+
file_path = File.join(page.site.source, page.path)
29+
30+
# Get real path of the page. If this is a symlink read it to get path of the real file with content.
31+
real_filepath = File.realpath(file_path)
32+
33+
# Get a full path of the directory where the page is stored
34+
dir = File.dirname(real_filepath)
3135

3236
# Change directory to the parent directory of the page to read from the corresponding git history.
3337
Dir.chdir(dir) do

rakelib/update.rake

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace :update do
1313
task :mbi do
1414
puts 'Updating MBI docs:'.magenta
1515
abort 'Cannot find the "mbi/" directory' unless Dir.exist? 'mbi'
16-
Dir.chdir 'mbi' do
16+
Dir.chdir 'src/mbi' do
1717
sh 'git remote -v'
1818
sh 'git pull'
1919
sh 'git status -sb'
@@ -24,7 +24,7 @@ namespace :update do
2424
task :m1 do
2525
puts 'Updating Magento 1 docs:'.magenta
2626
abort 'Cannot find the "mbi/" directory' unless Dir.exist? 'guides/m1x'
27-
Dir.chdir 'guides/m1x' do
27+
Dir.chdir 'src/guides/m1x' do
2828
sh 'git remote -v'
2929
sh 'git pull'
3030
sh 'git status -sb'
@@ -35,7 +35,7 @@ namespace :update do
3535
task :pb do
3636
puts 'Updating Page Builder docs:'.magenta
3737
abort 'Cannot find the "page-builder" directory' unless Dir.exist? 'page-builder'
38-
Dir.chdir 'page-builder' do
38+
Dir.chdir 'src/page-builder' do
3939
sh 'git remote -v'
4040
sh 'git pull'
4141
sh 'git status -sb'
@@ -46,7 +46,7 @@ namespace :update do
4646
task :pbm do
4747
puts 'Updating Page Builder Migration docs'.magenta
4848
abort 'Cannot find the "page-builder-migration" directory' unless Dir.exist? 'page-builder-migration'
49-
Dir.chdir 'page-builder-migration' do
49+
Dir.chdir 'src/page-builder-migration' do
5050
sh 'git remote -v'
5151
sh 'git pull'
5252
sh 'git status -sb'
@@ -57,7 +57,7 @@ namespace :update do
5757
task :mftf do
5858
puts 'Updating MFTF docs:'.magenta
5959
abort 'Cannot find the "mftf" directory' unless Dir.exist? 'mftf'
60-
Dir.chdir 'mftf' do
60+
Dir.chdir 'src/mftf' do
6161
sh 'git remote -v'
6262
sh 'git pull'
6363
sh 'git status -sb'

0 commit comments

Comments
 (0)