Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update website release ticker via cms #1144

Merged
merged 1 commit into from
Mar 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions website/site/data/updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,27 @@ updates:
- date: 2018-02-21
version: '1.2.2'
description: Fixes ES5 transpiling.
url: 'https://github.com/netlify/netlify-cms/releases/tag/1.2.2'
- date: 2018-02-21
version: '1.2.1'
description: Allows label_singular config for collections and lists and distinct frontmatter delimiters.
url: 'https://github.com/netlify/netlify-cms/releases/tag/1.2.1'
- date: 2018-02-13
version: '1.2'
description: Adds support for multiple frontmatter formats and custom delimiters, UI improvements.
url: 'https://github.com/netlify/netlify-cms/releases/tag/1.2.0'
- date: 2018-01-25
version: '1.1'
description: You can now register external backends and we improved metadata handling.
url: 'https://github.com/netlify/netlify-cms/releases/tag/1.1.0'
- date: 2018-01-23
version: '1.0.4'
description: Fixes various UI bugs and adds expand / collapse functionality to the object widget.
url: 'https://github.com/netlify/netlify-cms/releases/tag/1.0.4'
- date: 2018-12-19
version: '1.0.3'
description: Small bug fix release.
url: 'https://github.com/netlify/netlify-cms/releases/tag/1.0.3'
- date: 2018-12-07
version: '1.0.2'
description: Small bug fix release.
url: 'https://github.com/netlify/netlify-cms/releases/tag/1.0.2'
- date: 2018-12-07
version: '1.0.1'
description: Small bug fix release.
url: 'https://github.com/netlify/netlify-cms/releases/tag/1.0.1'
- date: 2018-12-07
version: '1.0.0'
description: The first major release of Netlify CMS with an all-new UI, revamped documentation and much more.
url: 'https://github.com/netlify/netlify-cms/releases/tag/1.0.0'
2 changes: 1 addition & 1 deletion website/site/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3>{{ .feature | markdownify }}</h3>
<ol>
{{ range .Site.Data.updates }}
{{ range first 3 . }}
<a href="{{ .url }}"><li><div class="update-metadata"><span class="update-version">{{ .version }}</span><span class="update-date">{{ dateFormat "January 2, 2006" .date }}</span></div><span class="update-description">{{ .description | markdownify }}</span></li></a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use the url from the updates.yml?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what this is - Site.Data.updates is read in from the yaml.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was changed from {{ .url }} to https://github.com/netlify/netlify-cms/releases/tag/{{ .version }}. We still have the URL in the Site.Data.updates, though, why not just use that url?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry, should have looked closer.

We're going to drop the urls entirely - that way we don't have to manually enter a url every time, just derive it using the version. Not sure why I didn't drop them.

<a href="https://github.com/netlify/netlify-cms/releases/tag/{{ .version }}"><li><div class="update-metadata"><span class="update-version">{{ .version }}</span><span class="update-date">{{ dateFormat "January 2, 2006" .date }}</span></div><span class="update-description">{{ .description | markdownify }}</span></li></a>
{{ end }}
{{ end }}
</ol>
Expand Down
15 changes: 13 additions & 2 deletions website/site/static/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@ 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: notifications
label: Notifications
- name: updates
label: Updates
files:
- name: releases
label: Releases
file: website/site/data/updates.yml
fields:
- name: updates
label: Releases
widget: list
fields:
- {name: version, label: Version}
- {name: date, label: Date, widget: date}
- {name: description, label: Description}
- name: notifications
label: Notifications
file: website/site/data/notifications.yml
Expand Down