Commit da10e528 authored by Úrsula Iguarán's avatar Úrsula Iguarán 💬

Fix issue #367

parent 6e3b911b
......@@ -43,7 +43,7 @@ pages:
script:
- if curl --fail -Lo artifacts.zip --header Private-Token:$DOCKER_PASSWD https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=deploy; then unzip artifacts.zip; else echo "There are no artifacts"; fi
- sed -i 's/output\/web/public/g' xmlcombine.sh
- sed -i 's/output/public/g' html-lint.sh
- sed -i 's/output/public/g' html-lint.sh draft.sh
- for FILE in $(find . -iname '*.adoc'); do sed -i 's/^include::/include::\/builds\/fluidsignal/g' $FILE; done
- pelican --fatal errors --fatal warnings -s pelicanconf-2018.py content/
- ./xmlcombine.sh
......@@ -51,6 +51,7 @@ pages:
- cp -r public/es/pages-es-2018/* public/es/ && rm -rf public/es/pages-es-2018
- cp -r public/en/pages-en-2018/* public/en/ && rm -rf public/en/pages-en-2018
- mv public/en/redirect/index.html public/ && rmdir public/en/redirect/
- ./draft.sh
artifacts:
paths:
- public
......@@ -80,6 +81,8 @@ deploy:
- mv output/web/en/redirect/index.html output/web/ && rmdir output/web/en/redirect/
# Set robots.txt
- mv robots.txt output/web/
# Organize images of articles with draft status
- ./draft.sh
# Erase content of the S3 bucket
- aws s3 rm --recursive "s3://$S3_BUCKET_NAME"
# Set 301 redirects
......
grep -qr ':status: draft' content
if [ $? -eq 0 ]; then
echo "Organizing images in draft articles..."
FILES=$(find output -iname '*.html')
for DRAFT in $(grep -lr ':status: draft' content); do
PATTERN=$(echo $DRAFT | sed -e 's/.*-e.\///' -e 's/\/index\.adoc//')
TARGET_DIR=$(grep -l $PATTERN $FILES | sed 's/index\.html//')
SRC_DIR=$(grep -l $PATTERN $FILES | sed 's/drafts/blog/; s/index\.html//');
mv $SRC_DIR* $TARGET_DIR;
done;
else
echo "There are no draft articles";
fi
\ No newline at end of file
......@@ -28,6 +28,8 @@ cp -r output/web/es/pages-es*/* output/web/es/ && rm -rf output/web/es/pages-es*
cp -r output/web/en/pages-en*/* output/web/en/ && rm -rf output/web/en/pages-en*
mv output/web/en/redirect/index.html output/web/ && rmdir output/web/en/redirect/
cp robots.txt output/web/
# Organize images of articles with draft status
./draft.sh
# Undo changes made to the file and change permissions of the files used by the container as root
git checkout -- pelicanconf.py pelicanconf-2018.py
chmod -R a+rwX {output/,pelicanconf.py,pelicanconf-2018.py,cache/}
......
......@@ -26,6 +26,8 @@ PAGE_PATHS = ['pages-en-2018']
STATIC_PATHS = ['images', 'files', 'blog-en', 'pages-en-2018']
ARTICLE_URL = 'blog/{slug}'
ARTICLE_SAVE_AS = 'blog-en/{slug}index.html'
DRAFT_URL = 'drafts/{slug}'
DRAFT_SAVE_AS = 'drafts/{slug}index.html'
PAGE_URL = '{slug}'
PAGE_SAVE_AS = 'pages-en-2018/{slug}index.html'
TAGS_SAVE_AS = 'blog/tags/index.html'
......
......@@ -28,6 +28,8 @@ ARTICLE_URL = 'blog/{slug}'
ARTICLE_SAVE_AS = 'blog-en/{slug}index.html'
PAGE_URL = '{slug}'
PAGE_SAVE_AS = 'pages-en/{slug}index.html'
DRAFT_URL = 'drafts/{slug}'
DRAFT_SAVE_AS = 'drafts/{slug}index.html'
TAGS_SAVE_AS = 'blog/tags/index.html'
TAGS_URL = 'blog/tags/'
TAG_SAVE_AS = 'blog/tags/{slug}/index.html'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment