From 37410a9ddf2eb90361974fd676bd0558dcad3ffa Mon Sep 17 00:00:00 2001 From: Jason Lenny Date: Tue, 29 Jan 2019 08:25:52 +0000 Subject: Add Pages templates Adds templates for the 5 most popular Pages templates to the new project menu. This does not add unique icons for the templates because that turned out more complicated than expected, and this feature is valuable without them. --- app/assets/javascripts/projects/project_new.js | 20 ++++++++++++++ app/views/projects/new.html.haml | 3 +++ changelogs/unreleased/jlenny-AddPagesTemplates.yml | 5 ++++ lib/gitlab/project_template.rb | 11 +++++--- locale/gitlab.pot | 30 +++++++++++++++++++++ spec/lib/gitlab/project_template_spec.rb | 7 ++++- vendor/project_templates/gitbook.tar.gz | Bin 0 -> 13808 bytes vendor/project_templates/hexo.tar.gz | Bin 0 -> 548020 bytes vendor/project_templates/hugo.tar.gz | Bin 0 -> 1048753 bytes vendor/project_templates/jekyll.tar.gz | Bin 0 -> 60703 bytes vendor/project_templates/plainhtml.tar.gz | Bin 0 -> 12079 bytes 11 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 changelogs/unreleased/jlenny-AddPagesTemplates.yml create mode 100644 vendor/project_templates/gitbook.tar.gz create mode 100644 vendor/project_templates/hexo.tar.gz create mode 100644 vendor/project_templates/hugo.tar.gz create mode 100644 vendor/project_templates/jekyll.tar.gz create mode 100644 vendor/project_templates/plainhtml.tar.gz diff --git a/app/assets/javascripts/projects/project_new.js b/app/assets/javascripts/projects/project_new.js index 998554d1be5..9ca1a26b3ac 100644 --- a/app/assets/javascripts/projects/project_new.js +++ b/app/assets/javascripts/projects/project_new.js @@ -125,6 +125,26 @@ const bindEvents = () => { text: 'Spring', icon: '.template-option svg.icon-java-spring', }, + hugo: { + text: 'Pages/Hugo', + icon: '.template-option svg.icon-pages-hugo', + }, + jekyll: { + text: 'Pages/Jekyll', + icon: '.template-option svg.icon-pages-jekyll', + }, + plainhtml: { + text: 'Pages/Plain HTML', + icon: '.template-option svg.icon-pages-plainhtml', + }, + gitbook: { + text: 'Pages/GitBook', + icon: '.template-option svg.icon-pages-gitbook', + }, + hexo: { + text: 'Pages/Hexo', + icon: '.template-option svg.icon-pages-hexo', + }, }; const selectedTemplate = templates[value]; diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 8275996b522..ff7c36c2d5b 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -16,6 +16,9 @@ = _('A project is where you house your files (repository), plan your work (issues), and publish your documentation (wiki), %{among_other_things_link}.').html_safe % { among_other_things_link: among_other_things_link } %p = _('All features are enabled for blank projects, from templates, or when importing, but you can disable them afterward in the project settings.') + %p + - pages_getting_started_guide = link_to _('Pages getting started guide'), help_page_path("user/project/pages/getting_started_part_two", anchor: "fork-a-project-to-get-started-from"), target: '_blank' + = _('Information about additional Pages templates and how to install them can be found in our %{pages_getting_started_guide}.').html_safe % { pages_getting_started_guide: pages_getting_started_guide } .md = brand_new_project_guidelines %p diff --git a/changelogs/unreleased/jlenny-AddPagesTemplates.yml b/changelogs/unreleased/jlenny-AddPagesTemplates.yml new file mode 100644 index 00000000000..0985e4e18ed --- /dev/null +++ b/changelogs/unreleased/jlenny-AddPagesTemplates.yml @@ -0,0 +1,5 @@ +--- +title: Add templates for most popular Pages templates +merge_request: 24906 +author: +type: added diff --git a/lib/gitlab/project_template.rb b/lib/gitlab/project_template.rb index 3bfd6ee892c..b8b1c4b6490 100644 --- a/lib/gitlab/project_template.rb +++ b/lib/gitlab/project_template.rb @@ -27,9 +27,14 @@ module Gitlab end TEMPLATES_TABLE = [ - ProjectTemplate.new('rails', 'Ruby on Rails', 'Includes an MVC structure, Gemfile, Rakefile, along with many others, to help you get started.', 'https://gitlab.com/gitlab-org/project-templates/rails'), - ProjectTemplate.new('spring', 'Spring', 'Includes an MVC structure, mvnw and pom.xml to help you get started.', 'https://gitlab.com/gitlab-org/project-templates/spring'), - ProjectTemplate.new('express', 'NodeJS Express', 'Includes an MVC structure to help you get started.', 'https://gitlab.com/gitlab-org/project-templates/express') + ProjectTemplate.new('rails', 'Ruby on Rails', _('Includes an MVC structure, Gemfile, Rakefile, along with many others, to help you get started.'), 'https://gitlab.com/gitlab-org/project-templates/rails'), + ProjectTemplate.new('spring', 'Spring', _('Includes an MVC structure, mvnw and pom.xml to help you get started.'), 'https://gitlab.com/gitlab-org/project-templates/spring'), + ProjectTemplate.new('express', 'NodeJS Express', _('Includes an MVC structure to help you get started.'), 'https://gitlab.com/gitlab-org/project-templates/express'), + ProjectTemplate.new('hugo', 'Pages/Hugo', _('Everything you need to create a GitLab Pages site using Hugo.'), 'https://gitlab.com/pages/hugo'), + ProjectTemplate.new('jekyll', 'Pages/Jekyll', _('Everything you need to create a GitLab Pages site using Jekyll.'), 'https://gitlab.com/pages/jekyll'), + ProjectTemplate.new('plainhtml', 'Pages/Plain HTML', _('Everything you need to create a GitLab Pages site using plain HTML.'), 'https://gitlab.com/pages/plain-html'), + ProjectTemplate.new('gitbook', 'Pages/GitBook', _('Everything you need to create a GitLab Pages site using GitBook.'), 'https://gitlab.com/pages/gitbook'), + ProjectTemplate.new('hexo', 'Pages/Hexo', _('Everything you need to create a GitLab Pages site using Hexo.'), 'https://gitlab.com/pages/hexo') ].freeze class << self diff --git a/locale/gitlab.pot b/locale/gitlab.pot index df4975877df..1377912f7bc 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -3157,6 +3157,21 @@ msgstr "" msgid "Everyone can contribute" msgstr "" +msgid "Everything you need to create a GitLab Pages site using GitBook." +msgstr "" + +msgid "Everything you need to create a GitLab Pages site using Hexo." +msgstr "" + +msgid "Everything you need to create a GitLab Pages site using Hugo." +msgstr "" + +msgid "Everything you need to create a GitLab Pages site using Jekyll." +msgstr "" + +msgid "Everything you need to create a GitLab Pages site using plain HTML." +msgstr "" + msgid "Except policy:" msgstr "" @@ -3908,12 +3923,24 @@ msgstr "" msgid "Include the username in the URL if required: https://username@gitlab.company.com/group/project.git." msgstr "" +msgid "Includes an MVC structure to help you get started." +msgstr "" + +msgid "Includes an MVC structure, Gemfile, Rakefile, along with many others, to help you get started." +msgstr "" + +msgid "Includes an MVC structure, mvnw and pom.xml to help you get started." +msgstr "" + msgid "Incompatible Project" msgstr "" msgid "Indicates whether this runner can pick jobs without tags" msgstr "" +msgid "Information about additional Pages templates and how to install them can be found in our %{pages_getting_started_guide}." +msgstr "" + msgid "Inline" msgstr "" @@ -5077,6 +5104,9 @@ msgstr "" msgid "Pages Domains" msgstr "" +msgid "Pages getting started guide" +msgstr "" + msgid "Pagination|Last ยป" msgstr "" diff --git a/spec/lib/gitlab/project_template_spec.rb b/spec/lib/gitlab/project_template_spec.rb index 57b0ef8d1ad..1cc2bde50e9 100644 --- a/spec/lib/gitlab/project_template_spec.rb +++ b/spec/lib/gitlab/project_template_spec.rb @@ -6,7 +6,12 @@ describe Gitlab::ProjectTemplate do expected = [ described_class.new('rails', 'Ruby on Rails', 'Includes an MVC structure, .gitignore, Gemfile, and more great stuff', 'https://gitlab.com/gitlab-org/project-templates/rails'), described_class.new('spring', 'Spring', 'Includes an MVC structure, .gitignore, Gemfile, and more great stuff', 'https://gitlab.com/gitlab-org/project-templates/spring'), - described_class.new('express', 'NodeJS Express', 'Includes an MVC structure, .gitignore, Gemfile, and more great stuff', 'https://gitlab.com/gitlab-org/project-templates/express') + described_class.new('express', 'NodeJS Express', 'Includes an MVC structure, .gitignore, Gemfile, and more great stuff', 'https://gitlab.com/gitlab-org/project-templates/express'), + described_class.new('hugo', 'Pages/Hugo', 'Everything you need to get started using a Hugo Pages site.', 'https://gitlab.com/pages/hugo'), + described_class.new('jekyll', 'Pages/Jekyll', 'Everything you need to get started using a Jekyll Pages site.', 'https://gitlab.com/pages/jekyll'), + described_class.new('plainhtml', 'Pages/Plain HTML', 'Everything you need to get started using a plain HTML Pages site.', 'https://gitlab.com/pages/plain-html'), + described_class.new('gitbook', 'Pages/GitBook', 'Everything you need to get started using a GitBook Pages site.', 'https://gitlab.com/pages/gitbook'), + described_class.new('hexo', 'Pages/Hexo', 'Everything you need to get started using a plan Hexo Pages site.', 'https://gitlab.com/pages/hexo') ] expect(described_class.all).to be_an(Array) diff --git a/vendor/project_templates/gitbook.tar.gz b/vendor/project_templates/gitbook.tar.gz new file mode 100644 index 00000000000..73062fca038 Binary files /dev/null and b/vendor/project_templates/gitbook.tar.gz differ diff --git a/vendor/project_templates/hexo.tar.gz b/vendor/project_templates/hexo.tar.gz new file mode 100644 index 00000000000..b32c4945366 Binary files /dev/null and b/vendor/project_templates/hexo.tar.gz differ diff --git a/vendor/project_templates/hugo.tar.gz b/vendor/project_templates/hugo.tar.gz new file mode 100644 index 00000000000..4bdb03f5b2f Binary files /dev/null and b/vendor/project_templates/hugo.tar.gz differ diff --git a/vendor/project_templates/jekyll.tar.gz b/vendor/project_templates/jekyll.tar.gz new file mode 100644 index 00000000000..ab61ddd03ea Binary files /dev/null and b/vendor/project_templates/jekyll.tar.gz differ diff --git a/vendor/project_templates/plainhtml.tar.gz b/vendor/project_templates/plainhtml.tar.gz new file mode 100644 index 00000000000..6927ae74de8 Binary files /dev/null and b/vendor/project_templates/plainhtml.tar.gz differ -- cgit v1.2.1