Commit 37ec3708 authored by GitLab's avatar GitLab Committed by Vasilii Iakliushin
Browse files

Initialized from 'Static Site Editor/Middleman' project template

Template repository: https://gitlab.com/gitlab-org/project-templates/static-site-editor-middleman
Commit SHA: 64d67fe65d2125ecbd17e5c998064b5269631db3
parents
.bundle
.cache
.DS_Store
.sass-cache
build/
image: ruby:2.6.5
variables:
NO_CONTRACTS: "true"
before_script:
- gem install bundler
- bundle install
build:
stage: build
script:
- bundle exec middleman build --build-dir=build
artifacts:
paths:
- build
except:
- master
pages:
stage: deploy
script:
- bundle exec middleman build
artifacts:
paths:
- public
only:
- master
source 'https://rubygems.org'
gem 'middleman', '~> 4.2'
gem 'middleman-autoprefixer', '~> 2.7'
gem 'mini_racer', '~> 0.2.9'
gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby, :x64_mingw]
gem 'wdm', '~> 0.1', platforms: [:mswin, :mingw, :x64_mingw]
GEM
remote: https://rubygems.org/
specs:
activesupport (5.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
autoprefixer-rails (9.7.4)
execjs
backports (3.17.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.6)
contracts (0.13.0)
dotenv (2.7.5)
erubis (2.7.0)
execjs (2.7.0)
fast_blank (1.0.0)
fastimage (2.1.7)
ffi (1.12.2)
haml (5.1.2)
temple (>= 0.8.0)
tilt
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashie (3.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
kramdown (1.17.0)
libv8 (7.3.492.27.1)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
memoist (0.16.2)
middleman (4.3.6)
coffee-script (~> 2.2)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-cli (= 4.3.6)
middleman-core (= 4.3.6)
middleman-autoprefixer (2.10.1)
autoprefixer-rails (~> 9.1)
middleman-core (>= 3.3.3)
middleman-cli (4.3.6)
thor (>= 0.17.0, < 2.0)
middleman-core (4.3.6)
activesupport (>= 4.2, < 5.1)
addressable (~> 2.3)
backports (~> 3.6)
bundler
contracts (~> 0.13.0)
dotenv
erubis
execjs (~> 2.0)
fast_blank
fastimage (~> 2.0)
hamster (~> 3.0)
hashie (~> 3.4)
i18n (~> 0.9.0)
listen (~> 3.0.0)
memoist (~> 0.14)
padrino-helpers (~> 0.13.0)
parallel
rack (>= 1.4.5, < 3)
sassc (~> 2.0)
servolux
tilt (~> 2.0.9)
uglifier (~> 3.0)
mini_racer (0.2.9)
libv8 (>= 6.9.411)
minitest (5.14.0)
padrino-helpers (0.13.3.4)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.13.3.4)
tilt (>= 1.4.1, < 3)
padrino-support (0.13.3.4)
activesupport (>= 3.1)
parallel (1.19.1)
public_suffix (4.0.3)
rack (2.2.2)
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
sassc (2.2.1)
ffi (~> 1.9)
servolux (0.13.0)
temple (0.8.2)
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.10)
tzinfo (1.2.6)
thread_safe (~> 0.1)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
PLATFORMS
ruby
DEPENDENCIES
middleman (~> 4.2)
middleman-autoprefixer (~> 2.7)
mini_racer (~> 0.2.9)
tzinfo-data
wdm (~> 0.1)
BUNDLED WITH
2.1.4
# Static Site Editor Template for GitLab Pages
## How to publish the website
1. Edit the [data/config.yml](/data/config.yml) file and update the repository URL by replacing `<username>` with your GitLab username and `<project-name>` with the name of the project you've created. Example: `http://gitlab.com/john/blog`.
1. Commit and push the change to the repository.
1. In GitLab, visit the CI / CD -> Pipelines page for your project (accessible from the left-hand menu).
1. Click on the `Run pipeline` button, if there are no active pipelines running after pushing up your change.
1. Once the the pipeline has successfully finished, open the following URL in your browser: `https://<username>.gitlab.io/<project-name>`. Note that it might take 10-15 minutes before the website becomes available after the first successful pipeline has finished.
## How to use the Static Site Editor feature
1. Open `https://<username>.gitlab.io/<project-name>` link in your browser.
1. Click on `Edit this page` button on the bottom of the website.
1. Use the Static Site Editor to make changes to the content and save the changes by creating a merge request.
1. Merge your merge request to master branch.
1. GitLab CI will automatically apply changes to your website.
## Local development
1. Clone this project.
1. Download dependencies: `bundle install`. If you see an error that bundler is missing, then try to run `gem install bundler`.
1. Run the project: `bundle exec middleman`.
1. Open http://localhost:4567 in your browser.
## Useful information
[GitLab Pages default domain names](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html#gitlab-pages-default-domain-names)
## Learning Middleman
* Visit [Middleman website](https://middlemanapp.com)
* Take a look at [the documentation](https://middlemanapp.com/basics/install)
* Explore [the source code](https://github.com/middleman/middleman)
# Activate and configure extensions
# https://middlemanapp.com/advanced/configuration/#configuring-extensions
activate :autoprefixer do |prefix|
prefix.browsers = "last 2 versions"
end
# Layouts
# https://middlemanapp.com/basics/layouts/
# Per-page layout changes
page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false
configure :build do
set :build_dir, 'public'
activate :minify_css
activate :minify_javascript
activate :relative_assets
end
# With alternative layout
# page '/path/to/file.html', layout: 'other_layout'
# Proxy pages
# https://middlemanapp.com/advanced/dynamic-pages/
# proxy(
# '/this-page-has-no-template.html',
# '/template-file.html',
# locals: {
# which_fake_page: 'Rendering a fake page with a local variable'
# },
# )
# Helpers
# Methods defined in the helpers block are available in templates
# https://middlemanapp.com/basics/helper-methods/
# helpers do
# def some_helper
# 'Helping'
# end
# end
# Build-specific configuration
# https://middlemanapp.com/advanced/configuration/#environment-specific-settings
repository: https://gitlab.com/<username>/<project-name>
module CustomHelpers
def edit_page_url(base_url, relative_path)
"#{base_url}/-/sse/#{encode_path(relative_path)}/"
end
def encode_path(relative_path)
ERB::Util.url_encode("master/source/#{relative_path}")
end
end
---
title: Welcome to Middleman
---
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 340" class="middleman-logo" aria-labelledby="middleman-logo__title" role="img">
<title id="middleman-logo__title">Middleman</title>
<path class="middleman-logo__top-left-bar" fill-opacity=".45" d="M0 40L200 0v30L0 60z"/>
<path class="middleman-logo__top-right-bar" fill="#fff" d="M200 0l200 40v20L200 30z"/>
<path class="middleman-logo__left-m" fill-opacity=".45" d="M0 78v184l45 5V152l45 83 47-83v129l53 7V52l-57 8-43 83-43-70z"/>
<path class="middleman-logo__right-m" fill="#fff" d="M400 78v184l-45 5V152l-45 83-47-83v129l-53 7V52l57 8 43 83 43-70z"/>
<path class="middleman-logo__bottom-left-bar" fill-opacity=".45" d="M0 300l200 40v-30L0 280z"/>
<path class="middleman-logo__bottom-right-bar" fill="#fff" d="M200 340l200-40v-20l-200 30z"/>
</svg>
# Middleman is Running
[Read documentation](https://middlemanapp.com/basics/templating_language/)
// This is where it all goes :)
document.addEventListener("DOMContentLoaded", () => {
var a = document.getElementById('edit-page-link');
a.setAttribute('href', a.href + "?return_url=" + encodeURIComponent(window.location.href));
});
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Use the title from a page's frontmatter if it has one -->
<title><%= current_page.data.title || "Middleman" %></title>
<%= stylesheet_link_tag "site" %>
<%= javascript_include_tag "site" %>
</head>
<body>
<%= yield %>
<div class="edit-page">
<%= link_to('Edit this page', edit_page_url(data.config.repository, current_page.file_descriptor.relative_path), id: 'edit-page-link') %>
</div>
</body>
</html>
body {
background-color: #fbc547;
color: #333;
font-family: -apple-system, BlinkMacSystemFont, "Avenir Next", "Avenir",
"Segoe UI", "Lucida Grande", "Helvetica Neue", "Helvetica", "Fira Sans",
"Roboto", "Noto", "Droid Sans", "Cantarell", "Oxygen", "Ubuntu",
"Franklin Gothic Medium", "Century Gothic", "Liberation Sans", sans-serif;
padding: 18vh 1rem;
text-align: center;
}
a {
color: rgba(#000, 0.7);
&:focus,
&:hover {
color: rgba(#000, 0.6);
}
}
.middleman-logo {
margin-bottom: 1rem;
width: 10rem;
}
.edit-page {
position: fixed;
padding-top: 20px;
padding-bottom: 20px;
background: #6b4fbb;
bottom: 0px;
width: 150px;
border-radius: 25px 25px 0px 0px;
a#edit-page-link {
color: #fff;
text-decoration: none;
}
}
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