Commit e288229d authored by Sandeep Kadam's avatar Sandeep Kadam

New VF gutenburg block changes for microsite deployment

parent a66c1175
......@@ -77,6 +77,7 @@ vf-group-header-block
vf-jobs-block
vf-members-block
embl-group-site-roles
vf-publications-group-ebi-block
';
echo "VF Plugins - Activating VF Plugins"
......@@ -245,13 +246,10 @@ TEAM_LONG_DESCRIPTION="<h1>${WP_GROUP_TEAM_SHORT_DESCRIPTION} <a href='about'>Re
# Set the Gutenberg HTML content for the homepage
IFS='' read -r home_page_content <<EOF
<!-- wp:acf/vf-group-header {"id":"block_a474cc5f88","data":{"field_vf_block_custom":"0"},"name":"acf/vf-group-header","mode":"preview"} /-->
<!-- wp:acf/vf-latest-posts {"id":"block_5c65674caae4f","data":{"field_vf_block_custom":"0"},"name":"acf/vf-latest-posts","mode":"preview"} /-->
<!-- wp:acf/vf-data-resources {"id":"block_5c65674caae51","data":{"field_vf_block_custom":"1","field_acf/vf-data-resources_clone":{"field_vf_data-resources_heading":"Data resources","field_vf_data_resources_limit":"100"}},"name":"acf/vf-data-resources","mode":"preview"} /-->
<!-- wp:acf/vf-jobs {"id":"block_5c65674caae51","data":{"field_vf_block_custom":"1","field_acf/vf-jobs_clone":{"field_vf_jobs_heading":"Latest jobs","field_vf_jobs_limit":"1"}},"name":"acf/vf-jobs","mode":"preview"} /-->
<!-- wp:vf/group-header {"ver":1} /-->
<!-- wp:vf/latest-posts {"ver":1} /-->
<!-- wp:vf/data-resources {"ver":1} /-->
<!-- wp:vf/jobs {"limit":1,"filter":"all","ver":1} /-->
EOF
# Find ID of homepage and update contents
......@@ -264,7 +262,7 @@ if ! [[ `wp post list --post_type=page --name=members --field=ID` ]] ; then
echo "Members, about and blog - Configuring"
# Set the Gutenberg HTML content for the members page
IFS='' read -r members_page_content <<EOF
<!-- wp:acf/vf-members {"id":"block_5c5981f15bfdc","name":"acf/vf-members","align":"","mode":"preview"} /-->
<!-- wp:vf/members {"ver":1} /-->
EOF
team_page_id="$(wp post create --post_title='Members' --post_type=page --post_status=publish --post_content="$members_page_content" --porcelain)"
......@@ -285,4 +283,54 @@ else
echo "Members, about and blog - already configured"
fi
default_blog_post_content="<!-- wp:paragraph -->
<p>This is your first post. Edit or delete it, or write a new post!</p>
<!-- /wp:paragraph -->
<!-- wp:heading {\"level\":3} -->
<h3>Writing a new blog post</h3>
<!-- /wp:heading -->
<!-- wp:list {\"ordered\":true} -->
<ol><li>To write a new blog post, click on 'Posts' in the administration menu. </li><li>Next to the title, click the button 'Add New'.</li><li>Get writing!</li><li>Don't forget to include any document options in the sidebar.</li><li>When you are ready, you can either save the post, Preview it, or Publish.</li></ol>
<!-- /wp:list -->
<!-- wp:heading {\"level\":3} -->
<h3>Deleting a post</h3>
<!-- /wp:heading -->
<!-- wp:list {\"ordered\":true} -->
<ol><li>Click on 'Posts' in the administration menu. </li><li>Navigate to the post you want to delete and hover over the title. You should see the links: 'Edit', Quick Edit', 'Trash' and 'View'. Trash is in red.</li><li>Click 'Trash'. This moves your blog post into the trash where it is always retrievable unless you delete it permanently.</li><li>To retrieve your blog post, Click on the 'Trash' navigation link next to 'All' at the top of the table of blog posts.</li></ol>
<!-- /wp:list -->
<!-- wp:heading {\"level\":3} -->
<h3>Removing the blog from your navigation menu</h3>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>If you decide you don't want a blog for your group or team then you should remove it from the site's navigation menu.</p>
<!-- /wp:paragraph -->
<!-- wp:list {\"ordered\":true} -->
<ol><li>In the administration menu, click on 'Appearance'</li><li>In the Appearance sub-menu, click 'Menus'</li><li>Find the menu item 'Blog' and click the arrow to reveal options.</li><li>Click 'Remove'</li></ol>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p>Don't worry, you can always add it again. Doing this doesn't delete the blog, or the blog posts, but just removes the link in the navigation.</p>
<!-- /wp:paragraph -->";
# Update blog post content
wp post update 1 --post_title="Welcome to your new group or team blog!" --post_content="$default_blog_post_content";
# Set the VF Theme Color if not set
#db_theme_color_value="$(wp option pluck theme_mods_vf-themes vf_theme_color)"
if ! [[ `wp option pluck theme_mods_vf-themes vf_theme_color` ]] ; then
# if [ -n "$db_theme_color_value" ]; then
wp option patch insert theme_mods_vf-themes vf_theme_color "$VF_THEME_COLOR";
else
wp option patch update theme_mods_vf-themes vf_theme_color "$VF_THEME_COLOR";
fi
echo "Wordpress Group Visual framework local setup completed!!!"
......@@ -262,6 +262,7 @@ case "${COMMAND}" in
vf-data-resources-block
embl-group-site-roles
ga-google-analytics
vf-publications-group-ebi-block
';
# Check if plugin is active, if not then activate plugins
......@@ -374,9 +375,10 @@ case "${COMMAND}" in
# Configure the homepage
# Set the Gutenberg HTML content for the homepage of microsite
home_page_content=$(cat <<EOF
<!-- wp:acf/vf-group-header {"id":"block_a474cc5f88","data":{"field_vf_block_custom":"0"},"name":"acf/vf-group-header","mode":"preview"} /-->
<!-- wp:acf/vf-data-resources {"id":"block_5c65674caae51","data":{"field_vf_block_custom":"1","field_acf/vf-data-resources_clone":{"field_vf_data-resources_heading":"Data resources","field_vf_data_resources_limit":"100"}},"name":"acf/vf-data-resources","mode":"preview"} /-->
<!-- wp:acf/vf-jobs {"id":"block_5d10c88727d18","data":{"field_vf_block_custom":"1","field_acf/vf-jobs_clone":{"field_vf_jobs_heading":"Latest Jobs","field_vf_jobs_limit":"5","field_vf_jobs_filter":"what"}},"name":"acf/vf-jobs","align":"","mode":"preview"} /-->
<!-- wp:vf/group-header {"ver":1} /-->
<!-- wp:vf/latest-posts {"ver":1} /-->
<!-- wp:vf/data-resources {"ver":1} /-->
<!-- wp:vf/jobs {"limit":1,"filter":"all","ver":1} /-->
EOF);
# Find ID of homepage and update contents
......@@ -396,7 +398,7 @@ EOF);
if ! $(wp post list --post_type=page --fields=post_title | grep -qE "^Members"); then
# Set the Gutenberg HTML content for the members page
IFS='' read -r members_page_content <<EOF
<!-- wp:acf/vf-members {"id":"block_5c5981f15bfdc","name":"acf/vf-members","align":"","mode":"preview"} /-->
<!-- wp:vf/members {"ver":1} /-->
EOF
team_page_id="$(wp post create --post_title='Members' --post_type=page --post_status=publish --post_content="$members_page_content" --porcelain)"
wp menu item add-post primary $team_page_id --title="Members"
......@@ -431,8 +433,6 @@ EOF
fi
fi
default_blog_post_content="<!-- wp:paragraph -->
<p>This is your first post. Edit or delete it, or write a new post!</p>
<!-- /wp:paragraph -->
......
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