Add blog to docs site (#1419)

This commit is contained in:
Jessica Parsons 2018-06-11 19:09:44 -07:00 committed by Shawn Erquhart
parent b65f68efd4
commit edfd35dfdc
8 changed files with 181 additions and 66 deletions

View File

@ -1,9 +1,11 @@
baseurl: "/"
baseurl: "https://www.netlifycms.org/"
languageCode: "en-us"
title: "Netlify CMS | Open-Source Content Management System"
disable404: true
pluralizeListTitles: false
metaDataFormat: "yaml"
permalinks:
blog: /blog/:year/:month/:title/
menu:
docs:
- name: start

View File

@ -0,0 +1,32 @@
---
title: Netlify CMS now supports GitLab as a backend
author: Benaiah Mischenko
description: >-
Netlify CMS, the open source, headless CMS that provides a user-friendly UI
around your Git repository, can now be used with GitLab in addition to
GitHub.
date: '2018-06-11'
---
Netlify CMS is releasing support for GitLab as a backend, creating the world's first completely open source stack for Git-based content editing.
<iframe width="100%" height="400" src="https://www.youtube.com/embed/ZrM3U0z8Sks?autoplay=1&loop=1&playlist=ZrM3U0z8Sks&mute=1&controls=0&modestbranding=1&showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
We heard [you](https://github.com/netlify/netlify-cms/pull/517#issuecomment-383283557) (and [you](https://github.com/netlify/netlify-cms/pull/517#issuecomment-355386542), and [you](https://github.com/netlify/netlify-cms/pull/517#issuecomment-343569725), and [you](https://github.com/netlify/netlify-cms/pull/517#issuecomment-333629637))! While you want to use Netlify CMS as the headless content management system for your JAMstack projects, all of your code lives in GitLab. Our long-term vision is to be tool-agnostic so you can use whatever tool helps you work best. But while you can already use Netlify CMS with most static site generators, backend support was limited to GitHub.
Immediately after the December release of Netlify CMS 1.0, contributors got to work on improving the API for backend integrations. At the urging of the community, we prioritized support for GitLab. With todays release of Netlify CMS 1.9.0, you can now use GitLab as the backend for Netlify CMS.
Adding support for GitLab means that millions more developers can now use Netlify CMS with their projects. Seriously — millions. GitLab is used by more than 100,000 organizations like Ticketmaster, Intel, Red Hat, and CERN.
## How it works
Netlify CMS is an open source content management system for your Git workflow that enables you to provide editors with a friendly UI and intuitive workflow. You can use it with any static site generator to create faster, more flexible web projects. Content is stored in your GitLab repository alongside your code for easier versioning, multi-channel publishing, and the option to handle content updates directly in Git.
In case you want an even easier way to get started, or just want to poke around in the code, you can use the button below to automatically deploy a starter site that uses the Hugo static site generator along with Netlify CMS.
<a href="https://app.netlify.com/start/deploy?repository=https://gitlab.com/netlify-templates/one-click-hugo-cms&stack=cms" rel="nofollow noreferrer noopener" target="_blank"><img src="https://www.netlify.com/img/deploy/button.svg" alt="Deploy to Netlify"></a>
Lastly, one particularly exciting thing about using GitLab as your backend is that it doesnt require an authentication server. While the GitHub integration requires a hop to an authentication server (something Netlify provides for most users), GitLabs implicit auth flow allows you to connect directly from your browser to gitlab.com, or even to your own self-hosted GitLab server!
## Whats next
Were already working toward [Bitbucket](https://github.com/netlify/netlify-cms/pull/525) support and will be releasing it as soon as possible! Were also focused on the upcoming release of [Netlify CMS 2.0](https://github.com/netlify/netlify-cms/issues/1280), which will bring new image handling features and improvements, and improved APIs for better CMS extensions. Were also looking for more ideas and helping hands, so if youre keen to build a smarter, safer, and more scalable CMS, wed love your contributions. Give us a shout on [Twitter](https://twitter.com/netlifycms) or Gitter if you have questions or ideas.

View File

@ -0,0 +1,16 @@
{{ partial "header" . }}
<div class="docs page">
<div class="container">
<article class="blog-content" id="blog-content">
<div class="blog-post-header">
<h1>{{ .Title }}</h1>
<p class="meta-info">by {{ .Params.author }} on {{ .Date.Format "January 2, 2006" }}</p>
</div>
{{ .Content }}
</article>
</div>
</div>
{{ partial "footer" . }}

View File

@ -12,10 +12,26 @@
<meta name="application-name" content="NetlifyCMS">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="/css/main.css"/>
<meta name="description" content=
{{ if .Params.meta_description }}
{{ .Params.meta_description }}
{{ else if .Params.description }}
{{ .Params.description }}
{{ else if or (eq .Section "blog") (eq .Title "Blog") }}
"Recent news and updates about Netlify CMS."
{{ else }}
"Netlify CMS provides open source content management for your Git workflow."
{{ end }}
>
{{ if or (eq .Section "docs") (eq .Title "Docs") }}
<link rel="stylesheet" href="/css/lib/prism.css"/>
{{ end }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s+%s" href="%s" title="%s" />` .Rel .MediaType.Type .MediaType.Suffix .Permalink $.Site.Title | safeHTML }}
{{ end -}}
</head>
<body>
{{ range .Site.Data.notifications }}
@ -25,7 +41,7 @@
{{ end }}
{{ end }}
{{ end }}
<header id="header" {{ if or (eq .Section "docs") (eq .Title "Docs") }}class="docs"{{ end }}>
<header id="header" class="{{ .Section }}">
<div class="contained">
<div class="logo-container">
<a href="/" class="logo"><img src="/img/netlify-cms-logo.svg"/></a>
@ -40,6 +56,7 @@
<a class="nav-link docs-link" href="/docs/intro/">Docs</a>
<a class="nav-link contributing-link" href="/docs/contributor-guide">Contributing</a>
<a class="nav-link" href="/community">Community</a>
<a class="nav-link" href="/blog/">Blog</a>
<a id="ghstars" class="github-button" href="https://github.com/netlify/netlify-cms" data-icon="octicon-star" data-show-count="true" aria-label="Star netlify/netlify-cms on GitHub">Star</a>
</div>
</div>

View File

@ -0,0 +1,17 @@
{{ partial "header" . }}
<div class="blog page">
<div class="container">
<h1>Netlify CMS Blog</h1>
{{ range (.Paginate .Data.Pages.ByDate.Reverse ).Pages }}
<article class="blog-list-item">
<h2><a href="{{ .Permalink }}" class="article">{{ .Title }}</a></h2>
<p class="meta-info">by {{ .Params.author }} on {{ .Date.Format "January 2, 2006" }}</p>
<p>{{ .Description }}</p>
</article>
{{ end }}
{{ template "_internal/pagination.html" . }}
</div>
</div>
{{ partial "footer" . }}

View File

@ -1,6 +1,7 @@
backend:
name: github
repo: netlify/netlify-cms
branch: master
squash_merges: true
publish_mode: editorial_workflow
@ -17,6 +18,18 @@ collections: # A list of collections the CMS should be able to edit
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
- {label: "Position", name: "position", widget: "number"}
- {label: "Body", name: "body", widget: "markdown"}
- name: "blog"
label: "Blog"
label_singular: "Post"
folder: "website/site/content/blog"
create: true
fields:
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
- {label: "Author", name: "author", widget: "string"}
- {label: "Description (for blog list)", name: "description", widget: "text"}
- {label: "Meta Description (defaults to Description)", name: "meta_description", widget: "text", required: false}
- {label: "Date", name: "date", widget: "date"}
- {label: "Body", name: "body", widget: "markdown"}
- name: updates
label: Updates
files:

View File

@ -1,4 +1,5 @@
.docs-content {
.docs-content,
.blog-content {
pre {
margin: 30px -16px !important;
}
@ -9,7 +10,8 @@
}
}
}
.docs.page {
.docs.page,
.blog.page {
padding: 69px $tiny $xl;
text-align: left;
@media screen and (min-width: $mobile) {
@ -121,7 +123,66 @@
}
}
.docs-content {
h1,
h2 {
font-size: 36px;
line-height: 48px;
&.intro-headline {
padding: 0 $small;
margin-bottom: 86px;
}
}
h2 {
font-size: $small;
}
h3 {
color: $grey;
font-size: 20px;
margin-top: $medium;
margin-bottom: $small;
&.inverse {
color: white;
}
}
.meta-info {
font-size: $tiny;
}
table {
width: 100%;
text-align: left;
margin: 34px 0 $medium 0;
th,
td {
padding: $micro;
}
th {
font-size: 18px;
font-weight: $bold;
}
tbody tr {
&:nth-child(odd) {
background: #fdfdfd;
}
}
td {
font-size: 14px;
}
}
}
.docs-content,
.blog-content {
font-size: 18px;
line-height: 28px;
@ -139,7 +200,7 @@
}
h2:not(:first-child) {
margin-top: $large;
margin-top: $medium;
}
p {
@ -177,57 +238,13 @@
padding: initial;
white-space: inherit;
}
}
h1,
h2 {
font-size: 36px;
line-height: 48px;
&.intro-headline {
padding: 0 $small;
margin-bottom: 86px;
}
}
h2 {
font-size: $small;
}
h3 {
color: $grey;
font-size: 20px;
margin-top: $large;
margin-bottom: $small;
&.inverse {
color: white;
}
}
table {
width: 100%;
text-align: left;
margin: 34px 0 $medium 0;
th,
td {
padding: $micro;
}
th {
font-size: 18px;
font-weight: $bold;
}
tbody tr {
&:nth-child(odd) {
background: #fdfdfd;
}
}
td {
font-size: 14px;
}
}
}
.blog-content h1 {
margin-bottom: 0;
}
.blog-list-item h2 {
margin: 48px 0 0;
line-height: 36px;
}

View File

@ -87,7 +87,8 @@ header {
}
}
&.docs {
&.docs,
&.blog {
background: $darkerGrey;
padding: $small 0;